SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Member
    Join Date
    Dec 2011
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    RSS Feeds Question

    Could someone check this link out (website mock-up), looking specifically at the 'Cody Chamber of Commerce Upcoming Events and Meetings' section

    http://www.walkingstar.com/ccbab-201...e-idea-1b.html

    I am wondering if we can have a direct link to the Cody Chamber of Commerce's RSS on the homepage that looks EXACTLY like this. As if the visitor was viewing that section on the Chamber's website with the text list of 'Upcoming Events and Meetings'. NOT an RSS feed icon, but an actual list of the events in text form that updates whenever the Chamber updates that section on their site. I can create the top of that section with a calendar and image. I'm just wondering about the calendar text.

    Any help would be appreciated!

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    23,598
    Mentioned
    411 Post(s)
    Tagged
    6 Thread(s)
    If the other site has an RSS feed with those titles, then yes, you can pull them in to your site, though it requires some scripting (like PHP), so this thread should probably be moved to that forum. As for the appearance, that's handled by CSS.

  3. #3
    SitePoint Member
    Join Date
    Dec 2011
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Okay, I'll repost this in the .PHP section. Thank you!

  4. #4
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    23,598
    Mentioned
    411 Post(s)
    Tagged
    6 Thread(s)
    No, don't worry. I've moved this thread for you.

  5. #5
    SitePoint Wizard silver trophybronze trophy Cups's Avatar
    Join Date
    Oct 2006
    Location
    France, deep rural.
    Posts
    6,869
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    I would seriously consider grabbing the target rss feed, say every few hours or once a day and caching it on your server.

    You could use cURL to do this fetching, invoked by a cron job.

    Then the rss feed is simply an xml file on your own server.

    Grab that file and pass it to simpleXML, extract what you need and format the results in a way that suits you, potentially then cache these results as a html snippet and simply include them in the correct place on your own server.

    Trying to import and formatting the file in one go leaves you prone to latency problems and will make your home page seem slower to load. Hence, divide the job up.

    Try googling for simplexml rss, but bear in mind many of these tutorials will show you how to do the two operations in one hit and may depend upon file_get_contents() which may not be enabled if you are on a shared server.

    Some RSS reader classes (magpie etc) have been written to parse and also create rss feeds, but are probably overkill for what you want to do.

  6. #6
    SitePoint Zealot Sogo7's Avatar
    Join Date
    May 2011
    Posts
    129
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Using cURL or Magpie is way more complicated than is needed, how about using this code to grab the feed.
    PHP Code:
    <?php
    $url 
    'http://www.codychamber.org/events.cfm?rss=1';
    $xml simplexml_load_file($url);

    for (
    $i=1$i<=5$i++){
    $data0 $xml->channel[0]->item[$i]->title[0];// title
    $data1 $xml->channel[0]->item[$i]->description[0];// description

    echo "<h4>".$data0."</h4></br>";
    echo 
    $data1."</br>";
    echo 
    "</br>";
    }
    ?>
    You can either grab and process the feed in real time while the page loads, but it will cause a small delay or
    alternatively run the script as a cron job then store the output as a simple flat/text file that can incorperated into the page.

    If you want to get really slick there is the 'double tap' system where the page loads up with the stored information then makes an AJAX call to check the RSS feed to see if anything has changed since the scheduled look and swaps the any stuff into the page half a second or so after loading finishes. A good example of this in action is the job scanner over lovelogic.net because you can see the change take place.

  7. #7
    SitePoint Member
    Join Date
    Dec 2011
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    WOW, these answers are way over my head! Thank you both for your replies/suggestions! I think I'll need to hire someone to help us get this RSS feed the way the client want it. Any suggestions on that? Or anyone want to get together and walk me through what I need to do? I'm afraid I would need a lot of hand holding.


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •