forked from AadarshChaurasia/desktop_assistant_v1.1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Browser.py
34 lines (29 loc) · 1.81 KB
/
Browser.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
try:
import pywhatkit as kit
except:
pass
def show_info_about(query,lines=5):
if 'show info about' in query:
query = query[16:]
if 'tell me about' in query:
query = query[14:]
if 'tell me in detail about' in query:
query = query[24:]
lines = 10
if 'ke bare mai batao' in query:
query = query[:-18]
info = kit.info(query,lines)
return info
def search_on_google(data):
words = data.split(' ')
extra_words = ['search', 'in', 'on', 'for', 'about', 'related', 'to', 'krna', 'kro',
'google', 'ke', 'bare', 'mai', 'main', 'per', 'pr']
if 'in google' in data or 'on google' in data or 'google pr'in data or 'google mai' in data:
for item in extra_words:
try:
# print(item)
words.remove(item)
except:
continue
kit.search(words)
return f'searching on google about {words}'