Skip to content

Instantly share code, notes, and snippets.

@BoSanad
Created January 17, 2012 20:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save BoSanad/1628773 to your computer and use it in GitHub Desktop.
Save BoSanad/1628773 to your computer and use it in GitHub Desktop.
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