4

This is version two of Australian Weather (From BOM). It had some bugs as BOM generates a html page with n 's, so now it copes with that and I believe, more efficiently, cuts out the precis. Enjoy.

Geeklet files to download

Comments

User Avatar
pearler 3108 days ago
Can you give me some ideas on how to get this to work with Melbourne?  The best I could manage is returning the summary but I get tr: illegal byte sequence.
User Avatar
vileseagulls 3096 days ago
I can't get this working for Sydney either - I've changed the command to:

curl --silent http://www.bom.gov.au/nsw/forecasts/sydney.shtml | tr -d 'n' | sed 's/.*//' | sed 's|.*||' | tr '[:upper:]' '[:lower:]'

which is identical to what it was before but just the different URL, and instead of a forecast my screen has a line of code starting
User Avatar
qwip 3095 days ago
I edited the original for Sydney. This gets the first line of class="summary" and then drops the trailing period. If you like the period, remove the last sed command (|sed 's/(.*)./1/').

I have no idea how to write sed commands, I just copied that last line from a google example, so there's likely a better way to do that.

Here's the updated Sydney code:

curl --silent http://www.bom.gov.au/nsw/forecasts/sydney.shtml | tr -d 'n' | sed 's/.*//' | sed 's|.*||' | tr '[:upper:]' '[:lower:]' |sed 's/(.*)./1/'

Log in to comment or register here.