across the network: Kyle Brady: Blog  |  Kyle Brady: Fiction  |  Kyle Brady: Status  |  Kyle Brady: Stream  |  Kyle Brady: Projects  |  Kyle Brady: Profile contact
across the internet: on Twitter | on Facebook | more...

Self:

lastRSS Modified For cURL Use



subscribe to Self posts:  rss - email



I recently had to use lastRSS for a project to parse some RSS feeds using PHP, and my server was being cranky about using fopen() to access URLs - despite being overridden to allow it.

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.

Self posts are about me (Kyle Brady), in one form or another.
Kyle can be found on Twitter and MySpace, or reached via email.


subscribe to Self posts:  rss - email

submit to reddit Add to Mixx! Share on Facbeook Retweet
Printable Version Printable Version

More Self Pieces

see more...


Commenting Rules

The following is a basic set of rules that are enforced for all commenters.

Any violations of these rules will result in comment deletion, user bans, or both.

  1. No excessively foul language.
  2. No racist remarks.
  3. No SPAMing, unrelated linking, or otherwise unnecessary promotion of outside material.
  4. No trolling.
  5. Be respectful.
  6. Be valuable.
  7. Feel free to respond, argue, or counter-point an article - but do so coherently and intelligently.
  8. Use a personal nickname, commenting account, or moniker. Do not use your business' or website name/account.
  9. Do not trackback/pingback to this post unless your content is relevant.
also available as a standalone page

  • Thank you, i save my life in the last moment. Good Job¡¡¡
blog comments powered by Disqus
Kyle Brady: Blog
coherent thoughts on diverse topics


Site Navigation:
About Columns Ethics Rules Contact