Skip to content

Commit

Permalink
Fetch Current BoxOffice Shows.
Browse files Browse the repository at this point in the history
  • Loading branch information
Pratik-Sanghani committed Jul 19, 2018
1 parent 2337c00 commit fe05cc0
Showing 1 changed file with 32 additions and 4 deletions.
36 changes: 32 additions & 4 deletions windows/benji.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
import cv2
import tweepy
from tweepy import OAuthHandler
import twitterCredentials
#import twitterCredentials

requests.packages.urllib3.disable_warnings()
try:
Expand Down Expand Up @@ -428,9 +428,9 @@ def main():
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])
start = str(i).index("href=")
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'})
for i in show_status_raw:
Expand All @@ -443,6 +443,34 @@ def main():
if data == "true":
show_status_list.append("Coming Soon...")

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'})
tmp_tags = ""
for i in Tags_raw:
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'})
for i in Names_raw:
Name_list.append(str(i)[str(i).index('">')+2:str(i).index("</h1>")])

cntr = len(Name_list)
print("----------------------------------------------")
print(link[0].capitalize())
print("----------------------------------------------")
print("")
for i in range(cntr):
print("Name : "+ Name_list[i])
print("Tags : " + Tags_list[i])
print("Status : "+ show_status_list[i])
print("")
print("----------------------------------------------")
print("")

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

0 comments on commit fe05cc0

Please sign in to comment.