Created
January 17, 2012 20:45
-
-
Save BoSanad/1628773 to your computer and use it in GitHub Desktop.
Elect 2012 Python Script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# this python script has been written by Saleh Alsanad, @bo9lo7 | |
# as a proof of concept that given any name I can get the information | |
# of any registered guy in Kuwait, even by searching part of his name | |
# Date: 17 Jan 2012, saleh [AT] angelic [DOT] com | |
import urllib, httplib, sys, json | |
if __name__ == '__main__': | |
if len(sys.argv) < 2: | |
print 'Please provide some input!' | |
sys.exit(0) | |
name = urllib.quote(" ".join(sys.argv[1:])) | |
conn = httplib.HTTPConnection('www.q8forlife.com') | |
conn.request('GET', '/rest/citizin/fullname/%s?page=1&limit=30' % (name)) | |
res = conn.getresponse() | |
try: | |
jo = json.loads(res.read()) | |
for i in jo: | |
print 'Area: %s' % (i['area']) | |
print 'Job: %s' % (i['job']) | |
print 'Circle: %s' % (i['daera']) | |
print 'Nationality Number: %s' % (i['natno']) | |
print 'Full Name: %s' % (i['fullname']) | |
print '-' | |
except: | |
print 'Nobody Found!' | |
conn.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment