Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    New Coder
    Join Date
    May 2013
    Posts
    40
    Thanks
    14
    Thanked 0 Times in 0 Posts

    need help setting a rss feed

    I need help setting up a rss feed for a site. I got an xml file, but seems like the format is wrong. I am helping a friend and he got it from a website the rss feed. Heres a small part of the xml file
    Code:
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <rss version="2.0">
    <events>
      <event>
        <iid>554552</iid>
        <title>EQUANOXX: RUBI &amp; SUPER JAIMIE + SEPH &amp; T√‰TE DE LA COURSE @ HOTEL CHANTELLE</title>
        <description>10/10 EQUANOXX: RUBI &amp; SUPER JAIMIE + SEPH &amp; TTE DE LA COURSE</description>
        <summary />
        <starttime>10:00PM</starttime>
        <enddate />
        <endtime>4:00AM</endtime>
        <event_type>Dance, DJ Events</event_type>
        <dress_code>Be yourself / Trendy</dress_code>
        <music_code>House</music_code>
        <price>No Cover</price>
        <image_url>http://images.clubzone.com/events/images/554552/554552-1t.jpg</image_url>
        <city_name>New York</city_name>
        <venue_name>All/Other</venue_name>
        <venue_url>http://www.clubzone.com/c/All_Other/Promotions/All_f_Other.html</venue_url>
        <address>1234 Other Street</address>
        <province>NY</province>
        <postal_code_zip />
        <ticket_url />
        <guestlist_url />
      </event>
      <event>
        <iid>554552</iid>
        <title>EQUANOXX: RUBI &amp; SUPER JAIMIE + SEPH &amp; T√‰TE DE LA COURSE @ HOTEL CHANTELLE</title>
        <description>10/10 EQUANOXX: RUBI &amp; SUPER JAIMIE + SEPH &amp; TTE DE LA COURSE</description>
        <summary />
        <starttime>10:00PM</starttime>
        <enddate />
        <endtime>4:00AM</endtime>
        <event_type>Dance, DJ Events</event_type>
        <dress_code>Be yourself / Trendy</dress_code>
        <music_code>House</music_code>
        <price>No Cover</price>
        <image_url>http://images.clubzone.com/events/images/554552/554552-1t.jpg</image_url>
        <city_name>New York</city_name>
        <venue_name>All/Other</venue_name>
        <venue_url>http://www.clubzone.com/c/All_Other/Promotions/All_f_Other.html</venue_url>
        <address>1234 Other Street</address>
        <province>NY</province>
        <postal_code_zip />
        <ticket_url />
        <guestlist_url />
      </event>
      </events>
    Do I need to change anything? I did a validator thing, and said not valid. He got it from like a club promotion site and I am wounding why would that site have wrong format.

  • #2
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,539
    Thanks
    8
    Thanked 1,093 Times in 1,084 Posts
    What is the exact URL to the RSS feed that you are trying to get?

    I would say hardly any RSS feeds are valid. It doesn't really matter though if you use PHP to create your own RSS reader. It's really just an XML file.

  • #3
    New Coder
    Join Date
    May 2013
    Posts
    40
    Thanks
    14
    Thanked 0 Times in 0 Posts
    Hey, oh ok yeah i never done anything with rss. the guy im doing this said that someone told him the problem is the xml is not valid and his php code is outdated or something
    heres the url
    http://images.clubzone.com/xml/sensationnyc/events.xml

    warning takes few sec to load

  • #4
    Senior Coder
    Join Date
    Aug 2006
    Posts
    1,441
    Thanks
    11
    Thanked 305 Times in 304 Posts
    Interestingly, that file doesn't have the line:
    Code:
    <rss version="2.0">
    in it. Are you sure they claim it's an RSS formatted file?

  • Users who have thanked tracknut for this post:

    cpamieta (08-04-2013)

  • #5
    New Coder
    Join Date
    May 2013
    Posts
    40
    Thanks
    14
    Thanked 0 Times in 0 Posts
    yeah i saw that too, maybe they are using it as a database an xml file? I went on the site and i see nothing about rss feed. The guy im doing this for said he emailed them and they sent this file or somthing.

  • #6
    Senior Coder
    Join Date
    Aug 2006
    Posts
    1,441
    Thanks
    11
    Thanked 305 Times in 304 Posts
    Well, like mlseim says, if you're just trying to read and display it on your site, it doesn't matter much whether it's rss or any other xml file. I just would ignore the "this is rss", as it's not.

  • Users who have thanked tracknut for this post:

    cpamieta (08-04-2013)

  • #7
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,539
    Thanks
    8
    Thanked 1,093 Times in 1,084 Posts
    Below is a script you can try for testing. They have a problem with their XML file in that many of the entries are repeated several times. You would need to not only parse the XML, but also remove duplicates. My example script lists the first 100 of them and does not remove duplicates.

    Their duplicate issue makes the XML file super huge. It also takes a very long time to load the poorly constructed (and huge) XML file.

    Here is my working test script (as shown below):
    http://www.catpin.com/test.php

    Copy, paste this to your editor, call it "test.php", upload it, and run it:
    PHP Code:
    <?php  
    // Test to read Clubzone XML 
    $feed_url "http://images.clubzone.com/xml/sensationnyc/events.xml";

    // PHP CURL FUNCTIONS 
    $curl curl_init(); 
    curl_setopt($curlCURLOPT_URL,"$feed_url"); 
    curl_setopt($curlCURLOPT_RETURNTRANSFER1); 
    curl_setopt($curlCURLOPT_CONNECTTIMEOUT0); 
    $xmlData curl_exec($curl); 
    curl_close($curl); 
    $data simplexml_load_string($xmlData); 

    // How many items to display 
    $count 100

    foreach(
    $data->event as $item) {
    if(
    $count 0){
    $newstring=$item->description;
    $newtitle=$item->title;
    $iid=$item->iid;
    $image=$item->image_url;
    // Remove or replace non-standard coded characters.
    $newstring str_replace("‚€™","`",$newstring);
    $newstring str_replace("¬"," ",$newstring);
    $newstring str_replace("\"","'",$newstring);
    $newstring preg_replace('/[^\x20-\x7F]+/'' '$newstring);
    $newtitle str_replace("‚€™","`",$newtitle);
    $newtitle str_replace("¬"," ",$newtitle);
    $newtitle str_replace("\"","'",$newtitle);
    $newtitle preg_replace('/[^\x20-\x7F]+/'' '$newtitle);
    echo

    <div style='font-family:arial; font-size:.8em; padding-top:30px;'>
    <img src='$image' style='float:left; padding:0px 15px 10px 0px;' />
    <strong>$iid</strong> - <b>$newtitle</b><br />
    $newstring ... <a href='{$item->venue_url}'>read more</a> 
    </div>
    <div style='clear:both;'></div>
    "
    ;

    $count--; 
    }
    ?>
    Last edited by mlseim; 08-03-2013 at 08:10 PM.

  • Users who have thanked mlseim for this post:

    cpamieta (08-04-2013)

  • #8
    New Coder
    Join Date
    May 2013
    Posts
    40
    Thanks
    14
    Thanked 0 Times in 0 Posts
    Thanks guys, I got it to work with the xml file just had to change some stuff in php


  •  

    Posting Permissions

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