<?php
/*
©2016 (==| Coding-ID |==)
Yang ganti copyright berarti Gak Tamvan
*/
$access_token = file_get_contents("my_token.txt"); // Buat File my_token.txt Dan isi token mu
function auto($url)
{
$data = curl_init();
curl_setopt($data, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($data, CURLOPT_URL, $url);
$hasil = curl_exec($data);
curl_close($data);
return $hasil;
}
if (file_exists('badai_status')) {
$log = json_encode(file('badai_status'));
} else {
$log = '';
}
if (file_exists('badai_komen')) {
$log2 = json_encode(file('badai_komen'));
} else {
$log2 = '';
}
$stat = json_decode(auto('https://graph.fb.me/me/home?fields=id&limit=50&access_token=' . $access_token), true);
for ($i = 1; $i <= count($stat[data]); $i++) {
if (!ereg($stat[data][$i - 1][id], $log)) {
$x = $stat[data][$i - 1][id] . "\n";
$y = fopen('badai_status', 'a');
fwrite($y, $x);
fclose($y);
auto('https://graph.fb.me/' . $stat[data][$i - 1][id] . '/likes?method=post&access_token=' . $access_token);
echo '<span style="color:#0E0101">' . $stat[data][$i - 1][id] . '</span> <span style="color:green"> Like Status OK </span><hr/>';
} else {
$badai = json_decode(auto('https://graph.fb.me/' . $stat[data][$i - 1][id] . '/comments?fields=id&access_token=' . $access_token), true);
for ($e = 1; $e <= count($badai[data]); $e++) {
if (!ereg($badai[data][$e - 1][id], $log2)) {
$q = $badai[data][$e - 1][id] . "\n";
$w = fopen('badai_komen', 'a');
fwrite($w, $q);
fclose($w);
auto('https://graph.fb.me/' . $badai[data][$e - 1][id] . '/likes?method=post&access_token=' . $access_token);
echo ('id komen : ' . $badai[data][$e - 1][id] . ' <span style="color:green"> Like komen OK </span><hr/>');
}
}
}
}
echo ('<a span style="color:green" href="http://nyariscript.blogspot.com/" target="_blank">(==| Coding-ID |==)</span>');
?>
Comments
0 B
|👍
/👎