supershitcodehere / ultimatetwitter

selenium based twitter mass-posting tool & account lock bypass process fully supported.
Apache License 2.0
5 stars 0 forks source link

example ultimatetwitter #1

Closed bereat closed 5 years ago

bereat commented 5 years ago

example ultimatetwitter pls.

39ff commented 5 years ago

here is follow example without twitter-api

<?php

require './vendor/autoload.php';
$proxy = null;
/* 
//proxy example
$proxy = new \koulab\UltimateTwitter\Proxy();
$proxy->addAddress('socks5://your-torguard-username:password@proxy.torguard.org:1080');
$proxy->addAddress('https://your-nordvpn-username:password@us2952.nordvpn.com');
*/
$to = new \koulab\UltimateTwitter\Client($proxy);
$to->login('your-twitter-screen-name','your-twitter-password','your-twitter-email-address@example.com','your-twitter-phone-number');
$to->validateAccountChallengeAppear();

//follow target
$screenName = '39ff';

$to->get('https://mobile.twitter.com/'.$screenName,[
    'headers'=>[
        'referer'=>'https://mobile.twitter.com/'
    ]
]);

//if unfollow replace /follow -> /unfollow
$to->post('https://mobile.twitter.com/'.$screenName.'/follow',[
    'headers'=>[
        'referer'=>'https://mobile.twitter.com/'.$screenName,
    ],
    'form_params'=>[
        'authenticity_token'=>$to->getAuthenticityToken(),
    ]
]);

As you well know, This is violating Twitter ToS. use it at own risk.

bereat commented 5 years ago

i am designing 1 piece script. Can you help me ? how can i get user information on this script in twitter?

39ff commented 5 years ago

Just you can check a url on https://mobile.twitter.com/ with set a leagcy IE user-agent header.

https://github.com/39ff/ultimatetwitter/blob/master/src/koulab/UltimateTwitter/Client.php#L62

...
//logged-in user information
//or other user information https://mobile.twitter.com/screenName
$response = $to->get('https://mobile.twitter.com/settings',[
    'headers'=>[
        'referer'=>'https://mobile.twitter.com/'
    ]
]);

//you need scrap html, response including user-profile
var_dump($response);
39ff commented 5 years ago

Additionally,You can get a non-protected account user-information by guest authorization header.

<?php
require './vendor/autoload.php';

$to = new \koulab\UltimateTwitter\Client();
$response = $to->get('https://api.twitter.com/1.1/users/show.json?screen_name=39ff',[
    'headers'=>[
        'authorization'=>'Bearer AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA'
    ]
]);
var_dump($response);
$json = (json_decode($response));
var_dump($json->name);
var_dump($json->screen_name);
var_dump($json->location);
//and more..

Then you will be return programmable json. it's twitter official api compatible

string(3573) "{"id":2543943680,"id_str":"2543943680","name":"kouhei","screen_name":"39ff","location":"\u65e5\u672c \u4eac\u90fd","profile_location":null,"description":"OSINT,Tor Exit JP\/\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u7cfb\u3068\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u958b\u767a\u306b\u8208\u5473\u304c\u3042\u308b\u3060\u3051\u306e\u4e00\u822c\u4eba,\u4ed5\u4e8b\u4f9d\u983c\u306f300k\u304b\u3089https:\/\/t.co\/vh12ewdG8a","url":"https:\/\/t.co\/pa5hVmDeil","entities":{"url":{"urls":[{"url":"https:\/\/t.co\/pa5hVmDeil","expanded_url":"https:\/\/blog.cse.jp\/about","display_url":"blog.cse.jp\/about","indices":[0,23]}]},"description":{"urls":[{"url":"https:\/\/t.co\/vh12ewdG8a","expanded_url":"http:\/\/amzn.asia\/gJBgiFC","display_url":"amzn.asia\/gJBgiFC","indices":[58,81]}]}},"protected":false,"followers_count":710,"fast_followers_count":0,"normal_followers_count":710,"friends_count":535,"listed_count":33,"created_at":"Tue Jun 03 17:02:19 +0000 2014","favourites_count":8849,"utc_offset":null,"time_zone":null,"geo_enabled":true,"verified":false,"statuses_count":1736,"media_count":178,"lang":"ja","status":{"created_at":"Mon Jan 28 17:08:02 +0000 2019","id":1089933127928041473,"id_str":"1089933127928041473","text":"\u3053\u306e\u6642\u306b\u50d5\u306b\u4f9d\u983c\u3057\u3066\u304f\u308c\u3066\u305f\u3089peing\u8106\u5f31\u6027\u306f\u7121\u304f\u306a\u3063\u3066\u307e\u3057\u305f\u306d\uff08\u9069\u5f53\uff09\nhttps:\/\/t.co\/tPxOYp4gVg","truncated":false,"entities":{"hashtags":[],"symbols":[],"user_mentions":[],"urls":[{"url":"https:\/\/t.co\/tPxOYp4gVg","expanded_url":"https:\/\/twitter.com\/39ff\/status\/1058374506232696832","display_url":"twitter.com\/39ff\/status\/10\u2026","indices":[38,61]}]},"source":"\u003ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003eTwitter Web Client\u003c\/a\u003e","in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"geo":null,"coordinates":null,"place":null,"contributors":null,"is_quote_status":true,"quoted_status_id":1058374506232696832,"quoted_status_id_str":"1058374506232696832","retweet_count":0,"favorite_count":1,"favorited":false,"retweeted":false,"possibly_sensitive":false,"possibly_sensitive_editable":true,"lang":"ja"},"contributors_enabled":false,"is_translator":false,"is_translation_enabled":false,"profile_background_color":"0099FF","profile_background_image_url":"http:\/\/abs.twimg.com\/images\/themes\/theme4\/bg.gif","profile_background_image_url_https":"https:\/\/abs.twimg.com\/images\/themes\/theme4\/bg.gif","profile_background_tile":false,"profile_image_url":"http:\/\/pbs.twimg.com\/profile_images\/1001041303101104128\/MtwfG9kX_normal.jpg","profile_image_url_https":"https:\/\/pbs.twimg.com\/profile_images\/1001041303101104128\/MtwfG9kX_normal.jpg","profile_banner_url":"https:\/\/pbs.twimg.com\/profile_banners\/2543943680\/1516707182","profile_link_color":"F58EA8","profile_sidebar_border_color":"000000","profile_sidebar_fill_color":"000000","profile_text_color":"000000","profile_use_background_image":false,"has_extended_profile":true,"default_profile":false,"default_profile_image":false,"pinned_tweet_ids":[1058077400079028224],"pinned_tweet_ids_str":["1058077400079028224"],"has_custom_timelines":true,"can_media_tag":null,"followed_by":null,"following":null,"follow_request_sent":null,"notifications":null,"advertiser_account_type":"promotable_user","advertiser_account_service_levels":[],"business_profile_state":"none","translator_type":"regular","require_some_consent":false}"
string(6) "kouhei"
string(4) "39ff"
string(13) "日本 京都"
sebonlien commented 3 years ago

Is a proxy used for this process?

"429 Too Many Requests" for the error.

When I send too many requests from the same IP address, it gives this error. But using a proxy solves the problem.

39ff commented 3 years ago

Yes, You need Proxy.

sebonlien commented 3 years ago

example Proxy connect pls.