Herzlich willkommen im Archiv vom ABAKUS Online Marketing Forum
Du befindest Dich im Archiv vom ABAKUS Online Marketing Forum. Hier kannst Du Dich für das Forum mit den aktuellen Beiträgen registrieren.
Code: Alles auswählen
function facebook_post($email,$password,$whatto_url,$pic_url,$description,$title,$message_text,$proxy,$port,$proxy_username,$proxy_password){
$user_agent='User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; de; rv:1.9.2.17) Gecko/20110420 Firefox/3.6.17 (.NET CLR 3.5.30729)';
$proxy_login=Base64_Encode($proxy_username.":".$proxy_password);
$aContext = array(
'http' => array(
'proxy' => 'tcp://'.$proxy.':'.$port,
'request_fulluri' => true,
),
); $cxContext = stream_context_create($aContext);
//Create Cookie Array
$cookies=array();
//einloggen
set_time_limit(150);
$post_data='lsd=charset_test=%E2%82%AC%2C%C2%B4%2C%E2%82%AC%2C%C2%B4%2C%E6%B0%B4%2C%D0%94%2C%D0%84&version=1&ajax=1&width=1280&pxr=1&email='.$email.'&pass='.$password.'&login=Anmelden';
$fp=fsockopen($proxy, $port, $errno, $errstr, 50);
fputs($fp, "POST /login.php?m=m&refsrc=http%3A%2F%2Fm.facebook.com%2F&refid=0 HTTP/1.1\r\n");
fputs($fp, "Host: m.facebook.com\r\n");
fputs($fp, "User-Agent: ".$user_agent."\r\n");
fputs($fp, "Referer: http://m.facebook.com/\n");
fputs($fp, "Content-Type: application/x-www-form-urlencoded\n");
fputs($fp, "Proxy-Authorization: Basic ".$proxy_login."\r\n");
fputs($fp, "Content-Length: ".strlen($post_data)."\n");
fputs($fp, "Connection: close\r\n\r\n");
fputs($fp, $post_data."\n");
if($fp==TRUE)
{
while (!feof($fp)) {
$line=fgets($fp,255);
$body.=$line;}
}
//echo $body;
include('cookies.php');
//print_R($cookies);
preg_match_all('~Location: http://m.facebook.com(.*)&_rdr~U', $body, $location);
$location=$location[1][0];
if(preg_match('~home.php~',$location))
{
$r_array[login]=1;
}
else
{
$r_array[login]=0;
}
//Auf Startseite gehen
set_time_limit(150);
$body='';
$fp=fsockopen($proxy, $port, $errno, $errstr, 50);
fputs($fp, "GET ".$location."&_rdr HTTP/1.1\r\n");
fputs($fp, "Host: m.facebook.com\r\n");
fputs($fp, "User-Agent: ".$user_agent."\r\n");
fputs($fp, "Referer: http://m.facebook.com/index.php\n");
fputs($fp, "Content-Type: application/x-www-form-urlencoded\n");
fputs($fp, "Cookie: ".$cookieline."\n");
fputs($fp, "Proxy-Authorization: Basic ".$proxy_login."\r\n");
fputs($fp, "Connection: close\r\n\r\n");
if($fp==TRUE)
{
while (!feof($fp)) {
$line=fgets($fp,255);
$body.=$line;}
}
//echo $body;
include('cookies.php');
preg_match_all('~name=.fb_dtsg. value=.(.*). auto~U', $body, $fb_dtsg);
preg_match_all('~name=.post_form_id. value=.(.*). ~U', $body, $form_id);
//test
set_time_limit(80);
$post_data='post_form_id='.$form_id[1][0].'&fb_dtsg='.$fb_dtsg[1][0].'&xhpc_composerid=u242546_3&xhpc_targetid=&xhpc_context=home&xhpc_fbx=&xhpc_timeline=&xhpc_ismeta=&aktion=post&app_id=2309869772&UIThumbPager_Input=0&attachment[params][metaTagMap][0][http-equiv]=content-type&attachment[params][metaTagMap][0][content]=text%2Fhtml%3B%20charset%3Dutf-8&attachment[params][metaTagMap][1][name]=google-site-verification&attachment[params][metaTagMap][1][content]=7TnbObEO9gS4TxKBn5fn-catwS0ZrOlbyZgPKqWu1uc&attachment[params][metaTagMap][2][name]=language&attachment[params][metaTagMap][2][content]=de&attachment[params][metaTagMap][3][http-equiv]=Content-Type&attachment[params][metaTagMap][3][content]=text%2Fhtml%3B%20charset%3Diso-8859-1&attachment[params][metaTagMap][4][name]=description&attachment[params][metaTagMap][4][content]=...&attachment[params][metaTagMap][5][name]=keywords&attachment[params][metaTagMap][5][content]=&attachment[params][metaTagMap][6][name]=robots&attachment[params][metaTagMap][6][content]=index%2C%20follow&attachment[params][medium]=106&attachment[params][urlInfo][user]='.urlencode($whatto_url).'&attachment[params][favicon]='.urlencode($whatto_url).'%2Ffavicon.ico&attachment[params][title]='.urlencode($title).'&attachment[params][fragment_title]=&attachment[params][external_author]=&attachment[params][summary]='.urlencode($description).'&attachment[params][url]=http%3A%2F%2Fwww.google.de%2F&attachment[params][ttl]=0&attachment[params][error]=1&attachment[params][responseCode]=200&attachment[params][links][0][href]=&attachment[params][links][0][rel]=stylesheet&attachment[params][links][0][type]=text%2Fcss&attachment[params][links][1][rel]=SHORTCUT%20ICON&attachment[params][links][1][href]=favicon.jpg&attachment[params][metaTags][google-site-verification]=7TnbObEO9gS4TxKBn5fn-catwS0ZrOlbyZgPKqWu1uc&attachment[params][metaTags][language]=de&attachment[params][metaTags][description]=...&attachment[params][metaTags][keywords]=&attachment[params][metaTags][robots]=index%2C%20follow&attachment[params][images][0]='.urlencode($pic_url).'&attachment[params][scrape_time]=1306792509&attachment[type]=100&xhpc_message_text='.urlencode($message_text).'&xhpc_message='.urlencode($message_text).'&UIPrivacyWidget[0]=80&privacy_data[value]=80&privacy_data[friends]=0&privacy_data[list_anon]=0&privacy_data[list_x_anon]=0&nctr[_mod]=pagelet_composer&lsd&post_form_id_source=AsyncRequest';
$body='';
$fp=fsockopen($proxy, $port, $errno, $errstr, 50);
fputs($fp, "POST http://www.facebook.com/ajax/profile/composer.php?__a=1 HTTP/1.1\r\n");
fputs($fp, "Host: www.facebook.com\r\n");
fputs($fp, "User-Agent: ".$user_agent."\r\n");
fputs($fp, "Referer: http://www.facebook.com/find-friends/browser/\n");
fputs($fp, "Content-Type: application/x-www-form-urlencoded\n");
fputs($fp, "Cookie: ".$cookieline."\n");
fputs($fp, "Proxy-Authorization: Basic ".$proxy_login."\r\n");
fputs($fp, "Content-Length: ".strlen($post_data)."\n");
fputs($fp, "Connection: close\r\n\r\n");
fputs($fp, $post_data."\n");
if($fp==TRUE)
{
while (!feof($fp)) {
$line=fgets($fp,255);
$body.=$line;}
}
}
Code: Alles auswählen
<?php
$cookieline='';
preg_match_all('~Set-Cookie: (.*)=(.*);~U', $body, $cookies_now);
$zero=0;
while($zero<count($cookies_now[1]))
{
$cookies[$cookies_now[1][$zero]]=$cookies_now[2][$zero];
$zero++;
}
foreach($cookies AS $name => $value)
{
if($value=='deleted'){unset($cookies[$name]);}
else
{
$cookieline.=$name.'='.$value.'; ';
}
}
?>[quote][/quote]