How to get Yahoo's woeid by location?

Yahoo has moved to paid service called BOSS but they do offer a non-commercial service:

Non-Commercial usage of Yahoo Geo API's

Yahoo! continues to fully support developer applications built on top of Placefinder and PlaceSpotter in non-commercial settings. Both services are available to you via YQL and rate limited to 2000 queries per table. Learn more about using the Placefinder and Placespotter YQL tables.

Using Placefinder you can reverse lookup a latitude and longitude:

http://developer.yahoo.com/yql/console/?q=select%20*%20from%20geo.placefinder%20where%20text%3D%2237.416275%2C-122.025092%22%20and%20gflags%3D%22R%22

which can be converted into a json request:

http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20geo.placefinder%20where%20text%3D%2237.416275%2C-122.025092%22%20and%20gflags%3D%22R%22&format=json


Yes, it's closed, give a look here: http://soup.metwit.com/post/47181933854/an-alternative-to-yahoo-weather-api