Trying to get the weather from yahooapis

Posted on 2014-07-23
Last Modified: 2014-07-25
This should return the weather for my location:

The temperature is correct, but the code is always 3200, which means 'not available' - see

It wasn't always like that. I used to get the correct code in return. Anyone know if I am doing something wrong or if there is some tweak to this?

The javascript I use is this:
    // Specify the ZIP/location code and units (f or c)
    var loc = 'NOXX0008'; // or e.g. SPXX0050
    var u = 'c';

    var query = "SELECT item.condition FROM weather.forecast WHERE location='" + loc + "' AND u='" + u + "'";
    var cacheBuster = Math.floor((new Date().getTime()) / 1200 / 1000);
    var url = '' + encodeURIComponent(query) + '&format=json&_nocache=' + cacheBuster;

    window['wxCallback'] = function(data) {
        var info =;        
            backgroundPosition: '-' + (61 * info.code) + 'px 0'
            title: info.text
        $('#wxIcon2').append('<img src="' + info.code + '.gif" width="34" height="34" title="' + info.text + '" />');
        $('#wxTemp').html(info.temp + '&deg;' + (u.toUpperCase()));

        url: url,
        dataType: 'jsonp',
        cache: true,
        jsonpCallback: 'wxCallback'

Open in new window

Question by:itnifl
    LVL 52

    Expert Comment

    by:Scott Fell, EE MVE
    LVL 2

    Author Comment

    This tells me NOXX0008 is the code for Drammen, Norway. It is the code that I use.

    I could also use woeid like you do. In this case I used 29326649 which I got from Like the site suggests, the code result is 3200 in this case also:

    So, Yahoo having problems with measuring the weather at my location? Who should I contact?
    LVL 52

    Accepted Solution

    Try a different api.  I get very frustrated every time I try and use yahoo stuff.
    LVL 2

    Author Closing Comment

    Thank you

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Requirements JQuery 1.6+ HTML CSS Introduction This article was inspired by an EE question ( on how to make a page show some balloons animate up a page…
    Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
    The viewer will learn how to dynamically set the form action using jQuery.
    The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now