cURL RSS Parsers

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • arakele
    Registered User
    • Feb 2006
    • 38

    #1

    cURL RSS Parsers

    Anybody have any knowledge of RSS Parsers using cURL. My webhost doesn't allow the allow_url_fopen option in the php config.

    I am looking at using rss-feeds with a few affiliates.

    thanks!
    arakele [at] gmail [dot] com
    224739233 [at] ICQ
  • directfiesta
    Too lazy to set a custom title
    • Oct 2002
    • 30135

    #2
    hummmm.... weird.. curl is used in so many instances.

    we allow " allow_url_fopen" on our boxes.
    I know that Asspimple is stoopid ... As he says, it is a FACT !

    But I can't figure out how he can breathe or type , at the same time ....

    Comment

    • brandonstills
      Confirmed User
      • Dec 2007
      • 1964

      #3
      There are so many ways to parse a site. Take a look at a PHP library called Snoopy. It implements the HTTP protocol in PHP so you simulate a browser request.

      Brandon Stills
      Industry and programming veteran
      [email protected] | skype: brandonstills | ICQ #495-171-318

      Comment

      • xenilk
        Confirmed User
        • Jan 2006
        • 921

        #4
        Code:
        function getContent($url)
        {
        	$ch = curl_init ($url);
        	curl_setopt ($ch, CURLOPT_HEADER, 0);
        	curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
        	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        	curl_setopt($ch, CURLOPT_TIMEOUT, 5);
        
        	$result = curl_exec($ch);
        
        	curl_close ($ch);
        	return $result;
        }
        call getContent('http://www.website.com/rss.php'), it'll give you the page's rss feed..

        from there you can either load it under SimpleXML or parse it manually (which could be painful)

        Need more help or need something done? Feel free to contact me at xenilk(at)gmail.com
        40$/Page PSD->XHTML/CSS Transformations

        Comment

        Working...