title: Get WOEID from city name?
body: <p>I was using Google Weather API to fetch weather info, but apparently Google had stopped its service. And I am trying to switch to Yahoo Weather API now.</p>
  
  <pre><code>var WOEID = 2502265;  //random WOEID
  $.ajax({
      url: "http://weather.yahooapis.com/forecastjson?w=" + WOEID + "&amp;u=c",
      dataType: 'json',
      success: function(data) {
          console.log(data);
      }
  });
  </code></pre>
  
  <p>However, is there a way that I can get the WOEID by JavaScript only? Because back then I can just do</p>
  
  <pre><code>http://www.google.com/ig/api?hl=en&amp;weather=NYC
  </code></pre>
  
  <p>and that's it.</p>
  
  <p>It says on the <a href="http://developer.yahoo.com/weather/" rel="noreferrer">Yahoo weather API page</a>,</p>
  
  <blockquote>
    <p>To find your WOEID, browse or search for your city from the Weather home page. The WOEID is in the URL for the forecast page for that city. You can also get the WOEID by entering your zip code on the home page.</p>
  </blockquote>
  
  <p>But I want to get it by JavaScript, not manually go to weather.yahoo.com and find out the WOEID.</p>
  
  <p>Don't care about the Cross-Origin Policy because I am using it in an Chrome extension and it does not apply. </p>