I am playing with a few elements inherent to a class pertaining to PHP.
Here is what I try to achieve:
Display your own Twitter RSS on your site.
FYI information your Twitter' RSS is no longer visible but still working, so to grab yours just change the username in the feed's url.
The following code snippet works,(Don't pay attention to formatting)
but I cannot figure how to make non active each Tweet content,the title of each tweets contains the ID so the content does not need to be a link, but I cannot figure how to do that.
I also commented a link to the manual about the class.
To test it just change the username, load it up and and output it in your browser.
<?php
// [
php.net...]
class CeiXML extends SimpleXMLElement{
public function asHTML(){
$ele=dom_import_simplexml($this);
$dom = new DOMDocument('1.0', 'utf-8');
$element=$dom->importNode($ele,true);
$dom->appendChild($element);
return $dom->saveHTML();
}
}
echo"<table width='200'>";
//Define feed URL
$feed_url = 'https://twitter.com/statuses/user_timeline/YOUR TWITTER USERNAME.rss';
//Get content of the URL
$content = file_get_contents($feed_url);
//Prase feeds into class
$feeds = new CeiXML($content);
echo '<tr><td><strong><a href="' .$feeds->channel->link.'</a><br>'. '" title="' .$feeds->channel->title. '">' .$feeds->channel->title. '
</strong></td></tr>';
echo '<tr><td><ul>';
//Output feeds
foreach($feeds->channel->item as $feed2) {
echo '<li><style type="text/css">
a { text-decoration:none }
</style><a href="' .$feed2->link.'</a><br>">' .$feed2->title. '</li>';
}
echo '</ul></td></tr>';
?>