<?php
// Bahasa Facebook harus bahasa indoneisa
$setting['email'] = ''; // email facebookmu
$setting['pass'] = ''; // pass facebookmu
$setting['reaction'] = 'wow'; //pilihan reaction : suka,super,haha,wow,sedih,marah
function file_get_contents_curl($url, $post=null, $req=null) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url);
if ($req != null) {
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $req);
}
if($post != null) {
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS,$post);
}
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$cookie = 'coker_log';
curl_setopt($ch, CURLOPT_COOKIEJAR,$cookie);
curl_setopt($ch, CURLOPT_COOKIEFILE,$cookie);
curl_setopt($ch, CURLOPT_USERAGENT,'Opera/9.80 (Series 60; Opera Mini/6.5.27309/34.1445; U; en) Presto/2.8.119 Version/11.10');
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
function login($em,$pw){
$post = 'email='.urlencode($em).'&pass='.urlencode($pw).'&login=Login';
return file_get_contents_curl('https://m.facebook.com/login.php',$post);
}
function cut($content,$start,$end){
if($content && $start && $end) {
$r = explode($start, $content);
if (isset($r[1])){
$r = explode($end, $r[1]);
return $r[0];
}
return '';
}
}
function typereaction($reaction){
$reaction = strtolower($reaction);
if($reaction =='suka'){
$type='type=1';
}else if($reaction =='super'){
$type='type=2';
}else if($reaction =='haha'){
$type='type=0';
}else if($reaction =='wow'){
$type='type=3';
}else if($reaction =='sedih'){
$type='type=7';
}else if($reaction =='marah'){
$type='type=8';
}
return $type;
}
function home($reaction){
$result = file_get_contents_curl('https://m.facebook.com/home.php');
$konten = strstr($result, 'class="_3-8w"');
$react_picker = explode('/reactions/picker/',$konten);
foreach ($react_picker as $react_link) {
$postid = cut($react_link,'ft_id=','&');
if ($postid) {
reaction($postid,$reaction);
}
}
}
function reaction($postid,$reaction){
$url = "https://mobile.facebook.com/reactions/picker/?ft_id={$postid}";
$result = file_get_contents_curl($url);
$suka= cut($result,'tanggapan</h1>','<div id="static');
$ha= explode('/ufi/reaction/',$suka);
foreach ($ha as $data) {
@$getha= cut($data,typereaction($reaction),'"');
$typereaction = typereaction($reaction);
if ($getha) {
$url = "https://mobile.facebook.com/ufi/reaction/?ft_ent_identifier={$postid}&reaction_{$typereaction}{$getha}";
$replace = str_replace('&','&',$url);
echo file_get_contents_curl($replace);
file_put_contents('log', date('d-m-Y H:i:s'));
}
}
}
if (home($setting['reaction'])) {
home($setting['reaction']);
}else{
login($setting['email'],$setting['pass']);
}
?>
Bot Reaction Facebook melalui m.facebook
1
Komentar
Facebook API
Komentar