Archive for the 'PHP' Category

How to include your twitter on any php-enabled website

We are to do this by creating two files you put serverside. The first one, can be called twitter.php. Here’s the code:
<a href=”http://www.twitter.com/pan100lion”>
<?php
$twitterDOM = new DOMDocument();
$twitterDOM->encoding = ‘UTF-8′;
$twitterDOM->load(”http://twitter.com/statuses/user_timeline/37750230.rss”);
$xslt= new DOMDocument();
$xslt->encoding = ‘UTF-8′;
$xslt->load(”twitterstub.xsl”);
$processor = new XSLTProcessor();
$processor->importStylesheet($xslt);
$output = $processor->transformToDoc($twitterDOM);
echo $output->saveXML();
?>
</a>
Swap the link on the line $twitterDOM->load with your own feed adress. You’ll find it at your twitter [...]