Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
princenaman authored May 20, 2017
0 parents commit f7844d6
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions index.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/python

import re
import urllib2
import sys

class BookMyShowClient(object):

def __init__(self):
code = sys.argv[1]
text = sys.argv[2]
self.__cookie = "Rgn=|Code=%s|text=%s|" % (code , text)
self.__url = "https://in.bookmyshow.com/serv/getData?cmd=QUICKBOOK&type=MT"

def get_json(self):
req = urllib2.Request(self.__url, headers={'User-Agent' : "Magic Browser"})
req.add_header('Cookie', (self.__cookie))
html = urllib2.urlopen(req).read()
return html

if __name__ == '__main__':
bms_client = BookMyShowClient()
json = bms_client.get_json()
print json

0 comments on commit f7844d6

Please sign in to comment.