-
Notifications
You must be signed in to change notification settings - Fork 103
Closed
Description
السلام عليكم
https://github.com/rubyfu/RubyFu/blob/master/module_0x4__web_kung_fu/twitter_api.md
We know that Twitter Apps require approval from the Twitter API Team in order to create a project :(
so, we're going to use the [Android] Twitter app's consumer_key: 3nVuSoBZnx6U4vzUxf5w
and consumer_secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys
.
Twitter can't ban you.
My Edit : -
Just put username and password 😄
#!/usr/bin/env ruby
require 'net/http'
require 'twitter'
require 'pp'
username = "" # Your Username
password = "" # Your Passowrd
def guest_token()
gt = URI.parse("https://api.twitter.com/1.1/guest/activate.json")
guest = Net::HTTP.new(gt.host, gt.port)
guest.use_ssl = true
req = Net::HTTP::Post.new(gt.request_uri)
req["Authorization"] = "Bearer AAAAAAAAAAAAAAAAAAAAAFXzAwAAAAAAMHCxpeSDG1gLNLghVe8d74hl6k4%3DRUMF4xAQLsbeBhTSRrCiQpJtxoGWeyHrDb5te2jpGskWDFW82F"
res = guest.request(req).body
return res[/{"guest_token":"(.*?)"}/,1]
end
uri = URI.parse("https://api.twitter.com/auth/1/xauth_password.json")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri.request_uri)
request["X-Guest-Token"] = guest_token()
request["Authorization"] = "Bearer AAAAAAAAAAAAAAAAAAAAAFXzAwAAAAAAMHCxpeSDG1gLNLghVe8d74hl6k4%3DRUMF4xAQLsbeBhTSRrCiQpJtxoGWeyHrDb5te2jpGskWDFW82F"
request.set_form_data({"x_auth_identifier" => username,"x_auth_password" => password})
response = http.request(request).body
private_access_token = response[/"oauth_token":"(.*?)"/,1]
private_access_token_secret = response[/"oauth_token_secret":"(.*?)"/,1]
############# Now u can use Twitter API Lib
client = Twitter::REST::Client.new do |config|
config.consumer_key = "3nVuSoBZnx6U4vzUxf5w"
config.consumer_secret = "Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys"
config.access_token = private_access_token
config.access_token_secret = private_access_token_secret
end
#############
client.update("@0x1337r00t With @KINGSABRI #RubyFu")
~ 1337r00t
Blackfox's Team
KINGSABRI, oicid, davis-lee and 0x417368
Metadata
Metadata
Assignees
Labels
No labels