NYCPHP Meetup

NYPHP.org

[nycphp-talk] Re: [liphp] userfriendly.org

Hans Zaunere hans at nyphp.org
Fri Jul 11 16:34:05 EDT 2003



Aram Mirzadeh wrote:

> Well I found a LWP/Perl program at: http://develooper.com/code/ufget/
> But no PHP version, I would need to run this in cron during the morning
> to cache it locally.  I was hoping to be able to do it dynamically with
> php.  
> 
> Well if anyone finds one let me know, otherwise I'll try to write one in
> the next couple of days. 

Not the prettiest, easily fooled and generally ugly... but it seems to work for now:


function getuflatest() {
   $ufpage = implode('',file('http://www.userfriendly.org'));
   $latestpos = strpos($ufpage,'Latest Strip');
   $uforgpos = strpos($ufpage,'http://www.userfriendly.org/',$latestpos);
   $gifpos = strpos($ufpage,'.gif"',$uforgpos);
   $uflatest = substr($ufpage,$uforgpos,$gifpos-$uforgpos+4);

   return $uflatest;
}


H





More information about the talk mailing list