GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Webmaster Q & Fuckin' A (https://gfy.com/forumdisplay.php?f=27)
-   -   cURL RSS Parsers (https://gfy.com/showthread.php?t=831556)

arakele 05-29-2008 02:44 PM

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!

directfiesta 05-29-2008 04:12 PM

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

we allow " allow_url_fopen" on our boxes.

brandonstills 05-31-2008 12:22 AM

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.

xenilk 05-31-2008 01:28 PM

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


All times are GMT -7. The time now is 09:27 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123