rss

Get enclosure img url from rss feed

蓝咒 提交于 2019-12-01 06:13:33
I have a problem with an rss feed in php. I want do get the img-url from "enclosure" but it´s not working. My code just now: $rss = simplexml_load_file($url); $i = 0; if($rss) { $items = $rss->channel->item; foreach($items as $item) { $title = $item->title; $link = $item->link; $published_on = $item->pubDate; $phpDate = strtotime($published_on); $enclosure = $item['enclosure'][0]['url']; From the RSS: <enclosure url="http://www.svenskafans.com/image/7/141433/Snalla-Pelle-stanna-i-Gefle.jpg" lenght="51265" type="image/jpeg" /> Important to note is that sometimes there is not enclosure-tag with

How to read image tag from RSS itunes

青春壹個敷衍的年華 提交于 2019-12-01 06:06:41
问题 I try to read my iTunes RSS. I can read title, even itunes:subtitle but I have problems with the tag image. FEED: <?xml version="1.0" encoding="UTF-8"?> <rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0"> <channel> <title>title of the podcast</title> <itunes:image href="http://www.MyWeb/myImg.png"/> </channel> </rss> PHP: $xml=("http://www.myWeb/rss.xml"); $xmlDoc = new DOMDocument(); $xmlDoc->load($xml); $channel=$xmlDoc->getElementsByTagName('channel')->item(0);

How to display RSS feeds from other sites

徘徊边缘 提交于 2019-12-01 05:34:00
问题 I have been researching this topic for a few days now and i'm still non the wiser as on how to do it. I want to get an RSS feed from forexfactory.com to my website, i want to do some formatting on whats happening and i also want the latest information from them (Although those last two points can wait as long as i have some more or feed running). Preferably I'd like to develop this from the ground up if anyone knows of a tutorial or something i could use? If not i will settle for using a

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

社会主义新天地 提交于 2019-12-01 05:19:05
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; // displays "<media:content>"} but i can't get it to work. Here's my script and feed i'm trying to parse: <

Building a Simple RSS reader, retrieving content

痴心易碎 提交于 2019-12-01 05:02:55
问题 I am trying to make a simple RSS reader using SyndicationFeed class. There are some standard tags, like <title> , <link> , <description> ... there is no problem with them. But there are some other tags. for example, in this feed, which created by WordPress, there is <content:encoded> tag. I think there may be other tags for the content part of other websites. right? I want to know, how to find the main content of every post, is there any standards? which tags should I look for? (for example,

XML parsing : Reading CDATA

陌路散爱 提交于 2019-12-01 04:59:54
问题 <item><title>this is title</title><guid isPermaLink="true">http://www.i.com/video/nokia-lumia-920-deki-pureview_2879.html</guid><link>http://www.i.com/video/nokia-lumia-920-deki-pureview_2879.html</link> <description><![CDATA[this is the info.]]></description> <pubDate>Wed, 5 Sep 2012 22:10:00 UT</pubDate> <media:content type="image/jpg" expression="sample" fileSize="2956" medium="image" url="http://media.chip.com.tr/images/content/video/88/201209060102428081-0.jpg"/> <enclosure type="image

Simple Xml - Element Declared Twice Error

拈花ヽ惹草 提交于 2019-12-01 04:53:21
I have been trying to wrap a set of classes based on Simple XML (Java Serializer) around a RSS Feed. The sample feed is <?xml version="1.0" encoding="UTF-8"?> <rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"> <channel> <title>Coding Horror</title> <link>http://www.codinghorror.com/blog/</link> <description>programming and human factors - Jeff Atwood</description> <language>en-us</language> <lastBuildDate>Wed, 04 May 2011 20:34:18 -0700</lastBuildDate> <pubDate>Wed, 04 May 2011 20:34:18 -0700</pubDate> <generator>http://www.typepad.com/<

SyndicationFeed: Content as CDATA?

谁说胖子不能爱 提交于 2019-12-01 04:48:27
问题 I'm using .NET's SyndicationFeed to create RSS and ATOM feeds. Unfortunately, I need HTML content in the description element (the Content property of the SyndicationItem) and the formatter automatically encodes the HTML, but I'd rather have the entire description element wrapped in CDATA without encoding the HTML. My (simple) code: var feed = new SyndicationFeed("Title", "Description", new Uri("http://someuri.com")); var items = new List<SyndicationItem>(); var item = new SyndicationItem(

Reading RSS feed using jQuery

佐手、 提交于 2019-12-01 04:32:28
问题 I'm trying to show the title of my latest stumbleupon item using their RSS feed and jquery. The function I have is: function get_stumbleupon() { $.get("http://rss.stumbleupon.com/user/fredkelly/", function(data) { alert(data.title); }, "xml"); } Which returns nothing... I just simply want to get a few bits of info about the single latest item in the feed - how can I do this? 回答1: Here's a tutorial on how to do Cross domain ajax with JQuery. 回答2: Ólafur Waage gave a good cross site request

java.io.FileNotFoundException for valid URL

两盒软妹~` 提交于 2019-12-01 03:51:39
I use library rome.dev.java.net to fetch RSS. Code is URL feedUrl = new URL("http://planet.rubyonrails.ru/xml/rss"); SyndFeedInput input = new SyndFeedInput(); SyndFeed feed = input.build(new XmlReader(feedUrl)); You can check that http://planet.rubyonrails.ru/xml/rss is valid URL and the page is shown in browser. But I get exception from my application java.io.FileNotFoundException: http://planet.rubyonrails.ru/xml/rss at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1311) at com.sun.syndication.io.XmlReader.<init>(XmlReader.java:237) at com.sun.syndication