Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class poster extends socialaction {
- public $success;
- public $logs = array();
- public function post() {
- global $smoconfig, $dater;
- $news_data = $dater->getFormatedData();
- foreach ( $news_data as $key=>$val ) { $this->$key = $val;}
- if ( $this->type == "vkontaktegroup" or $this->type == "vkontaktewall" ) { $this->proxy = $smoconfig['vk_proxy'];}
- elseif ( $this->type == "twitter" ) { $this->proxy = $smoconfig['tt_proxy'];}
- else { $this->proxy = "";}
- $type = $this->type;
- $this->$type();
- $proxylist = $this->getProxy();
- if ( $smoconfig['autoproxy'] and $this->proxy != "" and $this->noresp ) {
- foreach ( $proxylist as $val ) {
- if ( substr_count($val, $this->proxy) ) {
- $this->proxy = current($proxylist);
- if (!$this->proxy) $this->proxy = reset($proxylist);
- break;
- }
- }
- if ( $this->type == "vkontaktegroup" or $this->type == "vkontaktewall" ) { $smoconfig['vk_proxy'] = $this->proxy;}
- elseif ( $this->type == "twitter" ) { $smoconfig['tt_proxy'] = $this->proxy;}
- smocnof($smoconfig);
- }
- $dater->saveResult($this->type, $this->success, $this->socials, $dater->news_id);
- file_put_contents( LOG_DIR."/detail_journal.txt", join("\r\n", $this->logs));
- if ( $this->success ) echo '{"status":"ok"}';else echo '{"status":"no"}';
- }
- private function googlehex ( $data ){
- global $config;
- $data = preg_replace('/([а-яА-ЯіїєґІЇЄҐёЁ])|(\s)/se', '"\u".bin2hex(iconv("'.$config['charset'].'","utf-16BE", "$1"))$2', $data);
- $data = preg_replace('/\\\\u(?=\\\\u)/', ' ', $data);
- return $data;
- }
- private function json_unescaped_unslashed_unicod( $data ){
- $data = preg_replace( '/u([0-9a-f]{4})/se', 'iconv("UTF-16BE", "UTF-8", pack("H4","$1"))', $data);
- $data = stripcslashes($data);
- return $data;
- }
- private function memori() {
- global $smoconfig;
- $logins = explode ('@', $this->login);
- $this->sendpost ('http://api.qip.ru/api/test?user='.$logins[0].'&pass='.$this->password.'&host='.$logins[1], '' );
- $result = $this->sendpost ( 'http://memori.qip.ru/linkadd/', '' );
- $token = $this->getReg( '/name="token" value="(\w+)"/i', $result, 1 );
- $post = $this->cp1251( array ( 'whereadd' => 'personal', 'linkImageUrl' => 'http://open.thumbshots.org/image.aspx?url='.$_SERVER['HTTP_HOST'], 'linkImageType' => 'screenshot', 'book' => '', 'urlRedirect' => '', 'url' => $this->url, 'title' => $this->title, 'description' => $this->body, 'tags' => $this->tags_space, 'token' => $token ) );
- $result = $this->sendpost ( 'http://memori.qip.ru/linkaddaction/', $post );
- if( $this->referer == 'http://memori.qip.ru/'.$this->login.'/' or strpos ( $result, $this->cp1251('У вас уже есть закладка с таким адресом') ) ) {
- $this->success = true;
- } elseif ( strpos ( $result, $this->cp1251('Введены неверные слова') ) ) {
- while( strpos ( $result, $this->cp1251('Введены неверные слова') ) ){
- $this->success = false;
- $i++;if ( $i == $smoconfig['captcha']+1 ) break;
- $result = $this->sendpost ( 'http://api.recaptcha.net/challenge?k=6LfX6wgAAAAAAOd-kkh9s4hWtrPCJaxu-dWIo300', '' );
- $challenge = $this->getReg( '/challenge : \'(.*?)\'/s', $result, 1 );
- $captcha_key = $this->getCaptchaKey( "http://www.google.com/recaptcha/api/image?c=".$challenge, $smoconfig['captcha_api'] );
- $post['recaptcha_challenge_field'] = $challenge;
- $post['recaptcha_response_field'] = $captcha_key;
- $result = $this->sendpost ( 'http://memori.qip.ru/linkaddaction/', $post );
- $this->success = true;
- }
- } else {
- $this->success = false;
- }
- if ( $this->success ) {
- $result = $this->sendpost ( "http://memori.qip.ru/".$this->login."/?sort=date&view=full", '' );
- $bm_id = $this->getReg( '/<a href="\/wcopy\/\?type=inc&link=(\d+)"/i', $result, 1 );
- $this->sendpost ( "http://memori.qip.ru/linksgroupajax/?ids=".$bm_id."&command=onmain", '' );
- }
- }
- private function bobrdobr() {
- global $smoconfig;
- $post = $this->utf8( array ( 'username' => $this->login, 'password' => $this->password, 'remember_user' => 'on', 'next' => 'http://bobrdobr.ru/', 'submit' => 'Aieoe', ) );
- $this->sendpost ( 'http://bobrdobr.ru/login/', $post );
- $result = $this->sendpost ( 'http://bobrdobr.ru/add/', '' );
- $killspammers = $this->getReg( '/name="killspammers" value="(\w+)"/i', $result, 1 );
- $post = $this->utf8( array ( 'url' => $this->url, 'name' => $this->title, 'tags' => $this->tags_comma, 'description' => $this->body, 'next' => 'http://bobrdobr.ru/people/'.$this->login.'/', 'killspammers' => $killspammers, 'submit' => 'Сохранить' ) );
- $result = $this->sendpost ( 'http://bobrdobr.ru/add/', $post );
- if( strpos ( $result, $this->utf8( 'Закладка сохранена' ) ) or strpos ( $result, $this->utf8( 'Закладка сохранена' ) ) ) {
- $this->success = true;
- } elseif ( strpos ( $result, 'alt="no robots here"' ) ) {
- while( strpos ( $result, 'alt="no robots here"' ) ){
- $this->success = false;
- $i++;if ( $i == $smoconfig['captcha']+1 ) break;
- $hash = $this->getReg( '/src="\/captcha\/(.*?)"/s', $result, 1 );
- $captcha_key = $this->getCaptchaKey( "http://bobrdobr.ru/captcha/".$hash, $smoconfig['captcha_api'] );
- $post['captcha_0'] = $hash;
- $post['captcha_1'] = $this->utf8( $captcha_key );
- $result = $this->sendpost ( 'http://bobrdobr.ru/add/', $post );
- $this->success = true;
- }
- } else {
- $this->success = false;
- }
- }
- private function iua() {
- $post = $this->cp1251( array ( '_subm' => 'lform', '_url' => 'http://links.i.ua/', 'login' => $this->login, 'pass' => $this->password, ) );
- $this->sendpost ( 'http://i.ua/lin.php', $post );
- $result = $this->sendpost ( 'http://links.i.ua/add/', '' );
- $back = $this->getReg( '/name=\'back\' value=\'(.*?)\'/s', $result, 1 );
- $post = $this->cp1251( array ( '_subm' => 'add', 'back' => $back, 'url' => $this->url, 'name' => $this->title, 'text' => $this->body, 'access' => '0', 'labels' => $this->tags_comma, 'folder' => '0', 'subfolder' => '', 'add' => '1', ) );
- $result = $this->sendpost ( 'http://links.i.ua/form/', $post );
- if( strpos ( $result, substr(str_replace( "&", "&", str_replace("http://", "", $this->cp1251($this->url)) ), 0 , 50 ) ) ) {
- $this->success = true;
- } else {
- $this->success = false;
- }
- if ( $this->success ) {
- $param = $this->getReg( '/SM\((\d+), this\)/s', $result, 1 );
- $this->sendpost ( 'http://links.i.ua/setmain/'.$param.'/?ct=1', '' );
- }
- }
- private function yandex() {
- $post = $this->utf8( array ( 'login' => $this->login, 'passwd' => $this->password, 'mode' => 'auth' ) );
- $this->sendpost ( 'https://passport.yandex.ru/passport', $post );
- $post = $this->utf8( array ( 'name' => $this->title, 'from' => 'bookmarks_web', 'url' => $this->url, 'descr' => $this->body, 'tags' => $this->tags_comma, 'folder_id' => '0', 'ajax' => '1', ) );
- $result = $this->sendpost ( 'http://zakladki.yandex.ru/addlink.xml', $post );
- if( strpos ( $result, $this->utf8( 'В этой папке такая закладка уже существует' ) ) or strpos ( $result, $this->utf8( 'Ссылка добавлена в Яндекс.Закладки' ) ) ) {
- $this->success = true;
- } else {
- $this->success = false;
- }
- }
- private function delicious() {
- $post = $this->utf8( array ( 'username' => $this->login, 'password' => $this->password, ) );
- $this->sendpost ( 'https://previous.delicious.com/login', $post, false, true );
- $post = $this->utf8( array ( 'url' => $this->url, 'target_stack_id' => '', ) );
- $result = $this->sendpost ( 'http://previous.delicious.com/save/confirm?url='.$this->url.'&target_stack_id=', '' );
- $csrfToken = $this->getReg( '/name="csrfToken" value="(.*?)"/s', $result, 1 );
- $post = $this->utf8( array ( 'url' => $this->url, 'oldUrl' => $this->url, 'title' => $this->title, 'tags' => $this->tags_comma, 'note' => $this->body, 'no_image' => 'false', 'private' => 'false', 'csrf_token' => $csrfToken ) );
- $result = $this->sendpost ( 'http://previous.delicious.com/save', $post );
- $json = json_decode($result, true);
- if( $json['success'] == 'True' ) {
- $this->success = true;
- } else {
- $this->success = false;
- }
- }
- private function stozak() {
- $post = $this->cp1251( array ( 'ln' => $this->login, 'lp' => $this->password, 'su2' => 'Войти', ) );
- $this->sendpost ( 'http://www.100zakladok.ru/login/', $post );
- $post = $this->cp1251( array ( 'title_1' => $this->title, 'bm_url_1' => $this->url, 'id_cat_1' => '1', 'tags_1' => $this->tags_comma, 'descr_1' => $this->body, 'id_bm_1' => '0', 'form_type' => '1', 'id_form' => '1', 'add_proc' => 'Добавить закладку', ) );
- $result = $this->sendpost ( 'http://www.100zakladok.ru/'.strtolower($this->login).'/', $post );
- if( strpos( $result, $this->cp1251('Закладка с таким адресом уже существует') ) or strpos( $result, $this->cp1251($this->url) ) ) {
- $this->success = true;
- } else {
- $this->success = false;
- }
- }
- private function zaknet() {
- global $ermsg;
- $post = array ( 'backref' => 'http://www.zakladok.net/index.php', 'login' => $this->login, 'passwd' => $this->password, 'submit' => 'Войти!' );
- $this->sendpost ( 'http://www.interesno.com/login.php', $post );
- $result = $this->sendpost ( 'http://www.zakladok.net/add_link.php', '' );
- $param = $this->getReg( '/<option value="(\d+)".*?>Iauay<\/option>/s', $result, 1 );
- $post = array ( 'action' => 'edit', 'mode' => 'insert', 'original_id' => '0', 'url' => $this->url, 'title' => $this->title, 'tags_line' => $this->tags_comma, 'description' => $this->body, 'is_public' => '1', 'folder_id' => $param, 'namefolder' => '', 'submit' => 'Сохранить закладку', );
- $result = $this->sendpost ( 'http://www.zakladok.net/add_link.php', $post, true );
- if( strpos( $result, 'ссылка уже сохранена ранее' ) or $this->referer == 'http://www.zakladok.net/my.php?expand=&folder='.$param ) {
- $this->success = true;
- } else {
- $this->success = false;
- }
- }
- private function twitter() {
- $result = $this->sendpost ( 'https://mobile.twitter.com/session/new', '', false, false, array(), 'm5=off' );
- $authenticity_token = $this->getReg( '/name="authenticity_token" type="hidden" value="(\w+)"/s', $result, 1 );
- $post = $this->utf8( array ( 'authenticity_token' => $authenticity_token, 'username' => $this->login, 'password' => $this->password, 'commit' => 'Войти' ) );
- $this->sendpost ( 'https://mobile.twitter.com/session', $post, false, false, array(), 'm5=off' );
- $post = $this->utf8( array ( 'authenticity_token' => $authenticity_token, 'tweet[text]' => $this->body, 'commit' => 'Твитнуть' ) );
- $result = $this->sendpost ( 'https://mobile.twitter.com/', $post, false, true, array(), 'm5=off' );
- if( ( strpos( $result, 'Tweet sent!' ) or strpos( $result, $this->utf8('Твит отправлен!') ) ) and $this->referer = 'https://mobile.twitter.com/' ) {
- $this->success = true;
- } elseif ( strpos( $result, 'You already tweeted that' )){
- $this->success = true;
- } else {
- $this->success = false;
- }
- }
- private function facebookwall() {
- $result = $this->sendpost ( 'https://www.facebook.com/', '' );
- $lsd = $this->getReg( '/name="lsd" value="(.*?)"/s', $result, 1 );
- $post = $this->utf8( array ( 'lsd' => $lsd, 'email' => $this->login, 'pass' => $this->password, 'default_persistent' => '0', 'charset_test' => '€,´,?,?,?,A,?', 'timezone' => '-180', 'lgnrnd' => '111240_isMk', 'lgnjs' => '1339697531', 'locale' => 'ru_RU' ) );
- $this->sendpost ( 'https://www.facebook.com/login.php?login_attempt=1', $post );
- $result = $this->sendpost ( 'https://www.facebook.com/', '' );
- $fb_dtsg = $this->getReg( '/"fb_dtsg":"(.*?)"/s', $result, 1 );
- $xhpc_composerid = $this->getReg( '/name="xhpc_composerid" value="(.*?)"/s', $result, 1 );
- $xhpc_targetid = $this->getReg( '/name="xhpc_targetid" value="(\d+)"/s', $result, 1 );
- $user_id = $this->getReg( '/"user":"(\d+)"/s', $result, 1 );
- $result = $this->sendpost ( 'https://www.facebook.com/ajax/metacomposer/attachment/link/scraper.php?targetid='.$xhpc_targetid.'&__a=1&xhpc=composerTourStart&nctr[_mod]=pagelet_timeline_recent&__user='.$user_id, '');
- $app_id = $this->getReg( '/name=\\\\\\\\\\\"app_id\\\\\\\\\\\" value=\\\\\\\\\\\"(\d+)\\\\\\\\\\\"/s', $result, 1 );
- if ( $this->post_type == "preview" ){
- foreach ( $this->attaches as $num=>$val ) { if ( $val['type'] == "image" ) $image = $val['image_link'];break;}
- $post = $this->utf8( array( 'xhpc_timeline' => '1', 'xhpc_ismeta' => '1', 'xhpc_fbx' => '1', 'fb_dtsg' => $fb_dtsg, 'xhpc_composerid' => $xhpc_composerid, 'xhpc_targetid' => $xhpc_targetid, 'xhpc_context' => 'profile', 'xhpc_message_text' => $this->body, 'xhpc_message' => $this->body, 'aktion' => 'post', 'app_id' => $app_id, 'UIThumbPager_Input' => '0', 'attachment[params][title]' => $this->title, 'attachment[params][summary]' => $this->short, 'attachment[params][url]' => $this->url, 'attachment[params][images][0]' => $image, 'attachment[type]' => '100', 'nctr[_mod]' => 'pagelet_wall', '__user' => $user_id ) );
- $result = $this->sendpost ( 'https://www.facebook.com/ajax/profile/composer.php?__a=1', $post );
- } elseif ( $this->post_type == "media" ){
- foreach ( $this->attaches as $num=>$val ) { if ( $val['type'] == "image" ) $image = $val['image_full'];break;}
- $post = $this->utf8( array( 'fb_dtsg' => $fb_dtsg, 'source' => '8', 'profile_id' => $user_id, 'composer_unpublished_photo[]' => '@'. $image, "upload_id" => "1024" ) );
- $result = $this->sendpost ( 'https://upload.facebook.com/ajax/composerx/attachment/media/saveunpublished?target_id='.$xhpc_targetid.'&__user='.$user_id.'&__a=1&fb_dtsg='.$fb_dtsg, $post, true);
- $photo_id = $this->getReg( '/composer_unpublished_photo\[\]\\\\" value=\\\\"(\d+)\\\\"/s', $result, 1);
- $post = $this->utf8( array( 'fb_dtsg' => $fb_dtsg, 'xhpc_composerid' => $xhpc_composerid, 'xhpc_targetid' => $xhpc_targetid, 'xhpc_context' => 'profile', 'xhpc_timeline' => '1', 'xhpc_ismeta' => '1', 'xhpc_fbx' => '1', 'xhpc_message_text' => $this->body, 'xhpc_message' => $this->body, 'app_id' => $app_id, 'is_file_form' => '1', 'album_type' => '128', 'application' => 'composer', "composer_unpublished_photo[]" => $photo_id, "disable_location_sharing" => "false", "audience[0][value]" => "80" ) );
- $result = $this->sendpost ( 'https://upload.facebook.com/media/upload/photos/composer/?__a=1&__user='.$user_id, $post );
- }
- if( strpos( $result, '"jsmods":{"require"' ) ) {
- $this->success = true;
- if ( $this->checking == "1" ){
- $hash = $this->getReg( '/unit_data\\\\u00255Bhash\\\\u00255D=([-\d]+)&/s', $result, 1 );
- $start = $this->getReg( '/&start=(\d+)&/s', $result, 1 );
- $end = $this->getReg( '/end=(\d+)&/s', $result, 1 );
- $post = array ( "unit_data[hash]" => $hash, "profile_id" => $user_id, "start" => $start, "end" => $end, "query_type" => "5", "customize_action" => "7", "nctr[_mod]" => "pagelet_timeline_recent", "__user" => $user_id, "__a" => "1", "fb_dtsg" => $fb_dtsg );
- $post['unit_data[unit_type]'] = ( $this->post_type == "image" )?"69":"3";
- $this->sendpost ( "https://www.facebook.com/ajax/timeline/customize_confirm.php", $post );
- }
- } else {
- $this->success = false;
- }
- }
- private function facebookpage() {
- $result = $this->sendpost ( 'https://www.facebook.com/', '' );
- $lsd = $this->getReg( '/name="lsd" value="(.*?)"/s', $result, 1 );
- $post = $this->utf8( array ( 'lsd' => $lsd, 'email' => $this->login, 'pass' => $this->password, 'default_persistent' => '0', 'charset_test' => '€,´,?,?,?,A,?', 'timezone' => '-180', 'lgnrnd' => '111240_isMk', 'lgnjs' => '1339697531', 'locale' => 'ru_RU' ) );
- $this->sendpost ( 'https://www.facebook.com/login.php?login_attempt=1', $post );
- $result = $this->sendpost ( 'https://www.facebook.com/pages/space/'.$this->group, '' );
- $fb_dtsg = $this->getReg( '/"fb_dtsg":"(.*?)"/s', $result, 1 );
- $xhpc_composerid = $this->getReg( '/name="xhpc_composerid" value="(.*?)"/s', $result, 1 );
- $xhpc_targetid = $this->getReg( '/name="xhpc_targetid" value="(\d+)"/s', $result, 1 );
- $user_id = $this->getReg( '/"user":"(\d+)"/s', $result, 1 );
- $result = $this->sendpost ( 'https://www.facebook.com/ajax/typeahead/first_degree.php?viewer='.$xhpc_targetid.'&__user='.$user_id.'&__a=1&__req=2', '');
- $app_id = $this->getReg( '/"uid":(\d+),"type":"app","path":"\\\\\\/\?sk=app_\d+"/s', $result, 1 );
- if ( $this->post_type == "preview" ){
- foreach ( $this->attaches as $num=>$val ) { if ( $val['type'] == "image" ) $image = $val['image_link'];break;}
- $post = $this->utf8( array( 'fb_dtsg' => $fb_dtsg, 'xhpc_composerid' => $xhpc_composerid, 'xhpc_targetid' => $xhpc_targetid, 'xhpc_context' => 'profile', 'xhpc_timeline' => '1','xhpc_message_text' => $this->body, 'xhpc_message' => $this->body, 'aktion' => 'post', 'app_id' => $app_id, 'attachment[params][title]' => $this->title, 'attachment[params][summary]' => $this->short, 'attachment[params][url]' => $this->url, 'attachment[params][images][0]' => $image, 'attachment[type]' => '100', 'nctr[_mod]' => 'pagelet_timeline_recent', '__user' => $user_id, "__a" => "1" ) );
- $result = $this->sendpost ( 'https://www.facebook.com/ajax/profile/composer.php', $post );
- } elseif ( $this->post_type == "media" ){
- foreach ( $this->attaches as $num=>$val ) { if ( $val['type'] == "image" ) $image = $val['image_full'];break;}
- $post = $this->utf8( array( 'fb_dtsg' => $fb_dtsg, 'xhpc_composerid' => $xhpc_composerid, 'xhpc_targetid' => $xhpc_targetid, 'xhpc_context' => 'profile', 'xhpc_timeline' => '1', 'xhpc_ismeta' => '1', 'xhpc_message_text' => $this->body, 'xhpc_message' => $this->body, 'app_id' => $app_id, 'album_type' => '128', 'application' => 'composer', 'is_file_form' => '1', 'file1' => '@'. $image, 'scheduled' => '0', 'UITargetedPrivacyWidget' => '80', "disable_location_sharing" => "false" ) );
- $result = $this->sendpost ( 'https://upload.facebook.com/media/upload/photos/composer/?__a=1&__adt=3&__iframe=true&__user='.$user_id, $post, true );
- }
- if( strpos( $result, '"jsmods":{"require"' ) ) {
- $this->success = true;
- if ( $this->checking == "1" ){
- $hash = $this->getReg( '/unit_data\\\\u00255Bhash\\\\u00255D=([-\d]+)&/s', $result, 1 );
- $start = $this->getReg( '/&start=(\d+)&/s', $result, 1 );
- $end = $this->getReg( '/end=(\d+)&/s', $result, 1 );
- $post = array ( "unit_data[unit_type]" => "69", "unit_data[hash]" => $hash, "profile_id" => $xhpc_targetid, "start" => $start, "end" => $end, "query_type" => "5", "customize_action" => "7", "nctr[_mod]" => "pagelet_timeline_recent", "__user" => $user_id, "__a" => "1", "fb_dtsg" => $fb_dtsg );
- $this->sendpost ( "https://www.facebook.com/ajax/timeline/customize_confirm.php", $post );
- }
- } else {
- $this->success = false;
- }
- }
- private function facebookgroup() {
- $result = $this->sendpost ( 'https://www.facebook.com/', '' );
- $lsd = $this->getReg( '/name="lsd" value="(.*?)"/s', $result, 1 );
- $post = $this->utf8( array ( 'lsd' => $lsd, 'email' => $this->login, 'pass' => $this->password, 'default_persistent' => '0', 'charset_test' => '€,´,?,?,?,A,?', 'timezone' => '-180', 'lgnrnd' => '111240_isMk', 'lgnjs' => '1339697531', 'locale' => 'ru_RU' ) );
- $this->sendpost ( 'https://www.facebook.com/login.php?login_attempt=1', $post );
- $result = $this->sendpost ( 'https://www.facebook.com/groups/'.$this->group, '' );
- $fb_dtsg = $this->getReg( '/"fb_dtsg":"(.*?)"/s', $result, 1 );
- $xhpc_composerid = $this->getReg( '/name="composerid" value="(.*?)"/s', $result, 1 );
- $xhpc_targetid = $this->getReg( '/name="xhpc_targetid" value="(\d+)"/s', $result, 1 );
- $user_id = $this->getReg( '/"user":"(\d+)"/s', $result, 1 );
- $result = $this->sendpost ( 'https://www.facebook.com/ajax/metacomposer/attachment/link/scraper.php?targetid='.$xhpc_targetid.'&__a=1&xhpc=composerTourStart&nctr[_mod]=pagelet_timeline_recent&__user='.$user_id, '');
- $app_id = $this->getReg( '/name=\\\\\\\\\\\"app_id\\\\\\\\\\\" value=\\\\\\\\\\\"(\d+)\\\\\\\\\\\"/s', $result, 1 );
- if ( $this->post_type == "preview" ){
- foreach ( $this->attaches as $num=>$val ) { if ( $val['type'] == "image" ) $image = $val['image_link'];break;}
- $post = $this->utf8( array( 'fb_dtsg' => $fb_dtsg, 'xhpc_composerid' => $xhpc_composerid, 'xhpc_targetid' => $xhpc_targetid, 'xhpc_context' => 'profile', 'xhpc_message_text' => $this->body, 'xhpc_message' => $this->body, 'aktion' => 'post', 'app_id' => $app_id, 'UIThumbPager_Input' => '0', 'attachment[params][title]' => $this->title, 'attachment[params][summary]' => $this->short, 'attachment[params][url]' => $this->url, 'attachment[params][images][0]' => $image, 'attachment[type]' => '100', 'nctr[_mod]' => 'pagelet_group_composer', '__user' => $user_id ) );
- $result = $this->sendpost ( 'https://www.facebook.com/ajax/profile/composer.php?__a=1', $post );
- } elseif ( $this->post_type == "media" ){
- foreach ( $this->attaches as $num=>$val ) { if ( $val['type'] == "image" ) $image = $val['image_full'];break;}
- $post = $this->utf8( array( 'fb_dtsg' => $fb_dtsg, 'source' => '8', 'profile_id' => $user_id, 'composer_unpublished_photo[]' => '@'. $image, "upload_id" => "1024" ) );
- $result = $this->sendpost ( 'https://upload.facebook.com/ajax/composerx/attachment/media/saveunpublished?target_id='.$xhpc_targetid.'&__user='.$user_id.'&__a=1&fb_dtsg='.$fb_dtsg, $post, true);
- $photo_id = $this->getReg( '/composer_unpublished_photo\[\]\\\\" value=\\\\"(\d+)\\\\"/s', $result, 1);
- $post = $this->utf8( array( 'fb_dtsg' => $fb_dtsg, 'xhpc_composerid' => $xhpc_composerid, 'xhpc_targetid' => $xhpc_targetid, 'xhpc_context' => 'profile', 'xhpc_timeline' => '1', 'xhpc_ismeta' => '1', 'xhpc_fbx' => '1', 'xhpc_message_text' => $this->body, 'xhpc_message' => $this->body, 'app_id' => $app_id, 'is_file_form' => '1', 'album_type' => '128', 'application' => 'composer', "composer_unpublished_photo[]" => $photo_id, "disable_location_sharing" => "false", "audience[0][value]" => "80" ) );
- $result = $this->sendpost ( 'https://upload.facebook.com/media/upload/photos/composer/?__a=1&__user='.$user_id, $post );
- }
- if( strpos( $result, '"jsmods":{"require"' ) ) {
- $this->success = true;
- } else {
- $this->success = false;
- }
- }
- private function confirmIp ( $data ){
- $hash = $this->getReg( "/al_page: '.*?', hash: '(\w+)'/i", $data, 1 );
- $to = $this->getReg( "/to: '(.*?)', al_page/i", $data, 1 );
- if (!$to) preg_match("/security_check&to=([^&].?)&/",$this->referer,$match);
- $to = $match[1];
- $post = array ( 'act' => 'security_check', 'al' => '1', 'al_page' => '3', 'code' => $this->phone, 'hash' => $hash, 'to' => $to );
- $this->sendPost ( 'http://vk.com/login.php', $post );
- }
- private function vkontaktegroup() {
- global $smoconfig;
- $result = $this->sendPost ( 'http://vk.com/', '' );
- if ( substr_count ( $this->referer, 'http://vk.com/login.php?act=security_check' ) != 1 ) {
- $ip_h = $this->getReg ( "/ip_h: '(\w+)'/i", $result, 1 );
- $post = $this->cp1251( array( 'act' => 'login', 'role' => 'al_frame', 'expire' => '1', 'captcha_sid' => '', 'captcha_key' => '', '_origin' => 'http://vk.com', 'ip_h' => $ip_h, 'email' => $this->login, 'pass' => $this->password ) );
- $result = $this->sendPost ( 'https://login.vk.com/', $post );
- $account = $this->getReg ( "/onLoginDone\('\/(.*?)'\)/", $result, 1 );
- $result = $this->sendPost ( 'http://vk.com/'.$account, '' );
- }
- if ( substr_count ( $this->referer, 'http://vk.com/login.php?act=security_check' ) == 1 ) {
- $result = $this->confirmIp ( $result );
- }
- $result = $this->sendPost ( 'http://vk.com/club' . $this->group, '' );
- $post_hash = $this->getReg( '/"post_hash":"(\w+)",/i', $result, 1 );
- if ( $this->post_type == "preview" ){
- foreach ( $this->attaches as $num=>$val ) { if ( $val['type'] == "image" ) $image = $val['image_link'];break;}
- $post = $this->utf8( array ( 'act' => 'a_photo', 'url' => $this->url, 'index' => '4', 'image' => $image, 'extra' => '0' ) );
- $result = $this->sendpost ( 'http://vk.com/share.php', $post );
- $user_id = $this->getReg( '/user_id"*:\s*(\d+),/s', $result, 1 );
- $photo_id = $this->getReg( '/photo_id"*:\s*(\d+)}/s', $result, 1 );
- $post = $this->utf8( array ( 'act' => 'post', 'al' => '1', 'attach1' => $user_id.'_'.$photo_id, 'attach1_type' => 'share', 'description' => $this->short, 'extra' => '0', 'extra_data' => '', 'facebook_export' => '', 'friends_only' => '', 'hash' => $post_hash, 'message' => $this->body, 'note_title' => '', 'official' => '', 'photo_url' => $this->img, 'status_export' => '', 'title' => $this->title, 'to_id' => '-'.$this->group, 'type' => 'all', 'url' => $this->url ) );
- } elseif ( $this->post_type == "media" ){
- $mid = $this->getReg( "/id: (\d+),/i", $result, 1 );
- $post = array ( "act" => "choose_photo", "al" => "1", "to_id" => "-".$this->group );
- $return = $this->sendpost ( "http://vk.com/al_photos.php", $post );
- $attachment = array();
- foreach ( $this->attaches as $num=>$val ){
- if ( $val['type'] == "image" ){
- $i++;
- $url_post = $this->getReg( "/url: '(http:\/\/cs\d+\.vk\.com\/upload\.php)',/i", $return, 1 );
- $server = $this->getReg( "/cs(\d+)\.vk\.com/i", $url_post, 1 );
- $hash = $this->getReg( "/\"hash\":\"(\w+)\"/i", $return, 1 );
- $rhash = $this->getReg( "/\"rhash\":\"(\w+)\"/i", $return, 1 );
- $post = array ('photo' => '@'. $val['image_full'], 'act' => 'do_add', 'aid' => '-14', 'gid' => '0', 'mid' => $mid, 'hash' => $hash, 'rhash' => $rhash, 'vk' => '1', 'from_host' => 'vk.com', 'jpeg_quality' => '89', 'ajx' => '1' );
- $result = $this->sendpost ($url_post, $post, true );
- $json = json_decode($result, true);
- $post = array( "act" => "choose_uploaded", "aid" => "-14", "al" => "1", "gid" => "0", "hash" => $json['hash'], "mid" => $mid, "photos" => $json['photos'], "server" => $server );
- $result = $this->sendpost ( "http://vk.com/al_photos.php", $post );
- $user_id = $this->getReg( '/(\d+)_\d+/i', $result, 1 );
- $photo_id = $this->getReg( '/\d+_(\d+)/i', $result, 1 );
- $attachment['attach'.$i] = $user_id.'_'.$photo_id;
- $attachment['attach'.$i.'_type'] = 'photo';
- }
- if ( $val['type'] == "video_vk" ){
- $i++;
- preg_match("/vk\.com\/video_ext\.php\?oid=([\d-]+)[^\s]+id=(\d+)/", $val['video_vk'], $match);
- $attachment['attach'.$i] = $match[1]."_".$match[2];
- $attachment['attach'.$i.'_type'] = 'video';
- }
- }
- $post = $this->utf8( $attachment + array( 'act' => 'post', 'al' => '1', 'text' => $this->short, 'facebook_export' => '', 'fixed' => '', 'friends_only' => '', 'from' => '', 'hash' => $post_hash, 'Message' => $this->body, 'official' => '', 'signed' => '', 'status_export' => '', 'to_id' => '-'.$this->group, 'type' => 'all'));
- }
- if ( $this->fromgoup == '1' ) $post['official'] = '1';
- if ( $this->signature == '1' ) $post['signed'] = '1';
- $result = $this->sendpost ( 'http://vk.com/al_wall.php', $post );
- if( strpos ( $result, 'id="page_wall_count_' ) ) {
- $this->success = true;
- } elseif ( preg_match ( '/<!>([0-9]+){12}<!>/i', $result ) ) {
- while( preg_match ( '/<!>([0-9]+){12}<!>/i', $result ) ){
- $this->success = false;
- $i++;if ( $i == $smoconfig['captcha']+1 ) break;
- $captcha_sid = $this->getReg( '/<!>([0-9]+){12}<!>/i', $result, 1 );
- $captcha_key = $this->getCaptchaKey( "http://vk.com/captcha.php?sid=".$captcha_sid, $smoconfig['captcha_api'] );
- $post['captcha_sid'] = $captcha_sid;
- $post['captcha_key'] = $this->utf8( $captcha_key );
- $result = $this->sendpost ( 'http://vk.com/al_wall.php', $post );
- $this->success = true;
- }
- } else {
- $this->success = false;
- }
- }
- private function vkontaktewall() {
- global $smoconfig;
- $result = $this->sendPost ( 'http://vk.com/', '' );
- if ( substr_count ( $this->referer, 'http://vk.com/login.php?act=security_check' ) != 1 ) {
- $ip_h = $this->getReg ( "/ip_h: '(\w+)'/i", $result, 1 );
- $post = $this->cp1251( array( 'act' => 'login', 'role' => 'al_frame', 'expire' => '1', 'captcha_sid' => '', 'captcha_key' => '', '_origin' => 'http://vk.com', 'ip_h' => $ip_h, 'email' => $this->login, 'pass' => $this->password ) );
- $result = $this->sendPost ( 'https://login.vk.com/', $post );
- $account = $this->getReg ( "/onLoginDone\('\/(.*?)'\)/", $result, 1 );
- $result = $this->sendPost ( 'http://vk.com/'.$account, '' );
- }
- if ( substr_count ( $this->referer, 'http://vk.com/login.php?act=security_check' ) == 1 ) {
- $result = $this->confirmIp ( $result );
- }
- $post_hash = $this->getReg( '/"post_hash":"(\w+)",/i', $result, 1 );
- if ( empty($post_hash) ) {
- $result = $this->sendpost ( 'http://vk.com/settings', '' );
- $id = $this->getReg( '/class="settings_labeled_text fl_l">\s*(\d+)\s*<\/div>/', $result, 1 );
- $result = $this->sendpost ( 'http://vk.com/id'.$id, '' );
- $post_hash = $this->getReg( '/"post_hash":"(\w+)",/i', $result, 1 );
- }
- if ( $this->post_type == "preview" ){
- foreach ( $this->attaches as $num=>$val ) { if ( $val['type'] == "image" ) $image = $val['image_link'];break;}
- $to_id = $this->getReg( '/id: (\d+),/s', $result, 1 );
- $post = $this->utf8( array ( 'act' => 'a_photo', 'url' => $this->url, 'index' => '4', 'image' => $image, 'extra' => '0' ) );
- $result = $this->sendpost ( 'http://vk.com/share.php', $post );
- $user_id = $this->getReg( '/user_id"*:\s*(\d+),/s', $result, 1 );
- $photo_id = $this->getReg( '/photo_id"*:\s*(\d+)}/s', $result, 1 );
- $post = $this->utf8( array ( 'act' => 'post', 'al' => '1', 'attach1' => $user_id.'_'.$photo_id, 'attach1_type' => 'share', 'description' => $this->short, 'extra' => '0', 'extra_data' => '', 'facebook_export' => '', 'friends_only' => '', 'hash' => $post_hash, 'message' => $this->body, 'note_title' => '', 'official' => '', 'photo_url' => $this->img, 'status_export' => '', 'title' => $this->title, 'to_id' => $to_id, 'type' => 'all', 'url' => $this->url ) );
- } elseif ( $this->post_type == "media" ){
- $result = $this->sendPost ( 'http://vk.com/club' . $this->group, '' );
- $id = $this->getReg( "/id: (\d+),/i", $result, 1 );
- $post = array ( "act" => "choose_photo", "al" => "1", "to_id" => $id );
- $return = $this->sendpost ( "http://vk.com/al_photos.php", $post );
- $attachment = array();
- foreach ( $this->attaches as $num=>$val ){
- if ( $val['type'] == "image" ){
- $i++;
- $url_post = $this->getReg( "/url: '(http:\/\/cs\d+\.vk\.com\/upload\.php)',/i", $return, 1 );
- $server = $this->getReg( "/cs(\d+)\.vk\.com/i", $url_post, 1 );
- $hash = $this->getReg( "/\"hash\":\"(\w+)\"/i", $return, 1 );
- $rhash = $this->getReg( "/\"rhash\":\"(\w+)\"/i", $return, 1 );
- $post = array ('photo' => '@'. $val['image_full'], 'act' => 'do_add', 'aid' => '-14', 'gid' => '0', 'mid' => $id, 'hash' => $hash, 'rhash' => $rhash, 'vk' => '1', 'from_host' => 'vk.com', 'jpeg_quality' => '89', 'ajx' => '1' );
- $result = $this->sendpost ($url_post, $post, true );
- $json = json_decode($result, true);
- $post = array( "act" => "choose_uploaded", "aid" => "-14", "al" => "1", "gid" => "0", "hash" => $json['hash'], "mid" => $id, "photos" => $json['photos'], "server" => $server );
- $result = $this->sendpost ( "http://vk.com/al_photos.php", $post );
- $user_id = $this->getReg( '/(\d+)_\d+/i', $result, 1 );
- $photo_id = $this->getReg( '/\d+_(\d+)/i', $result, 1 );
- $attachment['attach'.$i] = $user_id.'_'.$photo_id;
- $attachment['attach'.$i.'_type'] = 'photo';
- }
- if ( $val['type'] == "video_vk" ){
- $i++;
- preg_match("/vk\.com\/video_ext\.php\?oid=([\d-]+)[^\s]+id=(\d+)/", $val['video_vk'], $match);
- $attachment['attach'.$i] = $match[0]."_".$match[1];
- $attachment['attach'.$i.'_type'] = 'video';
- }
- }
- $post = $this->utf8( $attachment + array( 'act' => 'post', 'al' => '1', 'text' => $this->short, 'facebook_export' => '', 'fixed' => '', 'friends_only' => '', 'from' => '', 'hash' => $post_hash, 'message' => $this->body, 'official' => '', 'signed' => '', 'status_export' => '', 'to_id' => $id, 'type' => 'all'));
- }
- if ( $this->fromgoup == '1' ) $post['official'] = '1';
- if ( $this->signature == '1' ) $post['signed'] = '1';
- $result = $this->sendpost ( 'http://vk.com/al_wall.php', $post );
- if( strpos ( $result, 'id="page_wall_count_' ) ) {
- $this->success = true;
- } elseif ( preg_match ( '/<!>([0-9]+){12}<!>/i', $result ) ) {
- while( preg_match ( '/<!>([0-9]+){12}<!>/i', $result ) ){
- $this->success = false;
- $i++;if ( $i == $smoconfig['captcha']+1 ) break;
- $captcha_sid = $this->getReg( '/<!>([0-9]+){12}<!>/i', $result, 1 );
- $captcha_key = $this->getCaptchaKey( "http://vk.com/captcha.php?sid=".$captcha_sid, $smoconfig['captcha_api'] );
- $post['captcha_sid'] = $captcha_sid;
- $post['captcha_key'] = $this->utf8( $captcha_key );
- $result = $this->sendpost ( 'http://vk.com/al_wall.php', $post );
- $this->success = true;
- }
- } else {
- $this->success = false;
- }
- }
- private function odnoklassnikigroup(){
- if ($this->post_type == "image") { $this->success = false;return;}
- $post = $this->cp1251( array ( "st.posted" => "set", "st.email" => $this->login, "st.password" => $this->password, "st.remember" => "on" ) );
- $this->sendpost ( "http://www.odnoklassniki.ru/dk?cmd=AnonymLogin", $post );
- $result = $this->sendpost ( "http://www.odnoklassniki.ru/group/".$this->group."/news", "" );
- $gwtHash = $this->getReg( "/\"gwtHash\":\"(.*?)\"/", $result, 1 );
- $groupId = $this->getReg( "/st\.groupId=(\w+)(?:\"|&)/", $result, 1 );
- $postForm = $this->getReg( "/\"s2\":\"(\w+)\"/", $result, 1 );
- if ( $this->post_type == "preview" ){
- $post = $this->utf8( array ( "LinkPreviewId" => "1.linkPreview", "linkUrl" => $this->url) );
- $result = $this->sendpost( "http://www.odnoklassniki.ru/group/".$this->group."/news?cmd=AltGroupPostContentAttachLink&gwt.requested=".$gwtHash."&st.cmd=altGroupNews&st.groupId=".$groupId, $post );
- $real_url = $this->getReg( "/,\"11\":\"([^\"]+)\"/s", $result, 1 );
- foreach ( $this->attaches as $num=>$val ) { if ( $val['type'] == "image" ) $image = $val['image_link'];break;}
- $correctimg = strpos($result, $image);
- if (!$correctimg){
- if (strpos($image, "/thumbs")) {
- $image = str_replace("/thumbs", "", $image);
- $correctimg = strpos($result, $image);
- } elseif (preg_match("/uploads\/posts\/\d+-\d+/", $image) ) {
- $image = preg_replace("/(.*?uploads\/posts\/\d+-\d+)(.*?)/", "$1/thumbs$2", $image);
- $correctimg = strpos($result, $image);
- } else $correctimg = false;
- }
- $size = getimagesize($image);
- $size = array ($size[0], $size[1]);
- $min_size = min($size);
- $max_size = max($size);
- $this->body = str_replace(array("\n\r","\r\n", "\n", "\r"),' ',$this->body);
- $this->body = str_replace('"', '\"',$this->body);
- $this->short = str_replace(array("\n\r","\r\n", "\n", "\r"),' ',$this->short);
- $this->short = str_replace('"', '\"',$this->short);
- $this->title = str_replace(array("\n\r","\r\n", "\n", "\r"),' ',$this->title);
- $this->title = str_replace('"', '\"',$this->title);
- if ( $correctimg and $min_size/$max_size >= 0.5 ){
- $json = (object)array( "formType" => "Group", "postDataList" => array ( (object)array( "text" => $this->utf8( $this->body ), "linkData" => (object)array( "title" => $this->utf8( $this->title ), "description" => $this->utf8( $this->short ), "providerViewer" => "1;1", "sourceUrl" => $real_url, "thumbnail" => $image ) ) ), "news" => true, "toStatus" => true );
- } else {
- $json = (object)array( "formType" => "Group", "postDataList" => array ( (object)array( "text" => $this->utf8( $this->body ), "linkData" => (object)array( "title" => $this->utf8( $this->title ), "description" => $this->utf8( $this->short ), "providerViewer" => "1;1", "sourceUrl" => $real_url ) ) ), "news" => true, "toStatus" => true );
- }
- $post = array( "st.status.postpostForm" => $postForm, "st.status.postgroupId" => $groupId, "postingFormData" => $this->json_unescaped_unslashed_unicod(json_encode($json)));
- $result = $this->sendpost ( "http://www.odnoklassniki.ru/group/".$this->group."/news?cmd=MediaTopicPost&gwt.requested=".$gwtHash."&st.cmd=altGroupNews&st.groupId=".$groupId, $post);
- }
- if ( preg_match('/"status":"ok"/', $result) ) {
- $this->success = true;
- if ( $this->nocomment == "1" ) {
- $result = $this->sendpost( "http://odnoklassniki.ru/group/".$this->group."/news?st.cmd=altGroupNews&st.groupId=".$groupId."&st.pageOffset=1&gwt.requested=".$gwtHash."&gwt.previous=st.cmd=altGroupNews&st.pageOffset=1&st.layer.cmd=PopLayerClose", "" );
- $layer_id = $this->getReg( "/st.layer.id=(\d+)/", $result, 1 );
- $this->sendpost ( "http://odnoklassniki.ru/group/".$this->group."/news?cmd=PopLayer&st.cmd=altGroupNews&st.layer.cmd=PopLayerAltGroupPinTheme&st.layer.id=".$layer_id."&st.layer.groupId=".$groupId."&st.layer.pin=off&st.layer.allowComments=on&st.groupId=".$groupId."&st.pageOffset=1&st._aid=Groups_News_All_switchCommentsButton&st.layer._bw=1280&st.layer._bh=516&gwt.requested=".$gwtHash, "" );
- }
- } else {
- $this->success = false;
- }
- }
- private function odnoklassnikiwall(){
- if ($this->post_type == "image") { $this->success = false;return;}
- $post = $this->cp1251( array ( "st.posted" => "set", "st.email" => $this->login, "st.password" => $this->password, "st.remember" => "on" ) );
- $result = $this->sendpost ( "http://www.odnoklassniki.ru/dk?cmd=AnonymLogin", $post );
- $gwtHash = $this->getReg( "/\"gwtHash\":\"(.*?)\"/", $result, 1 );
- $prifileId = $this->getReg( "/\"oid\":\"(\d+)\"/", $result, 1 );
- $postForm = $this->getReg( "/\"s2\":\"(\w+)\"/", $result, 1 );
- if ( $this->post_type == "preview" ){
- $post = $this->utf8( array ( "LinkPreviewId" => "linkPreview", "linkUrl" => $this->url) );
- $result = $this->sendpost( "http://odnoklassniki.ru/profile/".$prifileId."?cmd=AltGroupPostContentAttachLink&gwt.requested=".$gwtHash."&st.cmd=userMain", $post );
- $real_url = $this->getReg( "/,\"11\":\"([^\"]+)\"/s", $result, 1 );
- $correctimg = strpos($result, $image);
- if (!$correctimg){
- if (strpos($image, "/thumbs")) {
- $image = str_replace("/thumbs", "", $image);
- $correctimg = strpos($result, $image);
- } elseif (preg_match("/uploads\/posts\/\d+-\d+/", $image) ) {
- $image = preg_replace("/(.*?uploads\/posts\/\d+-\d+)(.*?)/", "$1/thumbs$2", $image);
- $correctimg = strpos($result, $image);
- } else $correctimg = false;
- }
- $size = getimagesize($image);
- $size = array ($size[0], $size[1]);
- $min_size = min($size);
- $max_size = max($size);
- $status_val = ($this->status)?true:false;
- $this->body = str_replace(array("\n\r","\r\n", "\n", "\r"),' ',$this->body);
- $this->body = str_replace('"', '\"',$this->body);
- $this->short = str_replace(array("\n\r","\r\n", "\n", "\r"),' ',$this->short);
- $this->short = str_replace('"', '\"',$this->short);
- $this->title = str_replace(array("\n\r","\r\n", "\n", "\r"),' ',$this->title);
- $this->title = str_replace('"', '\"',$this->title);
- if ( $correctimg and $min_size/$max_size >= 0.5 ){
- $json = array("formType" => "Status", "postDataList" => array(array("text" => $this->utf8( $this->body ), "linkData" => array("title" => $this->utf8( $this->title ), "description" => $this->utf8( $this->short ), "providerViewer" => "1;1", "sourceUrl" => $real_url, "thumbnail" => $image))), "news" => "", "toStatus" => $status_val);
- } else {
- $json = array("formType" => "Status", "postDataList" => array(array("text" => $this->utf8( $this->body ), "linkData" => array("title" => $this->utf8( $this->title ), "description" => $this->utf8( $this->short ), "providerViewer" => "1;1", "sourceUrl" => $real_url))), "news" => "", "toStatus" => $status_val);
- }
- $post = array( "st.status.postpostForm" => $postForm, "postingFormData" => $this->json_unescaped_unslashed_unicod(json_encode($json)));
- $result = $this->sendpost ( "http://www.odnoklassniki.ru/?cmd=MediaTopicPost&gwt.requested=".$gwtHash."&st.cmd=userMain", $post);
- }
- if ( preg_match('/"status":"ok"/', $result) ) {
- $this->success = true;
- } else {
- $this->success = false;
- }
- }
- }
- $poster = new poster;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement