OpenSprinkler Forums Hardware Questions OpenSprinkler Pi (OSPi) Rain delay from Yahoo Weather Re: Re: Rain delay from Yahoo Weather



salbahra: I uploaded a bash script to obtain the woeid from Yahoo. it can be found here:

Pass in an argument with the string that you want to search for. For example:

> ./ "Washington, DC"
2514815 Washington, DC

> ./ "12345"
12762240 Schenectady, NY 12345

> ./ "Disneyworld"
23686031 Walt Disney World Resort

> ./ "Beijing"
2151330 Beijing

It will return the woeid and the name of the matched location. They’re separated by a tab, so you can pipe it to cut -f 1 to get just the woeid.

I wouldn’t recommend calling this every time you want to query the weather. Rather, I would run it once to obtain the weoid and somehow save that along with the user-specified location. Yahoo limits the number of times this part of their API can be accessed.