indicator-sysmonitor icon indicating copy to clipboard operation
indicator-sysmonitor copied to clipboard

Any way to fetch local weather and temperature

Open ghost opened this issue 9 years ago • 4 comments

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.

ghost avatar Mar 13 '16 07:03 ghost

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

Bernmeister avatar Mar 13 '16 09:03 Bernmeister

you could use a script like this to get the weather....

  • http://askubuntu.com/questions/390329/weather-from-terminal

fossfreedom avatar Mar 13 '16 09:03 fossfreedom

@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 :)

ghost avatar Mar 14 '16 11:03 ghost

@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

ghost avatar Mar 15 '16 11:03 ghost