Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some basic edits like spelling mistakes, extended some functionality #25

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion Voice Assistant.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
import requests
import pyaudio

import pyttsx3 // this module was used before importing




Expand Down Expand Up @@ -95,10 +97,24 @@ def takeCommand():
webbrowser.open_new_tab("gmail.com")
speak("Google Mail open now")
time.sleep(5)
elif "shoping" in statement:
elif "shopping" in statement or "purchase" in staement or "buy" in statement:
speak("nice mood sir")
webbrowser.open("amazon.com")
speak("here you are sir")


# adding functionality to open System programs like notepad etc

# It assumes that the path of notepad is set in Environment variables
# to set the path, press windows icon, search for notepad, then on right hand
# side, click on open file location, then it will open the path to shortcut of
# notepad program in your system, again right click, and select open file
# location, the copy its path and set a new environment variable, with
# variable name -> Notepad
# variable value -> path copied in above steps
elif "notepad" in statement or "texteditor" in statement:
speak("Opening notepad for you")
os.system(Notepad)


elif "weather" in statement:
Expand Down
16 changes: 16 additions & 0 deletions newsfinal.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import requests
from bs4 import BeautifulSoup


def get_headlines(url):
info = {'text': [],
'link': []}
resp = requests.get(url)
soup = BeautifulSoup(resp.text, 'html.parser')
for line in soup.findAll('span', {'class': 'w_tle'}):
info['text'].append(line.text)
link = line.find('a')['href']
if link[0]=='/':
link = 'https://timesofindia.indiatimes.com' + link
info['link'].append(link)
return info