Notices


Reply
Thread Tools
woody14619's Avatar
Posts: 1,455 | Thanked: 3,309 times | Joined on Dec 2009 @ Rochester, NY
#131
Originally Posted by iscio View Post
ok, I edited the script and now I have this result. The only problem now is the wifi and the forecast
If you set the CHECKINT to 0 in this one, you should no longer have the wifi error showing. (CHECKINT only makes sense for wifi vs 3G).

As for the forecast, the page layout for italy is very different. You'd have to find a way to parse the data out from the multi-layered div/table they use in a non-language specific way. Most countries use the default template (like US and most other EU countries). For those this script works. For others, you'll have to figure out how to do that on your own.

The lines that try to get the forecast data are here:
Code:
FiveTemps=`grep "fiveday-temps" $TEMPNAME | sed -e "s#</div>#\n#g" | sed -e "s/&#.*>/ /" | grep -o "[0-9]* $Lowstr[0-9]*" |head -5 | sed -e "s# $Lowstr#/#"`
FiveFore=`grep "fivedayforecast" $TEMPNAME |  sed -e "s#</div>#\n#g" | grep -o "[a-z|A-Z| ]*$" | head -5 `
As you can see, it's just using some pattern matching to find the right div/table and parsing it out to get the values. The problem is that the table for Italy is not at all setup the same way. You can probably still get the values using some more advanced sed techniques, but that would be rather difficult, and probably specific to just Italy.

If you want to give it a shot, please feel free to. There are lots of pages on google about sed (google "man sed" for a starter). I'm sure there's more than one Italian user out there!

Good find on the bug with the script drawing low/high still. I fixed it in one of three places before. Attached is the new version with that fixed up.
Attached Files
File Type: zip weather.zip (318.7 KB, 133 views)
 
Posts: 270 | Thanked: 37 times | Joined on Sep 2010
#132
ok I have some questions:
- I'll try to implement italian forecast but now I have no time so could you give me a new script without the part of forecast? I don't now what I have to delete...so the script is could be smaller.
-about 3G/wifi it seems to be every thing ok. the only "no problem" is that qbw is yellow when updated by 3g :-)

Last edited by iscio; 2011-07-01 at 14:19.
 
Posts: 24 | Thanked: 6 times | Joined on Nov 2010 @ Rome-Italy
#133
Originally Posted by skricciolo1981 View Post
hello to all ...
Sorry I would have a problem: on xterm (sh / home / user / imagemagick / weather.sh) gives me error, but the weather is updated too ...
QBW edited with the same command xterm, the weather does not update ...
can someone help me please ..
thanks and sorry my english
nothing???
 
woody14619's Avatar
Posts: 1,455 | Thanked: 3,309 times | Joined on Dec 2009 @ Rochester, NY
#134
Originally Posted by iscio View Post
- I'll try to implement italian forecast but now I have no time so could you give me a new script without the part of forecast? I don't now what I have to delete...so the script is could be smaller.
The parts that do the forecast chopping are small. Why would you want it smaller? You have 32G of space, 200 bytes isn't going to kill you. If it bothers you that much, edit the file yourself. As it is, if it gets the forecast info right, it displays it. If not, it blanks it out so there's nothing there.

Originally Posted by iscio View Post
-about 3G/wifi it seems to be every thing ok. the only "no problem" is that qbw is yellow when updated by 3g :-)
Hmm... That's odd. It should only return that if it's not updating the weather because of a timeout. Check the time-stamp in the upper right of the image. That should update each time the script updates the lock screen. The yellow icon is triggered by "exit 2" which should only happen in the code that skips updates.

Originally Posted by skricciolo1981 View Post
nothing???
Try the current script. Also: You have spaces between the / in your example above. There should be no spaces. If you look back in the thread aways I have posted a QWB loadable icon widget for the script. You should be able to save that, and load it with QWB to get a working icon directly for the weather.
 
Posts: 270 | Thanked: 37 times | Joined on Sep 2010
#135
Originally Posted by woody14619 View Post
The parts that do the forecast chopping are small. Why would you want it smaller? You have 32G of space, 200 bytes isn't going to kill you. If it bothers you that much, edit the file yourself. As it is, if it gets the forecast info right, it displays it. If not, it blanks it out so there's nothing there.
I have no problem about space...I think that forecast use byte to download and I'd like to delete this part...no problem, I try to modify the script

Originally Posted by woody14619 View Post
Hmm... That's odd. It should only return that if it's not updating the weather because of a timeout. Check the time-stamp in the upper right of the image. That should update each time the script updates the lock screen. The yellow icon is triggered by "exit 2" which should only happen in the code that skips updates.
The stamp is update also if the qbw is yellow. When is yellow it is updated by 3g, when it is green it is updated by wifi
 
Alfred's Avatar
Posts: 855 | Thanked: 612 times | Joined on Oct 2010 @ Germany
#136
Woody, thank you a lot for maintaining this idea. That was just my thought and no coding skills whatsoever, you have improved the script and done a lot of work. Thank you again, i appreciate that.
__________________
Reps are just one click away: Extras | Extras-Testing | Extras-Devel | My-Maemo | CSSU |
Transform your lock screen into a weather forecast Thanks button ================>
 
woody14619's Avatar
Posts: 1,455 | Thanked: 3,309 times | Joined on Dec 2009 @ Rochester, NY
#137
Originally Posted by Alfred View Post
Woody, thank you a lot for maintaining this idea. That was just my thought and no coding skills whatsoever, you have improved the script and done a lot of work. Thank you again, i appreciate that.
No problem. I loved the idea, and didn't even realize I wanted it until you made the first script. (And frankly, more than half the script is still your original, just a little refined.) I wish I had more time to work on things for my N900.

If you like, feel free to update the top-post with a link to the new script. It should be pretty good for most people. It gets the current weather pretty much everywhere now, and in most countries can get the forecast as well.
 
Alfred's Avatar
Posts: 855 | Thanked: 612 times | Joined on Oct 2010 @ Germany
#138
Originally Posted by woody14619 View Post
No problem. I loved the idea, and didn't even realize I wanted it until you made the first script. (And frankly, more than half the script is still your original, just a little refined.) I wish I had more time to work on things for my N900.

If you like, feel free to update the top-post with a link to the new script. It should be pretty good for most people. It gets the current weather pretty much everywhere now, and in most countries can get the forecast as well.
the one from post 131?
__________________
Reps are just one click away: Extras | Extras-Testing | Extras-Devel | My-Maemo | CSSU |
Transform your lock screen into a weather forecast Thanks button ================>
 
woody14619's Avatar
Posts: 1,455 | Thanked: 3,309 times | Joined on Dec 2009 @ Rochester, NY
#139
Originally Posted by Alfred View Post
the one from post 131?
Yup, that should be the latest/greatest. I think I got everything packed in there. (Converting the png to jpg saved a lot of space.)
 
woody14619's Avatar
Posts: 1,455 | Thanked: 3,309 times | Joined on Dec 2009 @ Rochester, NY
#140
FYI: For those updating to CSSU, I found I had a small issue with permissions once I updated. The simple solution is to change permissions on the current theme (again) or modify the script from 131 and add "sudo" before the cp statements in the last few lines of the script.
 

The Following User Says Thank You to woody14619 For This Useful Post:
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 10:05.