View Single Post
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, 134 views)