Skip to content

Instantly share code, notes, and snippets.

@zzuf
Created January 25, 2015 18:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zzuf/5d3801421b0197f626aa to your computer and use it in GitHub Desktop.
Save zzuf/5d3801421b0197f626aa to your computer and use it in GitHub Desktop.
#!/usr/local/bin/python
# -*- coding: utf-8 -*-
import urllib
import oauth2
import random
#
CK = ''
CS = ''
#
AT = ''
AS = ''
def API():
client = oauth2.Client(
oauth2.Consumer(key=CK,secret=CS),
oauth2.Token(AT,AS)
)
rnd_str = "".join([random.choice('abcdefghijklmnopqrstuvwxyz1234567890') for x in xrange(10)])
params = urllib.urlencode({
'screen_name' : rnd_str,
'password' : GenePW,
'email' : rnd_str+'@gmail.com',
'name' : rnd_str,
})
res = client.request(
'http://api.twitter.com/1/account/generate.json','POST',params
)
if res[0]['status'] == '200':
print "ID: "+rnd_str
print "PW: "+GenePW
else:
print res[1]
if __name__ == '__main__':
API()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment