📜 ⬆️ ⬇️

We are fixing GisMeteo gadget

As many already know, Gismeteo.ru recently closed its project informer.gismeteo.ru . As a result of these events, the former weather export in XML format stopped working. However, not only webmasters suffered, but also ordinary users who have the GisMeteo gadget installed. In recent days, they have seen such a sad picture.

image
I also watched it while I was not tired. It just turned out some free time and I decided to try to fix it.

It turned out that Gismeteo.ua gives XML in the old (at least now). This is what I decided to use.

So in order:
')
1. First of all, download the gadget from gallery.live.com/liveItemDetail.aspx?li=7873de84-58f6-4842-a8f9-466461a2040e

2. Rename the loaded GisMeteo_black.gadget into GisMeteo_black.gadget .zip and unpack it.

3. All we need is the contents of the js folder. First of all, go to js \ weatherData.js and change line 12
req.open( "GET" , "http://informer.gismeteo. ru /xml/" +location+ "_1.xml" , false );

on
req.open( "GET" , "http://informer.gismeteo. ua /xml/" +location+ "_1.xml" , false );

It would seem that everything, but it is not. The fact is that by default the gadget is set to St. Petersburg (they are lucky), the rest will have to suffer a little more.

4. In the js \ weather.js file at the very top are the default settings.

var location= "26063" ;
var locationName= "-" ;

The easiest option is to enter your city there, however, there is also an ambush. As can be seen from line 25 js \ settings.js

req.open( "GET" , "http://bar.gismeteo.ru/gmbartlist.xml" , false );

The list of cities is loaded from the inaccessible URL. Saved as always google cache :) The restored list of cities is now available here gismeteo.googlecode.com/svn/trunk/gmbartlist.xml

5. Now it’s enough to replace in line 25 js \ settings.js

req.open( "GET" , "http://bar.gismeteo.ru/gmbartlist.xml" , false );

on
req.open( "GET" , "http://gismeteo.googlecode.com/svn/trunk/gmbartlist.xml" , false );


6. We pack it back into zip, rename it to GisMeteo_black.gadget, install it, choose your city in the settings (the settings dialog does not open right away, you need to wait a while until js parses xml) and enjoy :)

image

ps working gadget can be downloaded here

* This source code was highlighted with Source Code Highlighter .


upd: now xml is also unavailable through gismeteo.ua
upd2: xml became available with gismeteo.ru

Source: https://habr.com/ru/post/63793/


All Articles