Self:
lastRSS Modified For cURL Use
November 17, 2009 by Kyle BradyTags: cURL, lastRSS, Open Source, PHP, Programming, RSS
As required by the FTC, a Full Disclosure is available - this piece adheres to the Code of Ethics
So I decided to sidestep the issue and rewrite the file acquisition portion of lastRSS to use cURL instead of fopen, and here it is.
The changes are in the Parse() function:
function Parse ($rss_url) {
// Open and load RSS file
// now uses cURL instead of fopen() -- Kyle Brady [http://www.kyle-brady.com]
$ch = curl_init();
if ($ch !== false) {
curl_setopt($ch, CURLOPT_URL, $rss_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$rss_content = curl_exec($ch);
curl_close($ch);
Enjoy.
Kyle can be found on Twitter and MySpace, or reached via email.











