iEntry 10th Anniversary Forum Rules Search
WebProWorld
Register FAQ Calendar Mark Forums Read
Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome.

Share Thread: & Tags

Share Thread:

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-26-2006, 05:05 PM
freehits's Avatar
WebProWorld Veteran
 
Join Date: Sep 2004
Location: Posse's On Broadway
Posts: 952
freehits RepRank 1
Default magpierss - PHP and Reading Atom

So I use magpierss for sticking rss based info into html pagees, its simple and does the trick, also when coupled with topics_anywhere you can add latest forum topics into any page pretty simple.

I have been trying to grab an atom feed with magpierss and not sure the differences with the Atom feed and how to get the elements.

Not an expert on this junk so maybe someoone can suggest how to get the desired effect.

Magpie insert code is like this

Code:
<?php
require_once('magpierss/rss_fetch.inc');
$rss = fetch_rss('http://www.stubhub.com/search/doSearch?pageNumber=1&resultsPerPage=20&format=atom&searchStr=boston+celtics');
	
echo "".$rss->channel[  'title']."";
foreach ($rss->items as $item) {
	$href = $item['href'];
	$title = $item['title'];	
	$desc = $item['description'];	
	echo "

<a href=$href>$title</a>
";
	if($desc)
		echo $desc;
}
?>
with this it grabs the elements of an rss feed, but when used to try to grab the elements of stubhub's Atom feed

Code:
 <entry xmlns="">
      <title type="text">Atlanta Hawks at Charlotte Bobcats Tickets (Preseason)</title>
      <link href="/charlotte-bobcats-tickets/?event_id=335997&amp;search=1"/>
      <id>urn:uuid:stubhub-event-id:335997</id>

      <updated>2006-08-16T00:00:08Z</updated>
      <summary type="xhtml">
         <div xmlns="http://www.w3.org/1999/xhtml">Atlanta Hawks at Charlotte Bobcats Tickets (Preseason)</div>
      </summary>
      <context type="application/xml">
         <result score="0">
            <eventId>335997</eventId>

            <eventDescription>Atlanta Hawks at Charlotte Bobcats Tickets (Preseason)</eventDescription>
            <date>2006-10-27</date>
            <time>20:00:00</time>
            <dateLastModified>2006-08-16T00:00:08Z</dateLastModified>
            <isSparked>0</isSparked>
            <genreId>26089</genreId>

            <channelId>28</channelId>
            <channelName>Sports Tickets</channelName>
            <genreDescription>Charlotte Bobcats Tickets</genreDescription>
            <genreSegmentationList/>
            <genreUrlPath>charlotte-bobcats-tickets</genreUrlPath>
            <geoUrlPath>dean-smith-center-event-tickets</geoUrlPath>

            <evtSegmentationList/>
            <venueId>5404</venueId>
            <venueConfigurationId>6412</venueConfigurationId>
            <geoId>685</geoId>
              </result>
      </context>
   </entry>
   <entry xmlns="">
When grabbing this it gets the top level information
$title = $item['title'];
$desc = $item['description'];

But not sure how to get it to grab the Event level information?

My understanding is that Atom has more levels in its feeds which is why the rss reader is only grabbing the top level information?

Anyone familiar or has a code suggestion to grab the 'result' level elements?
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 09:20 PM.



Search Engine Optimization by vBSEO 3.3.0