maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Maemo 5 / Fremantle (https://talk.maemo.org/forumdisplay.php?f=40)
-   -   Weather lockscreen and widget..it works now. (https://talk.maemo.org/showthread.php?t=88137)

dzano 2013-02-06 20:50

Re: Weather lockscreen and widget..it works now.
 
I wonder why my post is deleted!?

..................................
Again, it is possible to make it look like yahoo weather widget used to. Not using yahoo weather but using imagemagick. Exams are coming soon so I really don't have time for that right now, but if you don't want to wait, you can use THIS script to make it...it shouldn't be so hard to do.

n900d-i-y 2013-02-06 21:48

Re: Weather lockscreen and widget..it works now.
 
Quote:

Originally Posted by dzano (Post 1321223)
I wonder why my post is deleted!?

..................................
Again, it is possible to make it look like yahoo weather widget used to. Not using yahoo weather but using imagemagick. Exams are coming soon so I really don't have time for that right now, but if you don't want to wait, you can use THIS script to make it...it shouldn't be so hard to do.

But isn't that to make the lockscreen?

woody14619 2013-02-06 21:56

Re: Weather lockscreen and widget..it works now.
 
1 Attachment(s)
dzano,

Great work on this. There are a few issues with the script though:

First, it assumes that all xml files from different regions are the same length and have the same info on exactly the same lines. That's not at all true.

It also assumes that the file names stay the same. They don't. They change randomly, from months to days apart.

Also, the icons are huge, and many are identical.

In that regard... I rewrote the script. It should work for most people, out of the box, few settings changes. All you have to do is choose what area you want to default to, since the widget allows you to have multiple "home" weathers.

This version only relies on 13 of the icon files (non redundant), and does conversions for °C to °F, and Kph to Mph, which is easy to change back if you prefer. (The xml is always in metric values apparently.)

Anyway... check it out, and let me know what you think. Feel free to pull it in, make changes, or whatever. :)

Overall I really like this compared to the other scripts I worked with/wrote to do this, since it's getting the weather from a reliable and rather un-changing source (the XML). The previous one relied on Yahoo weather, but Yahoo changes it's page formats every few months, and it's radically different by region.

Ideally, one would run this in pearl, and use a proper XML parser to do this work. But for now, shell works. ;) I commented parts a bit as well, so it should be more readable.

Anyway, enjoy!

dzano 2013-02-06 22:24

Re: Weather lockscreen and widget..it works now.
 
I know that all .xml files are not same.
File names are always same, they don't change..but they are different by region/city.

And as I already said, I hope someone is willing to make it better...this is my first script and I hardly managed to make it work :)

Great work..thank you!

Quote:

Originally Posted by n900d-i-y (Post 1321228)
But isn't that to make the lockscreen?

It is but you could use that "imagemagick" lines at bottom of the script.

woody14619 2013-02-07 21:43

Re: Weather lockscreen and widget..it works now.
 
Quote:

Originally Posted by dzano (Post 1321233)
I know that all .xml files are not same.
File names are always same, they don't change..but they are different by region/city.

They remain that way for a while sometimes, but found something like 200 files in my folder, many with similar, but not identical names. (Some dated back almost 3 years.) Using find to refine that list to things touched in the past day limits that nicely.

Quote:

Originally Posted by dzano (Post 1321233)
And as I already said, I hope someone is willing to make it better...this is my first script and I hardly managed to make it work :)

As I said, feel free to update/fix this to work in your area as well. I would assume the tag names stay the same, but they may not. Depends on if the XML tags are translated too, which I doubt, but is possible. :rolleyes:

It should be simple to add back in the things you had before that I took out (sunrise/set, etc) if you desire that. When I get more time (rare) I may work on it more to add some other things, unless you get to it first. :)

dzano 2013-02-08 07:40

Re: Weather lockscreen and widget..it works now.
 
Lets hope names won't change very often. I'm working on these scripts (that use .xml file) for 3 months now and it didn't change..al least for Sarajevo.

Anyway, it's not big deal to update script with new .xml name...but I'll try to figure out something.

Thanks for your help :)

n900d-i-y 2013-02-09 06:46

Re: Weather lockscreen and widget..it works now.
 
@ woody14619

I am using HTC Weather widget 3, but I don't know how to add H temp and L temp like the original yahoo widget, would you know what to add in the .txt file?

dzano 2013-02-09 12:50

Re: Weather lockscreen and widget..it works now.
 
Quote:

Originally Posted by n900d-i-y (Post 1321940)
@ woody14619

I am using HTC Weather widget 3, but I don't know how to add H temp and L temp like the original yahoo widget, would you know what to add in the .txt file?

http://www.fileden.com/files/2007/9/...209-120741.png

As woody14619 suggested, I made some changes. Now it can convert C to F, and automaticaly find .xml file if name is changed.

1. It works with OMWeather, so you need to install and configure it.

2. Install imagemagick from extras.
Code:

root
apt-get install imagemagick

3. Extract THIS in /home/user/MyDocs/.Weather/

4. open Xterminal:
Code:

root
chmod 777 /home/user/MyDocs/.Weather/*

5. Extract THIS in /home/user/imagemagick/fonts/

6. Import THIS to QBWidget and edit refresh interval.

7. Edit /home/user/MyDocs/.Weather/weather.sh
(change name of XXXXXXXX.xml file)

woody14619 2013-02-12 03:54

Re: Weather lockscreen and widget..it works now.
 
Nice update. Just FYI: The opis line you use probably won't always work. You need to make it like the press1 & press2 entries, looking for the opis tag first, then the <t> tag after it. Other wise you'll wind up with what ever <t> tag comes first in the xml, which may or may not be the opis value. ;)

Very nice overall. It's simple little things like this that add that extra layer of beauty and make the N900 shine all the more.

dzano 2013-02-12 07:01

Re: Weather lockscreen and widget..it works now.
 
Thank you my friend...it's fixed now!

useretail 2013-07-31 13:24

Re: Weather lockscreen and widget..it works now.
 
Quote:

Originally Posted by dzano (Post 1321978)
3. Extract THIS in /home/user/MyDocs/.Weather/

5. Extract THIS in /home/user/imagemagick/fonts/

6. Import THIS to QBWidget and edit refresh interval.

files are dead.. can you re-up everything?

dzano 2013-08-03 08:32

Re: Weather lockscreen and widget..it works now.
 
Sorry, something seems to be wrong with fileden.com.

3. https://www.dropbox.com/s/xvlotqlqjk5a88w/Weather.zip

5. Extract only "fonts" folder: https://www.dropbox.com/s/2ogbqb8ur9...magemagick.zip

6. https://www.dropbox.com/s/iq4wna7qp3...r%20widget.txt


All times are GMT. The time now is 11:42.

vBulletin® Version 3.8.8