rss

How to Parse XML's Media:Content with PHP?

血红的双手。 提交于 2019-12-30 09:16:48
问题 I've found a great tutorial on how to accomplish most of the work at: https://www.developphp.com/video/PHP/simpleXML-Tutorial-Learn-to-Parse-XML-Files-and-RSS-Feeds but I can't understand how to extract media:content images from the feeds. I've read as much info as i can find, but i'm still stuck. ie: How to get media:content with SimpleXML this suggests using: foreach ($xml->channel->item as $news){ $ns_media = $news->children('http://search.yahoo.com/mrss/'); echo $ns_media->content; //

'OR' operator in XPath predicate?

北城余情 提交于 2019-12-30 02:36:11
问题 What is the XPath expression to select <link> elements with type="application/rss+xml" OR type="application/atom+xml" (RSS and Atom feeds) link[@rel='alternate'][@type='application/rss+xml'] selects RSS feeds link[@rel='alternate'][@type='application/atom+xml'] selects Atom feeds But what is the single XPath expression for selecting them both? Thank you. 回答1: use: link[@rel='alternate'][@type='application/rss+xml' or @type='application/atom+xml'] see http://www.w3.org/TR/xpath/#NT-OrExpr You

Can I serve RSS in JSON?

☆樱花仙子☆ 提交于 2019-12-29 18:45:34
问题 I am writing an RSS feed (for fun) and was looking at the spec here. RSS is a dialect of XML. All RSS files must conform to the XML 1.0 specification, as published on the World Wide Web Consortium (W3C) website. Obviously this means that I am not serving 'pure' RSS if I choose the JSON option. That said, if I conform to the rest of the spec, is it likely that (customised) readers will be able to parse it? To put it another way, if I conform to the spec, but using JSON instead of XML is it a

How to open my Android app when rss link is opened in browser?

限于喜欢 提交于 2019-12-29 18:02:35
问题 I'm creating an rss aggregator for my Android phone. I'd like to be able to subscribe to an rss feed from the browser since most websites have a subscribe via rss button. How can I build an intent filter to receive those links? This question was similar and showed how to create an intent filter to handle browser links: Make a link in the Android browser start up my app? However, I don't know how to make it specific to rss feeds. As an attempt I tried this filter: <intent-filter> <action

How to open my Android app when rss link is opened in browser?

ぃ、小莉子 提交于 2019-12-29 18:02:05
问题 I'm creating an rss aggregator for my Android phone. I'd like to be able to subscribe to an rss feed from the browser since most websites have a subscribe via rss button. How can I build an intent filter to receive those links? This question was similar and showed how to create an intent filter to handle browser links: Make a link in the Android browser start up my app? However, I don't know how to make it specific to rss feeds. As an attempt I tried this filter: <intent-filter> <action

Parsing Google News RSS with PHP

泪湿孤枕 提交于 2019-12-29 05:00:07
问题 I want to parse Google News rss with PHP. I managed to run this code: <? $news = simplexml_load_file('http://news.google.com/news?pz=1&cf=all&ned=us&hl=en&topic=n&output=rss'); foreach($news->channel->item as $item) { echo "<strong>" . $item->title . "</strong><br />"; echo strip_tags($item->description) ."<br /><br />"; } ?> However, I'm unable to solve following problems. For example: How can i get the hyperlink of the news title? As each of the Google news has many related news links in

Google Chrome rendering XML as text for RSS feed

北城余情 提交于 2019-12-29 04:35:09
问题 I have this script to generate an XML file for an RSS feed. Works great in every browser except Chrome. Chrome just renders the XML as text. Something to do with header("Content-Type: application/rss+xml; charset=ISO-8859-1"); possibly? This is the code I'm using: <?php $linkUp = "http://localhost/sites/myBlog/"; header("Content-Type: application/rss+xml; charset=ISO-8859-1"); $rssfeed = '<?xml version="1.0" encoding="ISO-8859-1"?>'; $rssfeed .= '<rss version="2.0">'; $rssfeed .= '<channel>';

convert rss to JSON [closed]

偶尔善良 提交于 2019-12-29 03:21:47
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . craigslist has an rss feed and i wish to convert the feed to JSON format so that I can parse it. anybody know any tool that can do this - convert craigslist rss (or any rss) to JSON format 回答1: UPDATE : beware, Yahoo Pipes has now been shutdown by Yahoo! and the Google Feed API has been deprecated. Check

Sax parsing and encoding

时光怂恿深爱的人放手 提交于 2019-12-28 18:04:24
问题 I have a contact that is experiencing trouble with SAX when parsing RSS and Atom files. According to him, it's as if text coming from the Item elements is truncated at an apostrophe or sometimes an accented character. There seems to be a problem with encoding too. I've given SAX a try and I have some truncating taking place too but haven't been able to dig further. I'd appreciate some suggestions if someone out there has tackled this before. This is the code that's being used in the

SelectNodes not working on stackoverflow feed

試著忘記壹切 提交于 2019-12-28 04:18:04
问题 I'm trying to add support for stackoverflow feeds in my rss reader but SelectNodes and SelectSingleNode have no effect. This is probably something to do with ATOM and xml namespaces that I just don't understand yet. I have gotten it to work by removing all attributes from the feed tag, but that's a hack and I would like to do it properly. So, how do you use SelectNodes with atom feeds? Here's a snippet of the feed. <?xml version="1.0" encoding="utf-8"?> <feed xmlns="http://www.w3.org/2005