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

Any way to fetch local weather and temperature #43

Open
ghost opened this issue Mar 13, 2016 · 4 comments
Open

Any way to fetch local weather and temperature #43

ghost opened this issue Mar 13, 2016 · 4 comments

Comments

@ghost
Copy link

ghost commented Mar 13, 2016

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.

@Bernmeister
Copy link
Contributor

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

@fossfreedom
Copy link
Owner

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

@ghost
Copy link
Author

ghost commented Mar 14, 2016

@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
Copy link
Author

ghost commented Mar 15, 2016

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants