-
Notifications
You must be signed in to change notification settings - Fork 33
Example
jdp edited this page Sep 13, 2010
·
6 revisions
twitterlibphp was designed to be as simple to use as possible. Here is a simple way to return the XML from your profile:
<?php
// require the twitter library
require "twitter.lib.php";
// your twitter username and password
$username = "robotdinosaur";
$password = "secret - edit this";
// initialize the twitter class
$twitter = new Twitter($username, $password);
// fetch your profile in xml format
$xml = $twitter->showUser("xml", $username);
// display the raw xml
echo "<pre>";
echo htmlentities($xml);
echo "“;
?>
Now the $xml variable contains the XML data of your Twitter profile, and you can use it for whatever you need to.