Add alternative displayed city

The yahaoo forecast woeid doesn't always match your tiny town name
we really need a configuration file or a gsettings schemas to put
all this outside of the code
yahoo_weather
ecyrbe 14 years ago
parent b047206cd4
commit fa2a7ab41f
  1. 9
      README
  2. 3
      README.md
  3. 5
      src/extension.js

@ -4,10 +4,15 @@ gnome-shell-extension-weather is a simple extension for displaying weather notif
Currently, the weather report including forecast for today and tomorrow is fetched from [Yahoo](http://weather.yahoo.com/).
### Screenshot
![Screenshot](https://github.com/ecyrbe/gnome-shell-extension-weather/raw/master/data/screenshot.png)
### Installation
1. Change `YAHOO_ID` to your location in extension.js (cf. [WOEID](http://developer.yahoo.com/geo/geoplanet/guide/concepts.html))
2. from command line run the following commands :
2. chage the 'CITY_DIPLAYED' to the real name of your location as the WOEID doesn't always match your tiny town
3. from command line run the following commands :
> ./autogen.sh --prefix="/usr"
> make
> sudo make install
@ -17,7 +22,7 @@ Currently, the weather report including forecast for today and tomorrow is fetch
### Licence
Copyright (C) 2011
ecyrbe <ecyrbe+spam@gmail.com> //remove +spam to email
Ecyrbe <ecyrbe+spam@gmail.com>,
Timur Kristóf <venemo@msn.com>,
Elad Alfassa <elad@fedoraproject.org>,
Simon Legner <Simon.Legner@gmail.com>

@ -11,7 +11,8 @@ Currently, the weather report including forecast for today and tomorrow is fetch
### Installation
1. Change `YAHOO_ID` to your location in extension.js (cf. [WOEID](http://developer.yahoo.com/geo/geoplanet/guide/concepts.html))
2. from command line run the following commands :
2. chage the 'CITY_DIPLAYED' to the real name of your location as the WOEID doesn't always match your tiny town
3. from command line run the following commands :
> ./autogen.sh --prefix="/usr"
> make
> sudo make install

@ -46,7 +46,8 @@ const Soup = imports.gi.Soup;
const Util = imports.misc.util;
const UNITS = 'c'; // Units for temperature (case sensitive). f: Fahrenheit. c: Celsius
const YAHOO_ID = 'AUXX0010';
const CITY_DISPLAYED = 'your city';
const YAHOO_ID = 'your yahoo woeid';
const WEATHER_URL = 'http://weather.yahooapis.com/forecastjson?u=' + UNITS + '&p=' + YAHOO_ID;
const FORECAST_URL = 'http://query.yahooapis.com/v1/public/yql?format=json&q=select%20item.forecast%20from%20weather.forecast%20where%20location%3D%22' + YAHOO_ID + '%22%20%20and%20u="' + UNITS + '"';
@ -347,7 +348,7 @@ WeatherMenuButton.prototype = {
// Refresh current weather
this.load_json_async(WEATHER_URL, function(weather) {
let location = weather.get_object_member('location').get_string_member('city');
let location = CITY_DISPLAYED;
let comment = this.get_weather_condition(weather.get_object_member('condition').get_string_member('code'));//weather.get_object_member('condition').get_string_member('text');
let temperature = weather.get_object_member('condition').get_double_member('temperature');
let temperature_unit = '\u00b0' + weather.get_object_member('units').get_string_member('temperature');

Loading…
Cancel
Save