Skip to content

Commit

Permalink
Fetch Indian BoxOffice Shows.
Browse files Browse the repository at this point in the history
  • Loading branch information
Pratik-Sanghani committed Jul 20, 2018
1 parent 2a96b2f commit ae81265
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 24 deletions.
2 changes: 1 addition & 1 deletion windows/activities.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ NOTE: All the recorded files will be saved on the desktop. Make sure that the fi
* "***lookfor/find*** _Filename_ _PathWhereYouWantToSearch_" to look for a file at a specified location and open it. Also you can open files from C drive, D drive, Desktop, Documents, Downloads by saying- find/lookfor in <C or D drive/Documents/Desktop?downloads>. C and D drive can be opened by saying- lookfor/find C/D drive(Version: Microsoft Windows [Version 10.0.16299.431]).
* "***draw graph for*** _formula_ ***from*** _Upper-limit_ ***to*** _Lower-limit_" to plot graph for formula like(x^n+ax^m+b ...) for example,
_draw graph for x**2+4*x+6 from -100 to 100_.
* "*_city_name_* ***boxoffice***" to get list of Movies from the Cinemas of Town.
* "*_city_name_* ***boxoffice***" to get list of Movies from the Cinemas of Town within `Indian Region`.
* "***add event in google calendar*** to add event on your google calendar, type(or say) in the following format: "add event <event_name> <start date in format yyyy-mm-dd> to <end date in format yyyy-mm-dd>" and it will save the event on your google calendar.
* "***play/stream/queue*** _Song/VideoName_" to play any song or video on Youtube.
* "***download video*** _SongName_" to download video.
Expand Down
48 changes: 25 additions & 23 deletions windows/benji.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def events(frame,put):
print("By ", status.user.screen_name, " at ", status.user.created_at)

#Get friends from twitter
elif len(link[-1]) == "twitter":
elif link[-1] == "twitter":
if link[-3] == "follow" and link[-1] == "twitter":
auth = OAuthHandler(twitterCredentials.consumer_key, twitterCredentials.consumer_secret)
auth.set_access_token(twitterCredentials.access_token, twitterCredentials.access_secret)
Expand Down Expand Up @@ -421,44 +421,44 @@ def main():
#Box Office Status
elif link[-1] == "boxoffice":
try:
url="https://in.bookmyshow.com/"+ link[0] +"/movies/nowshowing"
r= requests.get(url)
soup = BeautifulSoup(r.content,'html.parser')
url = "https://in.bookmyshow.com/" + link[0] + "/movies/nowshowing"
r = requests.get(url)
soup = BeautifulSoup(r.content, 'html.parser')

soup_level2=[]
show_status_list=[]
shows_list = soup.find_all('div',attrs={'class':'card-container wow fadeIn movie-card-container'})
soup_level2 = []
show_status_list = []
shows_list = soup.find_all('div', attrs={'class': 'card-container wow fadeIn movie-card-container'})
for i in shows_list:
start = str(i).index("href=")
end = str(i).index("title=")
soup_level2.append("https://in.bookmyshow.com"+str(i)[start+6:end-2])
end = str(i).index("title=")
soup_level2.append("https://in.bookmyshow.com" + str(i)[start+6 : end-2])

show_status_raw = soup.find_all('div',attrs={'class':'popularity sa-data-plugin'})
show_status_raw = soup.find_all('div', attrs={'class': 'popularity sa-data-plugin'})
for i in show_status_raw:
start = str(i).index("data-coming-soon=")
end = str(i).index('data-event-code')
data = str(i)[start+18:end-2]
end = str(i).index('data-event-code')
data = str(i)[start+18 : end-2]

if data == "false":
show_status_list.append("In Cinemas Now...")
if data == "true":
show_status_list.append("Coming Soon...")

Tags_list=[]
Name_list=[]
Tags_list = []
Name_list = []

for url in soup_level2:
r= requests.get(url)
tags = BeautifulSoup(r.content,'html.parser')
Tags_raw = tags.find_all('span',attrs={'class':'__genre-tag'})
r = requests.get(url)
tags = BeautifulSoup(r.content, 'html.parser')
Tags_raw = tags.find_all('span', attrs={'class': '__genre-tag'})
tmp_tags = ""
for i in Tags_raw:
tmp_tags = tmp_tags + str(i)[str(i).index('">')+2:str(i).index("</span>")] + " - "
tmp_tags = tmp_tags + str(i)[str(i).index('">')+2 : str(i).index("</span>")] + " - "
Tags_list.append(tmp_tags[:-3])

Names_raw = tags.find_all('h1',attrs={'class':'__name'})
Names_raw = tags.find_all('h1', attrs={'class': '__name'})
for i in Names_raw:
Name_list.append(str(i)[str(i).index('">')+2:str(i).index("</h1>")])
Name_list.append(str(i)[str(i).index('">')+2 : str(i).index("</h1>")])

speak.say("Preparing List")
speak.runAndWait()
Expand All @@ -468,14 +468,16 @@ def main():
print("----------------------------------------------")
print("")
for i in range(cntr):
print("Name : "+ Name_list[i])
print("Name : " + Name_list[i])
print("Tags : " + Tags_list[i])
print("Status : "+ show_status_list[i])
print("Status : " + show_status_list[i])
print("")
print("----------------------------------------------")
print("")
except:
print("Error")
print("Sorry, List Cannot be Prepared...")
speak.say("Sorry, List Cannot be Prepared...")
speak.runAndWait()

# elif put.startswith(search_pc):
# process=subprocess.Popen("dir /b/s "+link[1],shell=True,stdout=subprocess.PIPE)
Expand Down

0 comments on commit ae81265

Please sign in to comment.