That's brilliant Sid... Thank you.
Anything that'll run under PHP 4 though? (This is something we've been beating against for a while, so I almost screamed in joy when this thread appeared.)
Cheers...
> $xml =
> simplexml_load_file('http://twitter.com/statuses/user_timeline/1234567
> 89.xml');
>
> $statuses = array();
>
> foreach ($xml->status as $status)
> {
> $text = htmlspecialchars($status->text);
> $text=preg_replace( "/(?<!<a
> href="" "<a href="">
> target=\"_blank\">\\0</a>", $text );
>
> $statuses[] = array(
> 'text' => $text,
> 'created_at' => $status->created_at,
> 'short_date' => date('M d', strtotime($status->created_at)), ); }
>
> That preg stuff is for converting URLs into HTML a tags. Change
> 123456789 to your twitter ID.
Karl -- NZ PHP Users Group: http://groups.google.com/group/nzphpug To post, send email to [email protected] To unsubscribe, send email to [email protected] |
- [phpug] PHP Twitter class Harvey Kane
- Re: [phpug] PHP Twitter class Simon J Welsh
- Re: [phpug] PHP Twitter class Harvey Kane
- Re: [phpug] PHP Twitter class Jochen Daum
- Re: [phpug] PHP Twitter class Sid Bachtiar
- Re: [phpug] PHP Twitter class Harvey Kane
- Re: [phpug] PHP Twitter class Admin
- Re: [phpug] PHP Twitter class Sid Bachtiar
- Re: [phpug] PHP Twitter class Keri Henare
