weather information in web site

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • farukcse
    New Member
    • Nov 2007
    • 52

    weather information in web site

    Dear Sir,
    i need to add weather information in my web site.
    how can i do this using php?
    please try to inform to me.

    Regards,
    faruk chowdhury
  • Atli
    Recognized Expert Expert
    • Nov 2006
    • 5062

    #2
    Hi.

    Well, to start with, you would have to find a place to get that weather information from. Do you know such a place?

    Comment

    • farukcse
      New Member
      • Nov 2007
      • 52

      #3
      Originally posted by Atli
      Hi.

      Well, to start with, you would have to find a place to get that weather information from. Do you know such a place?
      i don't know.
      can u send me plz?

      Comment

      • Atli
        Recognized Expert Expert
        • Nov 2006
        • 5062

        #4
        Send you what?
        I have no weather information.

        You are going to have to find a data source if you want to display it on your web.

        Comment

        • farukcse
          New Member
          • Nov 2007
          • 52

          #5
          Originally posted by Atli
          Send you what?
          I have no weather information.

          You are going to have to find a data source if you want to display it on your web.
          i need php code or php classe by which i can show the current temperature for local city/country in my site.

          Comment

          • Atli
            Recognized Expert Expert
            • Nov 2006
            • 5062

            #6
            Yes, I gathered as much.

            But the first thing you are going to need is a data source, a place where you can get the current weather data. No PHP code can simply manufacture this data. It has to come from somewhere.

            Until you know where that is coming from, there is little point even discussing the actual PHP code.

            Don't expect us to simply hand over a ready-to-use code example.
            We are always happy to help out if your having problems with your code, but this is your project. You are going to have to do the heavy lifting.

            Comment

            • dlite922
              Recognized Expert Top Contributor
              • Dec 2007
              • 1586

              #7
              Originally posted by Atli
              Yes, I gathered as much.

              But the first thing you are going to need is a data source, a place where you can get the current weather data. No PHP code can simply manufacture this data. It has to come from somewhere.

              Until you know where that is coming from, there is little point even discussing the actual PHP code.

              Don't expect us to simply hand over a ready-to-use code example.
              We are always happy to help out if your having problems with your code, but this is your project. You are going to have to do the heavy lifting.
              I'm with you but a little googling goes along way, (no heavy lifting needed)

              whether reliable or not, I don't know but if you google("Weather API PHP") you'll get some good results.



              Cheers,



              Dan
              Last edited by Atli; Jan 19 '09, 08:58 AM. Reason: Link to competing forum removed.

              Comment

              • Atli
                Recognized Expert Expert
                • Nov 2006
                • 5062

                #8
                Originally posted by dlite922
                I'm with you but a little googling goes along way, (no heavy lifting needed)
                True, but I do expect people to at least try to do their own work (including researching solutions).

                I actually did Google this myself, using the keywords: "weather feed", and the top 10 results would probably all have worked in this case.

                Comment

                • ak1dnar
                  Recognized Expert Top Contributor
                  • Jan 2007
                  • 1584

                  #9
                  There are so many free web services which gives the weather information. Google for "weather web services". Then Create the consumer application to read the web service.

                  Comment

                  • farukcse
                    New Member
                    • Nov 2007
                    • 52

                    #10
                    Originally posted by dlite922
                    I'm with you but a little googling goes along way, (no heavy lifting needed)

                    whether reliable or not, I don't know but if you google("Weather API PHP") you'll get some good results.



                    Cheers,



                    Dan

                    Thanx for your cooperation and support...

                    Comment

                    • sunman
                      New Member
                      • Jul 2009
                      • 1

                      #11
                      Dear Fri,

                      I was the same problem with you. But I found the solution. Your post was very old. now I reply for next person.

                      You can use the free RSS information from Yahoo. Please see following information. This is a sample of RSS feed using XML Parser.

                      Code:
                      <?php
                      $xmlDoc = new DOMDocument();
                      $xmlDoc->load("http://weather.yahooapis.com/forecastrss?p=SNXX0006&u=f");
                      
                      print $xmlDoc->saveXML();
                      ?>
                      Please see the full information in http://developer.yahoo.com/weather/#req. In this example, you can use (p) for (location) and (u) for (units for temperature). For location code, you can search in http://weather.yahoo.com . For example, In the [Browse for U.S. and International Forecasts] section, click asia > singapore > singapore. Finally, yahoo will show you http://weather.yahoo.com/Singapore-S.../forecast.html. In this page, SNXX0006 for the location of singapore. For another xml with php information, you can learn in http://www.w3schools.com/php/php_xml_parser_expat.asp.

                      Important Note...
                      In XML RSS feed, you must think the link ( http://weather.yahooapis.com/forecastrss?p=SNXX0006&u=f ) to an XML file.


                      Best, Nay La Aung
                      Last edited by Dormilich; Aug 17 '09, 10:50 AM. Reason: Please use [code] tags when posting code

                      Comment

                      Working...