rss

How to parse an RSS feed using JavaScript?

会有一股神秘感。 提交于 2019-11-26 09:40:25
I need to parse an RSS feed (XML version 2.0) and display the parsed details in an HTML page. haylem Parsing the Feed With jQuery 's jFeed (Don't really recommend that one, see the other options.) jQuery.getFeed({ url : FEED_URL, success : function (feed) { console.log(feed.title); // do more stuff here } }); With jQuery 's Built-in XML Support $.get(FEED_URL, function (data) { $(data).find("entry").each(function () { // or "item" or whatever suits your feed var el = $(this); console.log("------------------------"); console.log("title : " + el.find("title").text()); console.log("author : " +

How to write an RSS feed with Java?

◇◆丶佛笑我妖孽 提交于 2019-11-26 08:48:38
I'm using Java, and need to generate a simple, standards-compliant RSS feed. How can I go about this? Ben Hoffstein I recommend using Rome : // Feed header SyndFeed feed = new SyndFeedImpl(); feed.setFeedType("rss_2.0"); feed.setTitle("Sample Feed"); feed.setLink("http://example.com/"); // Feed entries List entries = new ArrayList(); feed.setEntries(entries); SyndEntry entry = new SyndEntryImpl(); entry.setTitle("Entry #1"); entry.setLink("http://example.com/post/1"); SyndContent description = new SyndContentImpl(); description.setType("text/plain"); description.setValue("There is text in here

RSS Feeds in ASP.NET MVC

微笑、不失礼 提交于 2019-11-26 08:39:26
问题 How would you reccommend handling RSS Feeds in ASP.NET MVC? Using a third party library? Using the RSS stuff in the BCL? Just making an RSS view that renders the XML? Or something completely different? 回答1: Here is what I recommend: Create a class called RssResult that inherits off the abstract base class ActionResult. Override the ExecuteResult method. ExecuteResult has the ControllerContext passed to it by the caller and with this you can get the data and content type. Once you change the

Using SimpleXML to read RSS feed

做~自己de王妃 提交于 2019-11-26 07:38:41
问题 I am using PHP and simpleXML to read the following rss feed: http://feeds.bbci.co.uk/news/england/rss.xml I can get most of the information I want like so: $rss = simplexml_load_file(\'http://feeds.bbci.co.uk/news/england/rss.xml\'); echo \'<h1>\'. $rss->channel->title . \'</h1>\'; foreach ($rss->channel->item as $item) { echo \'<h2><a href=\"\'. $item->link .\'\">\' . $item->title . \"</a></h2>\"; echo \"<p>\" . $item->pubDate . \"</p>\"; echo \"<p>\" . $item->description . \"</p>\"; } But

preg_match(); - Unknown modifier &#39;+&#39; [duplicate]

笑着哭i 提交于 2019-11-26 06:46:53
问题 This question already has answers here : Warning: preg_replace(): Unknown modifier ']' (3 answers) Closed 3 years ago . Alright, so I\'m currently working on parsing an RSS feed. I\'ve gotten the data I need no problem, and all I have left is parsing the game title. Here is the code I currently have (ignore the sloppiness, it is just a proof of concept): <?php $url = \'http://raptr.com/conexion/rss\'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT

How to parse an RSS feed using JavaScript?

扶醉桌前 提交于 2019-11-26 02:04:39
问题 I need to parse an RSS feed (XML version 2.0) and display the parsed details in an HTML page. 回答1: Parsing the Feed With jQuery's jFeed (Don't really recommend that one, see the other options.) jQuery.getFeed({ url : FEED_URL, success : function (feed) { console.log(feed.title); // do more stuff here } }); With jQuery's Built-in XML Support $.get(FEED_URL, function (data) { $(data).find("entry").each(function () { // or "item" or whatever suits your feed var el = $(this); console.log("-------

How to write an RSS feed with Java?

老子叫甜甜 提交于 2019-11-26 02:00:59
问题 I\'m using Java, and need to generate a simple, standards-compliant RSS feed. How can I go about this? 回答1: I recommend using Rome: // Feed header SyndFeed feed = new SyndFeedImpl(); feed.setFeedType("rss_2.0"); feed.setTitle("Sample Feed"); feed.setLink("http://example.com/"); // Feed entries List entries = new ArrayList(); feed.setEntries(entries); SyndEntry entry = new SyndEntryImpl(); entry.setTitle("Entry #1"); entry.setLink("http://example.com/post/1"); SyndContent description = new

Best way to parse RSS/Atom feeds with PHP [closed]

时光总嘲笑我的痴心妄想 提交于 2019-11-26 01:38:54
问题 I\'m currently using Magpie RSS but it sometimes falls over when the RSS or Atom feed isn\'t well formed. Are there any other options for parsing RSS and Atom feeds with PHP? 回答1: Your other options include: SimplePie Last RSS PHP Universal Feed Parser 回答2: I've always used the SimpleXML functions built in to PHP to parse XML documents. It's one of the few generic parsers out there that has an intuitive structure to it, which makes it extremely easy to build a meaningful class for something

Parse RSS with jQuery

妖精的绣舞 提交于 2019-11-26 01:35:17
问题 I want to use jQuery to parse RSS feeds. Can this be done with the base jQuery library out of the box or will I need to use a plugin? 回答1: WARNING The Google Feed API is officially deprecated and doesn't work anymore ! No need for a whole plugin. This will return your RSS as a JSON object to a callback function: function parseRSS(url, callback) { $.ajax({ url: document.location.protocol + '//ajax.googleapis.com/ajax/services/feed/load?v=1.0&num=10&callback=?&q=' + encodeURIComponent(url),