Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //ubah nama file yg ko nak untuk simpan token
- $tokenko = "tk.txt";
- $f = file_get_contents($tokenko);
- $geto = preg_split('/(\r?\n)+/', $f);
- foreach($geto as $phc)
- {
- //cek token invalid
- $c = curl_init("https://graph.facebook.com/100002228225187_514893268594943/likes?method=post&access_token=".$phc);
- curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
- $k = curl_exec($c);
- curl_close($c);
- $check = strripos($k, "OAuthException");
- if($check === false)
- {
- $hidup.= $phc."\n";
- }
- else
- {
- }
- }
- $fop = fopen($tokenko, "w+");
- fwrite($fop, $hidup);
- fclose($fop);
- echo "token has been refrashed";
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement