Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Elect 2012 Python Script
#!/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
You can’t perform that action at this time.