Home » , » script twitter auto follow

script twitter auto follow

Posted by Catatan Harian Newbie on Thursday, May 13, 2010

sekian lama ni blog g ke urus gara-terlalu asik ma blog-blog baru inotechno.com, bestmedicare.info, barnmovie.info dan 7wallpaper.info . dan lain-lain pokoknya pe lupa ma blog pertama ini.

nah sekarang mau share nih script twitter autofollow bikinan Dave Stevens (davestevens.co.uk).
Scripnya sih simple banget tapi manfaatnya itu cukup super ajiibbb... maknyuusss dll deah.

Script ini digunakan utk mem-follow setiap user twitter dengan keyword tertentu (niche), kalo kita banyak memfollow kan kemungkinan mereka juga back follow ke kita. tapi inget jangan banyak-banyak pake ni script ntar bisa di bann kalo follownya lebih banyak dari follower


nah kalo dah banya bisa pake http://unfollowall.com untuk mengurangi user twitter yg kita follow, atau jika kamu pengen ngecek user yg mem-follow back atau yg unfollow back bisa menggunakan http://dossy.org/twitter/karma/


nih scriptnya :

// Twitter Auto-follow Script by Dave Stevens - http://davestevens.co.uk

// Set the twitter user
$user = "YourTwitterID";
$pass = "YourTwitterPassword";

// Set the term keyword you want to follow (e.g. "soccer")
$term = "computer";

// Get already followed
$userApiUrl = "http://twitter.com/statuses/friendss.json";

$ch = curl_init($userApiUrl);
curl_setopt($ch, CURLOPT_USERPWD, $user.":".$pass);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

$apiresponse = curl_exec($ch);

curl_close($ch);

$followed = array();

if ($apiresponse) {
$json = json_decode($apiresponse);
if ($json != null) {
foreach ($json as $u) {
$followed[] = $u->name;
}
}
}

$userApiUrl = "http://search.twitter.com/search.json?q=" . $term . "&rpp=10000";

$ch = curl_init($userApiUrl);
curl_setopt($ch, CURLOPT_USERPWD, $user.":".$pass);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

$apiresponse = curl_exec($ch);

curl_close($ch);

if ($apiresponse) {
$results = json_decode($apiresponse);
$count = 20;

if ($results != null) {

$resultsArr = $results->results;

if (is_array($resultsArr)) {

foreach ($resultsArr as $result) {

$from_user = $result->from_user;

if (!in_array($from_user,$followed)) {

$ch = curl_init("http://twitter.com/friendships/create/" . $from_user . ".json");
curl_setopt($ch, CURLOPT_USERPWD, $user.":".$pass);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,"follow=true");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

$apiresponse = curl_exec($ch);

if ($apiresponse) {
$response = json_decode($apiresponse);

if ($response != null) {
if (property_exists($response,"following")) {
if ($response->following === true) {
echo "Now following " . $response->screen_name . "\n";
} else {
echo "Couldn't follow " . $response->screen_name . "\n";
}
} else {
echo "Follow limit exceeded, skipped " . $from_user . "\n";
}
}

}

curl_close($ch);

} else {
echo "Already following " . $from_user . "\n";
}

}

}

}


}

?>



aturan pake:

  1. Kopy script diatas itu .
  2. Edit bagian yang berwarna merah.
  3. Save as dalam bentuk .php e.g NamaFile.php.
  4. Upload ke hosting kamu.
  5. Panggil file tersebut e.g http://www.namadomain.com/NamaFile.php
  6. Done!
penting!!!

kalo mau nambah follow tinggal panggil lagi tuh fille. kalo mau ganti keyword ya tinggal ganti aja keywordnya.

Thanks for reading & sharing Catatan Harian Newbie

Previous
« Prev Post

1 komentar:

English French German Spain Italian Dutch
Russian Portuguese Japanese Korean Arabic Chinese Simplified

Kuliner