diff --git a/windows/activities.md b/windows/activities.md index 026a6e1..11d7350 100644 --- a/windows/activities.md +++ b/windows/activities.md @@ -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 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 to " 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. diff --git a/windows/benji.py b/windows/benji.py index 023da19..e26eecc 100644 --- a/windows/benji.py +++ b/windows/benji.py @@ -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) @@ -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("")] + " - " + tmp_tags = tmp_tags + str(i)[str(i).index('">')+2 : str(i).index("")] + " - " 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("")]) + Name_list.append(str(i)[str(i).index('">')+2 : str(i).index("")]) speak.say("Preparing List") speak.runAndWait() @@ -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)