RSSLIB - cURL modded

apps

#1

Looking into getting RSSLIB working on my website. It does not use cURL so it need to be modded to work with DreamHost. If anyone has done this please help me out.

http://www.2rss.com/software.php?page=rsslibdocs


#2

Ok I was able to to get it to work.

You just need to edit a few lines and add some code. I’m not great at explaining, but I’ll give you as much info I can. I only tested for caching since that is what I use and depending on the traffic on your site it’s better just to use that.

Find:

$cache_folder=“tmp”;

Replace with:

$cache_folder=$_SERVER[‘DOCUMENT_ROOT’]. “/(Whatever Directory you have your temp folder in from http root)/tmp”;

Find:
$simple = file($url);

Replace with:
//$simple = file($url);

// CURL mod begin
$ch = curl_init();
$timeout = 5; // set to zero for no timeout
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$file_contents = curl_exec($ch);
curl_close($ch);
$simple = array();
$simple = explode("\n", $file_contents);
// CURL mod end


If you are not caching you also need to change the next line.

Find:
$simple = implode(’’,file($url));

Relace with:

//$simple = implode(’’,file($url));

// CURL mod begin
$ch = curl_init();
$timeout = 5; // set to zero for no timeout
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$file_contents = curl_exec($ch);
curl_close($ch);
$simple = array();
$simple = explode("\n", $file_contents);
// CURL mod end


I’m sure there was a better way to do this but I just used what was in the wiki.