Skip to content

Instantly share code, notes, and snippets.

@nazt
Created April 19, 2010 16:42
Show Gist options
  • Save nazt/371263 to your computer and use it in GitHub Desktop.
Save nazt/371263 to your computer and use it in GitHub Desktop.
<?
require_once("/home/natz/twitter/lib/twitter.lib.php");
require_once('/home/natz/twitter/common.class.php');
$common=new Common();
$twitter=new Twitter($common->twitter->getUsername(),$common->twitter->getPassword());
$followers = $twitter->getFollowers();// array("cursor"=>-1)
try {
$xml = new SimpleXMLElement($followers);
} catch (Exception $e) {
echo "eror : ";
print_r($e);
}
foreach ($xml->user as $follower)
{
if($follower->following=="false")
{
echo "Following ... ". $follower->screen_name . "\n";
$twitter->createFriendship( array("id"=>$follower->id,"follow"=>true) );
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment