Atom RSS feeds: How do i pull out specific content?

Discussion in 'XML & RSS' started by karate_kid007, Dec 5, 2008.

  1. #1
    Hi All,

    right i am using the following Atom RSS feed on my website

    http://ax.itunes.apple.com/WebObjects/MZStore.woa/wpa/MRSS/topsongs/sf=143444/limit=10/rss.xml?partnerId=2003&TD_PARAM=http%3A%2F%2Fclkuk.tradedoubler.com%2Fclick%3Fp%3D23708%26a%3D1515427%26url%3D

    and i have managed to get all the info to display using

    		$rss = fetch_rss("http://ax.itunes.apple.com/WebObjects/MZStore.woa/wpa/MRSS/topsongs/sf=143444/limit=10/rss.xml?partnerId=2003&TD_PARAM=http%3A%2F%2Fclkuk.tradedoubler.com%2Fclick%3Fp%3D23708%26a%3D1515427%26url%3D");
    		$loop_count = 0;
    			for ($r = 0; $r <= $loop_count; $r++) {
    				foreach ($rss->items as $item){ 
    					if ($r <= $loop_count){
    					$currentItem = $item['current_item'];
    				
    					$content = $item['atom_content'];
    	 				print $content;
    					$r++;
    					}
    				}
    			}
    PHP:
    and i am using magpieRSS

    below is the text from one of the feed items

    O:9:"MagpieRSS":22:{s:6:"parser";i:0;s:12:"current_item";a:0:{}s:5:"items";a:10:{i:0;a:10:{s:5:"title";s:20:"1. Run - Leona Lewis";s:4:"link";s:204:"http://clkuk.tradedoubler.com/click?p=23708&a=1515427&url=http%3A%2F%2Fitunes.apple.com%2FWebObjects%2FMZStore.woa%2Fwa%2FviewAlbum%3Fi%3D295671640%26id%3D295671619%26s%3D143444%26partnerId%3D2003&v0=9990";s:11:"description";s:38:"Run by Leona Lewis from the album [?]
    ";s:7:"pubdate";s:29:"Thu 04 Dec 2008 11:45:33 -800";s:7:"content";a:1:{s:7:"encoded";s:2035:"<TABLE BORDER=0 WIDTH="100%"><TR><TD><table border="0" width="100%" cellspacing="0" cellpadding="0">
    				<tr valign="top" align="left">
    					<td ALIGN=CENTER WIDTH=166 VALIGN=TOP><a href="http://clkuk.tradedoubler.com/click?p=23708&a=1515427&url=http%3A%2F%2Fitunes.apple.com%2FWebObjects%2FMZStore.woa%2Fwa%2FviewAlbum%3Fid%3D295671619%26s%3D143444%26partnerId%3D2003&v0=9990"><img border="0" src="http://a1.phobos.apple.com/us/r1000/050/Music/7c/7a/d5/mzi.lodmcebu.100x100-75.jpg"></a></td>
    					<td width="10"><img alt="" width="10" height="1" src="/images/spacer.gif"></td>
    					<td width="95%"><B><a href="http://clkuk.tradedoubler.com/click?p=23708&a=1515427&url=http%3A%2F%2Fitunes.apple.com%2FWebObjects%2FMZStore.woa%2Fwa%2FviewAlbum%3Fid%3D295671619%26s%3D143444%26partnerId%3D2003&v0=9990">Spirit (The Deluxe Edition)</a></B><br>
    						<a href="http://clkuk.tradedoubler.com/click?p=23708&a=1515427&url=http%3A%2F%2Fitunes.apple.com%2FWebObjects%2FMZStore.woa%2Fwa%2FviewArtist%3Fid%3D208651273%26partnerId%3D2003&v0=9990">Leona Lewis</a><br><br>
    						<font size="3" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular"><B>Release Date:</B>
    						14 November 2008<br>
    						</font><font size="3" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular"><B>Total Songs:</B>
    						23</font><br>
    						<font size="3" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular"><B>Genre:</B>
    						<a href="http://clkuk.tradedoubler.com/click?p=23708&a=1515427&url=http%3A%2F%2Fitunes.apple.com%2FWebObjects%2FMZStore.woa%2Fwa%2FviewGenre%3Fid%3D14%26partnerId%3D2003&v0=9990">Pop</a></font><br>
    						<font size="3" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular"><B>Album Price:</B>
    						£6.99</font><br>
    						<font size="3" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular"><B>Copyright</B>
    						Track 14, 23 (P) 2006; Track 1, 2, 5-12, 18, 19 (P) 2007; Track 3, 4, 13, 15-17, 20-22 (P) 2008 Simco Limited exclusively licensed to Sony BMG Music Entertainment (UK) Limited</font></td>
    				</tr>
    			</table></TD></TR>
    			</TABLE>
    ";}s:8:"category";s:3:"Pop";s:4:"itms";a:11:{s:6:"artist";s:11:"Leona Lewis";s:10:"artistlink";s:176:"http://clkuk.tradedoubler.com/click?p=23708&a=1515427&url=http%3A%2F%2Fitunes.apple.com%2FWebObjects%2FMZStore.woa%2Fwa%2FviewArtist%3Fid%3D208651273%26partnerId%3D2003&v0=9990";s:5:"album";s:27:"Spirit (The Deluxe Edition)";s:9:"albumlink";s:188:"http://clkuk.tradedoubler.com/click?p=23708&a=1515427&url=http%3A%2F%2Fitunes.apple.com%2FWebObjects%2FMZStore.woa%2Fwa%2FviewAlbum%3Fid%3D295671619%26s%3D143444%26partnerId%3D2003&v0=9990";s:10:"albumprice";s:6:"£6.99";s:8:"coverart";s:242:"http://a1.phobos.apple.com/us/r1000/050/Music/7c/7a/d5/mzi.lodmcebu.53x53-50.jpghttp://a1.phobos.apple.com/us/r1000/050/Music/7c/7a/d5/mzi.lodmcebu.60x60-50.jpghttp://a1.phobos.apple.com/us/r1000/050/Music/7c/7a/d5/mzi.lodmcebu.100x100-75.jpg";s:4:"song";s:3:"Run";s:8:"songlink";s:204:"http://clkuk.tradedoubler.com/click?p=23708&a=1515427&url=http%3A%2F%2Fitunes.apple.com%2FWebObjects%2FMZStore.woa%2Fwa%2FviewAlbum%3Fi%3D295671640%26id%3D295671619%26s%3D143444%26partnerId%3D2003&v0=9990";s:4:"rank";s:1:"1";s:6:"rights";s:175:"Track 14, 23 (P) 2006; Track 1, 2, 5-12, 18, 19 (P) 2007; Track 3, 4, 13, 15-17, 20-22 (P) 2008 Simco Limited exclusively licensed to Sony BMG Music Entertainment (UK) Limited";s:11:"releasedate";s:16:"14 November 2008";}s:7:"summary";s:38:"Run by Leona Lewis from the album [?]
    ";s:12:"atom_content";s:2035:"<TABLE BORDER=0 WIDTH="100%"><TR><TD><table border="0" width="100%" cellspacing="0" cellpadding="0">
    				<tr valign="top" align="left">
    					<td ALIGN=CENTER WIDTH=166 VALIGN=TOP><a href="http://clkuk.tradedoubler.com/click?p=23708&a=1515427&url=http%3A%2F%2Fitunes.apple.com%2FWebObjects%2FMZStore.woa%2Fwa%2FviewAlbum%3Fid%3D295671619%26s%3D143444%26partnerId%3D2003&v0=9990"><img border="0" src="http://a1.phobos.apple.com/us/r1000/050/Music/7c/7a/d5/mzi.lodmcebu.100x100-75.jpg"></a></td>
    					<td width="10"><img alt="" width="10" height="1" src="/images/spacer.gif"></td>
    					<td width="95%"><B><a href="http://clkuk.tradedoubler.com/click?p=23708&a=1515427&url=http%3A%2F%2Fitunes.apple.com%2FWebObjects%2FMZStore.woa%2Fwa%2FviewAlbum%3Fid%3D295671619%26s%3D143444%26partnerId%3D2003&v0=9990">Spirit (The Deluxe Edition)</a></B><br>
    						<a href="http://clkuk.tradedoubler.com/click?p=23708&a=1515427&url=http%3A%2F%2Fitunes.apple.com%2FWebObjects%2FMZStore.woa%2Fwa%2FviewArtist%3Fid%3D208651273%26partnerId%3D2003&v0=9990">Leona Lewis</a><br><br>
    						<font size="3" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular"><B>Release Date:</B>
    						14 November 2008<br>
    						</font><font size="3" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular"><B>Total Songs:</B>
    						23</font><br>
    						<font size="3" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular"><B>Genre:</B>
    						<a href="http://clkuk.tradedoubler.com/click?p=23708&a=1515427&url=http%3A%2F%2Fitunes.apple.com%2FWebObjects%2FMZStore.woa%2Fwa%2FviewGenre%3Fid%3D14%26partnerId%3D2003&v0=9990">Pop</a></font><br>
    						<font size="3" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular"><B>Album Price:</B>
    						£6.99</font><br>
    						<font size="3" FACE="Helvetica,Arial,Geneva,Swiss,SunSans-Regular"><B>Copyright</B>
    						Track 14, 23 (P) 2006; Track 1, 2, 5-12, 18, 19 (P) 2007; Track 3, 4, 13, 15-17, 20-22 (P) 2008 Simco Limited exclusively licensed to Sony BMG Music Entertainment (UK) Limited</font></td>
    				</tr>
    			</table>
    Code (markup):
    i can get the title but using:
    $title = $item['title'];
    print $title;
    PHP:
    but i am unable to get the image, album + price info?

    can anyone shed some light on this for me please
    Many Thanks
    Luke
     
    karate_kid007, Dec 5, 2008 IP