v0.7.15
podcast_search
一個用於搜尋播客並解析播客 RSS 源的程式庫。支援 iTunes 和 PodcastIndex 目錄,以及章節和文字稿等新功能。
36喜歡 1400近 30 天下載160Pub 分數
AndroidiOSmacOSWindowsLinux
一個簡單的程式庫,提供對 iTunes 播客搜尋 API 的程式化存取。
以下為英文專案原文快照,最新內容請造訪 GitHub。
A library for searching for podcasts, parsing podcast RSS feeds and obtaining episodes details. Supports searching via iTunes and PodcastIndex.
Search for podcasts with 'widgets' in the title and find the top podcasts. Both examples limit to 10 results and are set for the United Kingdom:
import 'package:podcast_search/podcast_search.dart';
// ignore_for_file: avoid_print
void main() async {
var search = Search();
/// Search for podcasts with 'widgets' in the title.
var results =
await search.search('widgets', country: Country.unitedKingdom, limit: 10);
/// List the name of each podcast found.
for (var result in results.items) {
print('Found podcast: ${result.trackName}');
}
/// Parse the first podcast.
final feed = results.items[0].feedUrl;
/// It is possible to get back a podcast with a missing feed URL, so check that.
if (feed != null) {
var podcast = await Feed.loadFeed(url: feed);
/// Display episode titles.
for (var episode in podcast.episodes) {
print('Episode title: ${episode.title}');
}
}
/// Find the top 10 podcasts in the UK.
var charts = await search.charts(limit: 10, country: Country.unitedKingdom);
/// List the name of each podcast found.
for (var result in charts.items) {
print('Episode title: ${result.trackName}');
}
}