File tree Expand file tree Collapse file tree 5 files changed +68
-0
lines changed Expand file tree Collapse file tree 5 files changed +68
-0
lines changed Original file line number Diff line number Diff line change @@ -7,3 +7,4 @@ Automation Scripts is a collection of scripts/projects which helps us in automat
7
7
- [ LaunchMaps] ( https://github.com/prathimacode-hub/Awesome_Python_Scripts/tree/main/AutomationScripts/LaunchMaps )
8
8
- [ Battery Notification] ( https://github.com/prathimacode-hub/Awesome_Python_Scripts/tree/main/AutomationScripts/Battery%20Notification )
9
9
- [ Facebook Messenger Automation] ( https://github.com/prathimacode-hub/Awesome_Python_Scripts/tree/main/AutomationScripts/Facebook%20Messenger%20Automation )
10
+ - [ Weather Notifier] ( https://github.com/Komal-99/Awesome_Python_Scripts/tree/weather/AutomationScripts/Weather%20Notifier )
Original file line number Diff line number Diff line change
1
+ # Weather temperature detection
2
+
3
+ - It is python script to get weather notification on your desktop.
4
+ - After every 20 second the notification comes.
5
+ ## workflow
6
+ * It works on bs4 and times library of python to automate google search when the program is runned.
7
+ * Their are various features used to scrape data from web and then put in notified format.
8
+ ### Output Screenshot
9
+
10
+
11
+
12
+ ### Getting Started
13
+
14
+ 1 . Install all Python dependencies.
15
+
16
+ ```
17
+ pip install -r requirements.txt
18
+ ```
19
+
20
+ 2 . Navigate into ` AutomationScripts ` .
21
+
22
+ ```
23
+ cd AutomationScripts
24
+ ```
25
+
26
+ 3 . Launch the script for compilation of program
27
+
28
+ ```
29
+ python weather.py
30
+ ```
31
+ 4 . Output Screenshot.
32
+
33
+ <img src =" https://github.com/Komal-99/Awesome_Python_Scripts/blob/weather/AutomationScripts/Weather%20Notifier/Images/Screenshot.jpg " >
Original file line number Diff line number Diff line change
1
+ time
2
+ requests
3
+ json
4
+ bs4
5
+ win10toast
Original file line number Diff line number Diff line change
1
+ # import Libraries
2
+ import time
3
+ import requests
4
+ import json
5
+ from bs4 import BeautifulSoup
6
+ from win10toast import ToastNotifier
7
+ # Defination of function to fetch the data
8
+ def update ():
9
+ # Take Inout From User
10
+ city = input ("enter name of the city" )
11
+ # google search done by program itself similar to web scraping
12
+ search = "weather in" + city
13
+ url = f"https://www.google.com/search?q={ search } "
14
+ r = requests .get (url )
15
+ print (r )
16
+ s = BeautifulSoup (r .text ,"html.parser" )
17
+ print (s )
18
+ update = s .find ("div" ,class_ = "BNeawe" ).text
19
+ print (update )
20
+ # format to print the Notification
21
+ text = f'Temperature in { city } in degree celsius is \n { update } '
22
+ while True :
23
+ toast = ToastNotifier ()
24
+ # time duration for getting notified
25
+ toast .show_toast ("weather Update" ,text , duration = 20 )
26
+ time .sleep (10 )
27
+ # calling update function
28
+ update ()
29
+
You can’t perform that action at this time.
0 commit comments