/ Published in: PHP
URL: http://bavotasan.com/tutorials/a-better-twitter-feed-for-your-web-site/#comment-8534
Expand |
Embed | Plain Text
<ul> <?php $feedURL = "http://twitter.com/statuses/user_timeline/68559295.rss"; // change to your feed URL $doc = new DOMDocument(); $doc->load($feedURL); foreach ($doc->getElementsByTagName('item') as $node) { 'title' => $node->getElementsByTagName('title')->item(0)->nodeValue, ); } $limit = 5; for($x=0;$x<$limit;$x++) { $str = ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]","<a href=\"\\0\">\\0</a>", $title); $pattern = '/[#|@][^\s]*/'; foreach($matches[0] as $keyword) { $search = "<a href=\"http://twitter.com/$link\">$keyword</a>"; } else { $search = "<a href=\"http://twitter.com/#search?q=$link\" class=\"grey\">$keyword</a>"; } } } ?> </ul>
Comments
Subscribe to comments
You need to login to post a comment.

You can no longer use this method as Twitter has stopped the use of RSS feeds