<?php
// curl twitter follow script
set_time_limit(3600);
function follow($username)
{
$url = "http://username:[email protected]/friendships/create/$username.json";
if (!$curld = curl_init()) {
echo "Could not initialize cURL session.\n";
exit;
}
echo $url;
if (!$curld = curl_init()) {
echo "Could not initialize cURL session.\n";
exit;
}
curl_setopt($curld, CURLOPT_GET, true);
curl_setopt($curld, CURLOPT_URL, $url);
curl_setopt($curld, CURLOPT_HEADER, false);
curl_setopt($curld, CURLOPT_RETURNTRANSFER, true);
$output=curl_exec($curld);
//echo "Received data: \n\n$output\n\n";
$pile=json_decode($output,true);
return $pile;
}
$handle = @fopen("follow.txt", "r");
if ($handle) {
while (!feof($handle)) {
$users[] = fgets($handle, 4096);
}
fclose($handle);
}
foreach($users as $key=> $value){
$user=ereg_replace("\n","",$value);
$result=follow($user);
print_r($result);
}
?>