Any way to fetch local weather and temperature
Do you have any script which can be used to fetch local weather and temperature of a location and display it in indicator-sysmonitor
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
Perhaps you could install my-weather-indicator:
sudo add-apt-repository ppa:atareao/atareao
sudo apt-get update
sudo apt-get install my-weather-indicator
you could use a script like this to get the weather....
- http://askubuntu.com/questions/390329/weather-from-terminal
@Bernmeister Thanks for the suggestion but I dont want to install another app for that. @fossfreedom suggestions seems to work. I will try to write my own script and post the script here :)
@fossfreedom This is script I made for fetching local weather from accuweather. It still has some bugs
#!/bin/sh
#Inorder to prevent banning of our IP from accuweather; Only once the web page is called
#It updates only on the reboot
#Prevent multiple instance of this shell script
PIDFILE=/tmp/`basename $0`.pid
if [ -f $PIDFILE ]; then
if ps -p `cat $PIDFILE` > /dev/null 2>&1; then
exit
fi
fi
echo $$ > $PIDFILE
trap 'rm -f "$PIDFILE" >/dev/null 2>&1' EXIT HUP KILL INT QUIT TERM
#Change URL to your location currently its Berlin
URL='http://www.accuweather.com/en/de/berlin/10178/weather-forecast/178087'
#RF is Real Feel of accuweather
wget -q -O- "$URL" | awk -F\' '/acm_RecentLocationsCarousel\.push/{print ""$10"° RF="$12"°" }'| head -1