如何使用 youtube api 形成请求以从频道获取视频作为 rss feed?
我读了这个问题,其中给出了新 api (V3) 的链接,但我在那里找不到它。我尝试使用 api v2 中已弃用的语法:
https://gdata.youtube.com/feeds/users/UCqAEtEr0A0Eo2IVcuWBfB9g/uploads
Run Code Online (Sandbox Code Playgroud)
但它只是有时有效。
我也尝试过:
https://www.googleapis.com/youtube/v3/search?key={your_key_here}&channelId={channel_id_here}&part=snippet,id&order=date&maxResults=20
Run Code Online (Sandbox Code Playgroud)
我在其中输入频道 ID 和搜索键,但收到“错误请求”错误。
我正在尝试使用 feedparserpython从 sub_reddit 获取最新的帖子。
我有下面的代码,但当我运行它时它没有返回任何内容。
import feedparser
feed = feedparser.parse("http://www.reddit.com/r/funny/new/.rss")
#feed = feedparser.parse("http://feeds.bbci.co.uk/news/england/london/rss.xml")
feed_entries = feed.entries
for entry in feed.entries:
article_title = entry.title
article_link = entry.link
article_published_at = entry.published # Unicode string
article_published_at_parsed = entry.published_parsed # Time object
print (article_title)
Run Code Online (Sandbox Code Playgroud) 我想从单个URL提供不同的内容,具体取决于用户是浏览器还是RSS阅读器(因此避免使用example.com/feed URL).因此,www.example.com/posts会将(X)HTML页面返回给浏览器,并将RSS源返回给源阅读器.
什么是建筑上最合适的方法来实现这一目标?
PS对于一个软球问题,这是怎么回事...... :)
我在PHP中有一个小站点(无论如何,这是更动态的静态).我看到多个网站发布RSS通量或其他名称.
我想知道是否有可能加载这样的RSS通量,按网站关键字主题过滤它,并使用PHP显示它像一个小主题新闻列.
这个任务很复杂吗?我该怎么办?我是这个领域的全新人,很抱歉,如果已经回答了这样的问题.
在http://simplepie.org/demo/上,如果您插入mashable.com,它会自动提取Feed网址.
怎么做?
我这样做了
<blink>
$xml = file_get_contents(http://weather.yahooapis.com/forecastrss?w=12797541);
$yahoo_response = new SimpleXMLElement($xml , 0, true);
</blink>
Run Code Online (Sandbox Code Playgroud)
我得到了一个像这样的XML解析警告:
PHP Warning: SimpleXMLElement::__construct()
[<a href='simplexmlelement.--construct'>simplexmlelement.--construct</a>]:
I/O warning : failed to load external entity "<?xml version="1.0"
Run Code Online (Sandbox Code Playgroud)
.....
消息的一个重要部分是:
I/O warning : failed to load external entity
Run Code Online (Sandbox Code Playgroud)
我无法用这一行解析任何东西:
echo (string) $yahoo_response->rss->channel->item->title;
Run Code Online (Sandbox Code Playgroud)
有谁知道如何解决这个问题或绕过它?
谢谢,亚历克斯
我是编程的新手,最近为我的应用程序制作了RSS源.现在任何人都可以想到如何从外部RSS订阅源URL将rss源保存到我的本地盒子.谢谢
是否存在现有的Web应用程序,或者是一种简单的方法来构建一个将生产日志重新提供为RSS提要或简单网页等的方法?(RoR 3.0.5)我们希望其他人能够像他们习惯的其他内容一样浏览日志...任何帮助都表示赞赏.谢谢!
如何使用simplexml读取iTunes RSS中的机箱URL标签?
饲料:
<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
<channel>
<item>
<itunes:subtitle> subtitle </itunes:subtitle>
<enclosure url="http://www.myWe/mySound.mp3" length="624557" type="audio/mp3"/>
</item>
</channel>
</rss>
Run Code Online (Sandbox Code Playgroud)
PHP:
foreach ($feed->channel->item as $item) {
$iTunes_item = $item->children('http://www.itunes.com/dtds/podcast-1.0.dtd');
$item_subtitle = $item->subtitle->attributes();
$item_url = $iTunes_item->enclosure->attributes('url'); // enclosure url
echo $item_subtitle;
echo $item_url;
}
Run Code Online (Sandbox Code Playgroud) 我使用的ColdFusion从创建数据库条目的XML文档,当创建XML的<,并>在格式<和>.所以在创建XML之前有没有办法将其更改<为<?
下面是代码和输出示例:
<cfquery name="messages" datasource="showcase_Uk">
select * from t_items where pid = 2 and spid = 45
</cfquery>
<cfset myStruct = StructNew() />
<cfset mystruct.link = "http://showcase.com" />
<cfset myStruct.title = "Examples" />
<cfset mystruct.description = "Examples from UK Showcase" />
<cfset mystruct.pubDate = Now() />
<cfset mystruct.version = "rss_2.0" />
<cfset myStruct.item = ArrayNew(1) />
<cfloop query="messages">
<cfset myStruct.item[currentRow] = StructNew()>
<cfset myStruct.item[currentRow].guid = structNew()>
<cfset myStruct.item[currentRow].guid.isPermaLink="YES"> …Run Code Online (Sandbox Code Playgroud) rss ×10
php ×5
xml ×3
feeds ×2
simplexml ×2
coldfusion ×1
feedparser ×1
filter ×1
javascript ×1
logging ×1
production ×1
python ×1
regex ×1
ruby ×1
user-agent ×1
youtube ×1
youtube-api ×1