пятница, 30 декабря 2011 г.

Постилка в Google+ (plus.google.com)



 function ShareBoxPost()
 {
  // linkpreview
  $this-> Gen_reqid();

  $headers = $this->set_headers();
  //$headers[] = "Expect: ";
  $curl_data['headers'] =  $headers;
  #$curl_data['referer'] = "";
  $curl_data['echo_header'] = true;
  $curl_data['followlocation'] = true;

  $headers[] = "application/x-www-form-urlencoded;charset=utf-8";
  $curl_data['headers'] =  $headers;


  $p = array(
  "at" => $this-> atToken,
  "susp" => true,
  );

  $curl_data['post'] = http_build_query($p);
  $curl_data['url'] = 'https://plusone.google.com/_/sharebox/linkpreview/?c='.urlencode($this-> url_spam).'&t=1&slpf=1&ml=1&_reqid='.$this-> _reqid.'&rt=j';

  $this->code = $this->curl($curl_data);
  write_string("logs/".$this->host."_plus_google_sharebox_linkpreview.html", $this->code);

  preg_match_all ('~\[(.*),(.*),"(.*)"\]~', $this->code, $m);
  $thumb_url = $m[3][0];
  $thumb_info = getimagesize($thumb_url );

  $t = parse_url ($this->url_spam);
  $url_spam_host = $t['host'];

  $oz =str_replace(':'.$this->userID, '', $this-> atToken);
  $t = time();

  $p = array(
  'at' => $this-> atToken,
  //'source' => 'widget',
  'spar' => '["","oz:'.$this-> userID.'.'.$t.'.0",null,null,null,null,"[\"[null,null,null,\\\\\"'.$this->post_title.'\\\\\",null,null,null,null,null,[],null,null,null,null,null,null,null,null,null,null,null,\\\\\"'.$this->post_title.'\\\\\",null,null,[null,\\\\\"'.$this->url_spam.'\\\\\",null,\\\\\"text/html\\\\\",\\\\\"document\\\\\"],null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,[[null,\\\\\"//s2.googleusercontent.com/s2/favicons?domain\u003d'.$url_spam_host.'\\\\\",null,null],[null,\\\\\"//s2.googleusercontent.com/s2/favicons?domain\u003d'.$url_spam_host.'\\\\\",null,null]],null,null,null,null,null,[[null,\\\\\"\\\\\",\\\\\"http://google.com/profiles/media/provider\\\\\",\\\\\"\\\\\"]]]\",\"[null,null,null,null,null,[null,\\\\\"'.$thumb_url.'\\\\\"],null,null,null,[],null,null,null,null,null,null,null,null,null,null,null,null,null,null,[null,\\\\\"'.$this->url_spam.'\\\\\",null,\\\\\"image/jpeg\\\\\",\\\\\"photo\\\\\",null,null,null,null,null,null,null,'.$thumb_info[0].','.$thumb_info[1].'],null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,[[null,\\\\\"'.$thumb_url.'\\\\\",null,null],[null,\\\\\"'.$thumb_url.'\\\\\",null,null]],null,null,null,null,null,[[null,\\\\\"images\\\\\",\\\\\"http://google.com/profiles/media/provider\\\\\",\\\\\"\\\\\"]]]\"]",null,"{\"aclEntries\":[{\"scope\":{\"scopeType\":\"anyone\",\"name\":\"Anyone\",\"id\":\"anyone\",\"me\":true,\"requiresKey\":false},\"role\":20},{\"scope\":{\"scopeType\":\"anyone\",\"name\":\"Anyone\",\"id\":\"anyone\",\"me\":true,\"requiresKey\":false},\"role\":60}]}",true,[],false,false,null,[],false,false,null,null,null,null,[8,null,[null,null,null,null,[["'.$this->url_spam.'"],"'.$url_spam_host.'"]]],null,null,null,null,null,false,false,false]',

   );
  $headers[] = "Pragma: no-cache";
  $headers[] = "Cache-Control: no-cache";
  $headers[] = "Connection: keep-alive";
  $headers[] = "X-Same-Domain: 1";
  //$headers[] = "Expect: ";
  $curl_data['headers'] =  $headers;
  $curl_data['post'] = http_build_query($p);
  $curl_data['url'] = 'https://plusone.google.com/_/sharebox/post/?spam=25&_reqid='.$this-> Gen_reqid().'&rt=j';

  $this->code = $this->curl($curl_data);
  write_string("logs/".$this->host."_plus_google_sharebox_post.html", $this->code);

  echo $this->code;

  if (stripos($this->code, 'error') )
  {
   echo "

Not Allowed, случилась какая-то хуйета!


"; echo $this->code; return false; } else { echo "

sharebox post !!!


"; return true ; } } function Gen_reqid() { $a = (string) floor(mt_rand (1111111,9999999)); $this-> _reqid ="0". $a; return $this-> _reqid; } function GetAtToken() { if(preg_match_all('~",,,,"https://www.google.com/csi","(.*):(.*)",,,~iU', $this-> code, $m)) if($m[1][0] and $m[2][0]) { $this-> atToken = $m[1][0] .':'.$m[2][0]; return true; } }

четверг, 15 декабря 2011 г.

Cкрипт автоматической отправки SMS beeline

Нужно написать скрипт, который будет отправлять автоматически, на один и тот же номер, смс, через определенное время.
header('Content-Type: text/html; charset=utf8');
// ignore_user_abort();



require_once("include/beeline_ru.class.php");
require_once("include/curl.class.php");
require_once("include/recognize.captcha.class.php");


$rc = New RecognitionCaptcha();
$ch = New CurlClass();

$bl = New BeeLineRuClass();
$bl->dirtysmstext = 'Сообщение';
$bl->phone = '79051234567';

$bl->sendSMS();




Функция отправки сообщения
class BeeLineRuClass
 function sendSMS()
 {
  global $ch;
  print "
BeeLineRuClass->sendSMS()
\n"; $headers = $ch->set_headers(); #$headers[] = "Expect: "; $curl_data['headers'] = $headers; $curl_data['followlocation'] = true; $curl_data['echo_header'] = true; $curl_data['url'] = "https://www.beeline.ru/sms/index.wbp"; $curl_data['referer'] = ''; $this->code = $ch->curl($curl_data); $this-> write_string("logs/beeline_index.wbp.html", $this->code); //echo $this->code; $this-> GetAfCode(); if($this-> afcode == '') { echo "return false afcode"; return false; } $this-> GetConfirmCode(); if($this-> confirmcode == '') { echo "return false confirmcode (capthca)"; return false; } if($this-> dirtysmstext) { $this->smstext = $this-> mso_slug($this-> dirtysmstext); } else { echo "return false dirtysmstext"; return false; } $this->smsto = substr($this->phone, 4); $this->smstoprefix = substr($this->phone, 1, 3); $post_data = array ( "afcode" => $this-> afcode, "confirm_key" => $this-> confirm_key, "confirmcode" => $this-> confirmcode, "dirtysmstext" => iconv('utf-8', 'cp1251', $this-> dirtysmstext), //"dirtysmstext" => $this-> dirtysmstext, "send" => '', "smstext" => $this-> smstext, "smsto" => $this-> smsto, "smstoprefix" => $this-> smstoprefix, "translit" => '', "x" => 0, "y" => 0, ); $curl_data['post'] = http_build_query($post_data); $headers = $ch->set_headers(); #$headers[] = "Expect: "; $curl_data['headers'] = $headers; $curl_data['followlocation'] = true; $curl_data['echo_header'] = true; $curl_data['referer'] = "https://www.beeline.ru/sms/index.wbp"; $curl_data['url'] = "https://www.beeline.ru/sms/index.wbp"; //$curl_data['referer'] = ''; echo "

\$post_data:

"; print_r($post_data); echo "

\$curl_data:


"; print_r($curl_data); $this->code = $ch->curl($curl_data); $this-> write_string("logs/beeline_send_sms.html", $this->code); //echo $this->code; }
Для работы нужно antigate_API_KEY и captchabot_API_KEY

суббота, 10 декабря 2011 г.

Плагин для MaxSite CMS Yahoo! Media Player

Позволяет выводить mp3 в виде flash-плейера.

В тексте указывайте так:

<a href="example1.mp3">My first song</a>


можно добавлять и мувики, например с Тытрубы


<a href="http://www.youtube.com/watch?v=i56XeM0-b8Y">Zoetrope (YouTube link)</a>







Посмотреть, как это выглядит, можно
здесь

скачать плагин