This API serves to search podcasts and informations about it. Uses metadata from Gpoddernet.
This library relies on Fetch API. And this API is supported in the following browsers.
39+ ✔ | 42+ ✔ | 29+ ✔ | 10.1+ ✔ | Nope ✘ |
This library depends on fetch to make requests to the Gpoddernet API. For environments that don't support fetch, you'll need to provide a polyfill to browser or polyfill to Node.
$ npm install podcast-search --save
//to import a specific method
import { method } from 'podcast-search';
//to import everything
import * as podcastSearch from 'podcast-search';
var podcastSearch = require('podcast-search');
<!-- to import non-minified version -->
<script src="podcast-search.umd.js"></script>
<!-- to import minified version -->
<script src="podcast-search.umd.min.js"></script>
Follow the methods that the library provides.
Search for podcasts with provided query.
Argument | Type | Options |
---|---|---|
query | string | 'Search query' |
A promise object containing a list of podcasts data.
A title of podcast.
URL to feed of podcast.
Website of podcast.
A description about the podcast.
A image that represents the podcast.
A link to mygpo page podcast
A link to mygpo scaled imagem that represents the podcast.
Quantity of users that subscribed the podcast.
Quantity of users that subscribed the podcast in last week.
podcastSearch.search('nerdcast')
.then(data => {
console.log(data[0].description);
});
// print: 'O mundo vira piada no Jovem Nerd'.
List top podcasts.
Argument | Type | Options |
---|---|---|
qtd | int | 'Quantity query' |
A promise object containing a list of top podcasts. The functions are the same that the search method.
podcastSearch.top(5)
.then(data => {
for(let i = 0; i < 5; i++){
console.log(data[i].title);
}
});
// print 5 top podcasts of the moment.
List data of tags.
Argument | Type | Options |
---|---|---|
qtd | int | 'Quantity query' |
A promise object containing a list of tags.
Name of tag.
Title of the tag.
Quantity that was used.
podcastSearch.listTags(5)
.then(data => {
for(let i = 0; i < 5; i++){
console.log(data[i].tag);
}
});
// print list of 5 tags name.
A list of podcasts that represent the tag.
Argument | Type | Options |
---|---|---|
tag | string | 'Tag query' |
qtd | int | 'Quantity query' |
A promise object containing a list of podcasts. The functions are the same that the search method.
podcastSearch.tagName("news-politics", 5)
.then(data => {
for(let i = 0; i < 5; i++){
console.log(data[i].title);
}
});
// print list of 5 title podcasts that have the tag news-politics.
Informations about podcast that was passed by parameter.
Argument | Type | Options |
---|---|---|
url | string | 'Url query' |
A promise object containing a podcast. The functions are the same that the search method.
podcastSearch.info("http://jovemnerd.ig.com.br/categoria/nerdcast/feed/rss/")
.then(data => {
console.log(data.title);
});
// print 'Nerdcast'.