Announcement

Collapse
No announcement yet.

Weather app broken

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Weather app broken

    As quoted by Clockwork: If anyone is trying Driveline for the first time, Google decided to shut down their weather API, so the weather/forecast part of DriveLine doesn't work anymore. I need to switch to a new weather service.. And I'm open to suggestions.

  • #2
    ahh no wonder why that stopped working lol.. What does the source have to be? On Android, I use WeatherBug which I find to have pretty accurate forecasts. Is there any way to use their services?
    http://weather.weatherbug.com/
    "It's not worth having if you can't customize it"

    Comment


    • #3
      My vote is for World Weather Online. It uses a key provided to the user, that way you only have to worry about coding to their api and not having to do a program update every month or so, as what happens to parser apps. I have my key ready to go SNO

      Comment


      • #4
        The wonderful thing about Google's weather API was that you didn't need a key of any kind to access it. To my knowledge, it worked pretty much everywhere. So, my choices are:

        1: Make every user go register on some weather website and get their own access key if they want weather to work. Lame. But I could try to support a few of them.

        2: Find a good weather website that takes parameters through the URL, and write some code to parse the HTML of the website to try to extract the weather information. Not fun. Not reliable. Breaks every time they change their website. But it's not that hard. It can probably be done in a day or two.

        3: Remove weather from DriveLine. Unthinkable. It worked so good for so long.

        4. Go closed-source and hard-code a single API key into the program. Also not gonna happen.

        I've got a hunch that it's gonna be #2 at first. For the user, i want it to just work with no requirements other than GPS and internet present. No sign-up crap.

        Comment


        • #5
          I recently had this problem with googles API in FreeICE. This might be use.. might not but let me know if you need more info. I code in vb.net

          Google was great in finding your location from rubbish you typed in. I now use Yahoo but still google as well.

          1. First I get the users location either by GPS / IP / or what they type in.
          2. This then goes to google to be goecoded to Long / Lat.
          3. I then send this long / lat to yahoo to obtain there crappie woeid or whatever it is.
          4. Poll yahoo in Json feed as it gives you 5 days :-)
          5. Also poll wap feed of weather.com to grab the correct icons.

          No need for any keys.. it just works :-)

          Let me know if you need anymore info fella.
          Follow me on Twitter

          http://www.FreeICE.co.uk

          Comment


          • #6
            This sounds like it has potential. Thanks for the lead! I just have to do some reading to see how to look up a WOEID from Lat/Lon, and then parse some JSON.

            I'm in VB.Net as well. I'm never against helping another coder. So if you ever need something, feel free to ask. Always good to see the community working together.

            Comment


            • #7
              Hi fella,

              PM sent...

              OK, I've zipped up my plugin (FI works on plugins :-) ) this plugin also does a couple of things. It checks for internet and also how far you are away from home...

              Anyway, I'm not a coder by trade so apols if it's messy. lol but it works. FI has a flash based frontend so where you se set.variable(....) it's sending it to the flash skin.

              Let me know if you need anything :-)

              Steve
              Follow me on Twitter

              http://www.FreeICE.co.uk

              Comment


              • #8
                Thanks. That was everything I needed to see. I put a new version up with weather / forecast added back in. Looks like I can only get an icon for current weather though. I'll have to read through the API documentation tomorrow. I still need to add some "Yahoo Weather" logo too.

                Also, good clean code.

                Comment


                • #9
                  Man that was quick, and props to CdRsKuLL for the guidance. Downloading new version now. SNO

                  Comment


                  • #10
                    Apologies.. you will need to add / change the code as it's currently pulling the last icons from where I live. Sorry I didn't realise until now.

                    ADD. to the newweather structure at the top
                    Public location As String

                    ADD. to the Select Case in the Grab_Weather sub. (where all the rest is.)
                    Case "location"
                    .location = dt(2)

                    CHANGE the weatherurl = at the top of grabicons sub
                    weathercomurl = "http://wap.weather.co.uk/10day/" & newweather.location


                    Sorry, missed it :-) You should be good to go then.


                    I spent 3 days getting my weather working and wouldn't want someone to go through the same when I've already done it. :-)

                    Thanks

                    Steve
                    Last edited by CdRsKuLL; 09-17-2012, 03:13 AM.
                    Follow me on Twitter

                    http://www.FreeICE.co.uk

                    Comment


                    • #11
                      Don't worry. I didn't use that part of it. I didn't copy your code. Just looked through the URLs for the API and the icons.

                      My icon is coming from:

                      http://i.uk.imwx.com/global/images/93x93/" & tempCode & ".png"

                      Where tempCode is the values specified for the "code" under the "conditions" block.


                      EDIT:
                      Didn't even realize you had a separate sub for getting more icons. I'll take a look into that part of it today. I looked at weather.com, but couldn't find a way to look up their codes (like UKXX1090) without a dev key.
                      Last edited by ClockWorK; 09-17-2012, 06:55 AM.

                      Comment


                      • #12
                        Weather works perfect! I just need a way to show C instead of F. SNO

                        Comment


                        • #13
                          cdrskull,

                          I think I just found a better way to get the icons for the other days of the forecast.

                          http://developer.yahoo.com/weather/#codes

                          Turns out, the descriptions are constant (even across weather services), and they are mapped to codes on the site above.

                          Comment


                          • #14
                            Originally posted by ClockWorK View Post
                            cdrskull,

                            I think I just found a better way to get the icons for the other days of the forecast.

                            http://developer.yahoo.com/weather/#codes

                            Turns out, the descriptions are constant (even across weather services), and they are mapped to codes on the site above.
                            I tried this first but the condition's I was getting didn't match. They had AM and PM in and Rainy and a few others that just didn't match up :-( I even typed them all out only to find this after :-(


                            Code:
                             Function grabicon(ByVal condition As String) As String
                                    condition = "http://l.yimg.com/a/i/us/we/52/"
                                    Select Case condition
                            
                                        Case "tornado"
                                            condition += "0.gif"
                                        Case "tropical storm"
                                            condition += "1.gif"
                                        Case "hurricane"
                                            condition += "2.gif"
                                        Case "severe thunderstorms"
                                            condition += "3.gif"
                                        Case "thunderstorms"
                                            condition += "4.gif"
                                        Case "mixed rain and snow"
                                            condition += "5.gif"
                                        Case "mixed rain and sleet"
                                            condition += "6.gif"
                                        Case "mixed snow and sleet"
                                            condition += "7.gif"
                                        Case "freezing drizzle"
                                            condition += "8.gif"
                                        Case "drizzle"
                                            condition += "9.gif"
                                        Case "freezing rain"
                                            condition += "10.gif"
                                        Case "showers"
                                            condition += "11.gif"
                                        Case "showers"
                                            condition += "12.gif"
                                        Case "snow flurries"
                                            condition += "13.gif"
                                        Case "light snow showers"
                                            condition += "14.gif"
                                        Case "blowing snow"
                                            condition += "15.gif"
                                        Case "snow"
                                            condition += "16.gif"
                                        Case "hail"
                                            condition += "17.gif"
                                        Case "sleet"
                                            condition += "18.gif"
                                        Case "dust"
                                            condition += "19.gif"
                                        Case "foggy"
                                            condition += "20.gif"
                                        Case "haze"
                                            condition += "21.gif"
                                        Case "smoky"
                                            condition += "22.gif"
                                        Case "blustery"
                                            condition += "23.gif"
                                        Case "windy"
                                            condition += "24.gif"
                                        Case "cold"
                                            condition += "25.gif"
                                        Case "cloudy"
                                            condition += "26.gif"
                                        Case "mostly cloudy night"
                                            condition += "27.gif"
                                        Case "mostly cloudy day"
                                            condition += "28.gif"
                                        Case "partly cloudy night"
                                            condition += "29.gif"
                                        Case "partly cloudy day"
                                            condition += "30.gif"
                                        Case "clear night"
                                            condition += "31.gif"
                                        Case "sunny"
                                            condition += "32.gif"
                                        Case "fair night"
                                            condition += "33.gif"
                                        Case "fair day"
                                            condition += "34.gif"
                                        Case "mixed rain And hail"
                                            condition += "35.gif"
                                        Case "hot"
                                            condition += "36.gif"
                                        Case "isolated thunderstorms"
                                            condition += "37.gif"
                                        Case "scattered thunderstorms"
                                            condition += "38.gif"
                                        Case "scattered thunderstorms"
                                            condition += "39.gif"
                                        Case "scattered showers"
                                            condition += "40.gif"
                                        Case "heavy snow"
                                            condition += "41.gif"
                                        Case "scattered snow showers"
                                            condition += "42.gif"
                                        Case "heavy snow"
                                            condition += "43.gif"
                                        Case "partly cloudy"
                                            condition += "44.gif"
                                        Case "thundershowers"
                                            condition += "45.gif"
                                        Case "snow showers"
                                            condition += "46.gif"
                                        Case "isolated thundershowers"
                                            condition += "47.gif"
                                        Case Else
                                            condition += "3200"
                                    End Select
                                    Return condition
                                End Function
                            I changes some of the titles so they will need changing back but it might save you 10 mins .. lol This is why I then went out to weather.com wap site and stripped the icon links
                            Follow me on Twitter

                            http://www.FreeICE.co.uk

                            Comment


                            • #15
                              Yeah, I noticed the same thing after I posted and started looking into it. I think I'll try building (adding to) the description table, and maybe getting the icon from
                              "http://l.yimg.com/os/mit/media/m/weather/images/icons/l/" & tempCode & "d-100567.png" instead.

                              Comment

                              Working...
                              X