Home AMX User Forum AMX General Discussion
Options

Weather

I'm using a module that i foud here about weather but i can't make it to view as Dubai. zip code is not working? and dubai dont have zipcode. so how can i mange to work with dubai weather?

Comments

  • Options
    JubalJubal Posts: 77
    I found weather code in yahoo.this is what i get.


    <!-- Yahoo! Weather Badge --><iframe allowtransparency="true" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0"


    so how can i put it in my touchpane??? i only need dubai weather.
  • Options
    DHawthorneDHawthorne Posts: 4,584
    There is nothing in that code snippet that specifies the location, it's all display data. You are going to have to figure out that the actual POST or GET command the web pages uses to call Dubai weather, and make it fit what the module implements. I've never used that particular module, so I can't be specific, but it's entirely possible it won't do international weather ... most services handle international and domestic weather differently.
  • Options
    nicholasjamesnicholasjames Posts: 154
    DHawthorne wrote: »
    There is nothing in that code snippet that specifies the location, it's all display data

    I think what he's referring to is the persistent "cZipCode" variable that is used in the 'GET_FORECAST-' command that is sent to the duet module. It appears to me that, whether you use the "SearchLocalID" or not, the module is designed to return and use a Zip Code.

    Unfortunately, Jubal, I'd be willing to bet it was only designed to work with zip codes. No zip code, no weather. I'd try finding another weather module unless you can try, as DHawthorne suggests, to formulate the request yourself and hope that the duet module is designed to simply accept the data it gets whether it's the right zip code or not.
  • Options
    catalinocatalino Posts: 25
    Your best bet is to perform a HTTP 1.1 GET request from a local weather website and filter out the required information and then use dynamic or custom button graphics scraped from a website.
  • Options
    JubalJubal Posts: 77
    catalino wrote: »
    Your best bet is to perform a HTTP 1.1 GET request from a local weather website and filter out the required information and then use dynamic or custom button graphics scraped from a website.

    yah i think this is the way i can do but my problem is i dont know how to get it from HTTP. im new in this programming career and didn't try to use web or HTTP to include in my touch panel or program
  • Options
    catalinocatalino Posts: 25
    HTTP Is accessed via a opening a network socket (use 0:3:0 or higher as your device, that opens a port on the NIC to use)

    then use IP_CLIENT_OPEN to open a port, then SEND_STRING a crafted HTTP 1.1 GET response. If you're unsure how to do this, a few minutes of googling "raw HTTP request header" should get you what you need.

    It should spit back a raw html file. Look through the HTML and look to see what information you will need to parse then just use FIND_STRING to get at it. If you get stuck, post some code up here.
  • Options
    nicholasjamesnicholasjames Posts: 154
    Check out Wireshark. It's an excellent tool for learning how devices are communicating over IP. It's actually what I used to learn how to GET a webpage.
  • Options
    catalinocatalino Posts: 25
    Here's the actual W3C RFC on HTTP 1.1

    http://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html

    It ends up being:

    GET <URL> HTTP/1.1

    for example,

    GET http://www.w3.org/pub/WWW/TheProject.html HTTP/1.1
  • Options
    JubalJubal Posts: 77
    catalino wrote: »
    Here's the actual W3C RFC on HTTP 1.1

    http://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html

    It ends up being:

    GET <URL> HTTP/1.1

    for example,

    GET http://www.w3.org/pub/WWW/TheProject.html HTTP/1.1


    sorry but i really dont have idea about HTTP. how can i edit the module i get to make it as dubai??
  • Options
    nicholasjamesnicholasjames Posts: 154
    Pay someone else to write it?
  • Options
    JubalJubal Posts: 77
    Pay someone else to write it?

    thanks for your suggestion but i think i will talk to client not to include this one.
  • Options
    amdpoweramdpower Posts: 110
    I just posted a module I which does weather and controls the ENV-VST-C. Its over in the technical forum and called Y-Weather. It supports international location codes if you download the 0.96 version. Read the posts snd delete the dvRel reference which I forgot to remove.

    Sent from my Kindle Fire using Tapatalk 2
  • Options
    amdpoweramdpower Posts: 110
    http://www.amxforums.com/showthread.php?t=8760

    Link

    Sent from my Kindle Fire using Tapatalk 2
  • Options
    JubalJubal Posts: 77
    amdpower wrote: »
    http://www.amxforums.com/showthread.php?t=8760

    Link

    Sent from my Kindle Fire using Tapatalk 2


    thanks for this. i use it now. but still it only allow zipcode. when i put specific location like dubai, Error occure but when i put any number representing zipcode its working. also the picture display for weather icon didnt appear
  • Options
    JubalJubal Posts: 77
    Jubal wrote: »
    thanks for this. i use it now. but still it only allow zipcode. when i put specific location like dubai, Error occure but when i put any number representing zipcode its working. also the picture display for weather icon didnt appear



    now its working. i go to weather.com and check for the number in the URL and put it in your zip/location and its working thanks
  • Options
    JubalJubal Posts: 77
    the only thing that is not working is the display image for weather icon
  • Options
    amdpoweramdpower Posts: 110
    Did you load the sample panel? The sample panel contains all of the images. The Viewstat images will just work based on code obviously.

    Sent from my Kindle Fire using Tapatalk 2
  • Options
    amdpoweramdpower Posts: 110
    If you are just copying and pasting the pages, you'll need to export all of the weather images from the sample panel resource manager and then import them into your panel.

    Sent from my Kindle Fire using Tapatalk 2
  • Options
    JubalJubal Posts: 77
    amdpower wrote: »
    If you are just copying and pasting the pages, you'll need to export all of the weather images from the sample panel resource manager and then import them into your panel.

    Sent from my Kindle Fire using Tapatalk 2


    yah i only copy paste it. ok i will try it tom. thanks for your code.
  • Options
    Thanks for this, very nicely done : )
Sign In or Register to comment.