Weather

Thread Starter

Eric007

Joined Aug 5, 2011
1,158
Hi All,

I did some google research but could not find much/enough info maybe my google search skill is not that good.
Anyway what I am trying to achieve is to fetch/download/get the *image* or *wallpaper*, whatever the name is, of the current weather condition for a city.

We all have either android or iPhone phone and there's a weather app. As you know the background image changes depending on the current weather condition.

Maybe I would need to construct a url with the required data in order to request for that image...I need some help on that... like to connect to an api that return this kind of data that I can use.

Hope the above is clear enough

Many Thanks
Eric
 

Thread Starter

Eric007

Joined Aug 5, 2011
1,158
Note I am not asking for any code but you know an api that can return this kind of data (json, xml, or...) that I can use to make a request for the 'current weather condition' image.
 

spinnaker

Joined Oct 29, 2009
7,830
Weather Underground, Open Weather Map and yahoo all have their own APIs. Yahoo is used by a kodi app and seems to work really well.


Here is a link for Yahoo Weather API.

https://developer.yahoo.com/weather/


Learning to google isn't that hard. Can't see how you are going to get anywhere with a project of this magnitude without some basic searching skills.
 

Thread Starter

Eric007

Joined Aug 5, 2011
1,158
@spinnaker Like I said I don't need any code from anyone! my app works 100% fine, I can even send you an .apk file to see for yourself BUT all I need now is to have the background changing!!! There is no where this is discussed or something.
Btw, I have used open weather map api.
 

spinnaker

Joined Oct 29, 2009
7,830
@spinnaker Like I said I don't need any code from anyone! my app works 100% fine, I can even send you an .apk file to see for yourself BUT all I need now is to have the background changing!!! There is no where this is discussed or something.
Btw, I have used open weather map api.

Most of the weather api have an image in the object that is returned with all of the weather information. Those images are online. You just need to first see if your api returns that information then check the Android API to see how to display an image.
 

Thread Starter

Eric007

Joined Aug 5, 2011
1,158
Most of the weather api have an image in the object that is returned with all of the weather information. Those images are online. You just need to first see if your api returns that information then check the Android API to see how to display an image.
YES!!! That's exactly that! Now what I need help with is finding that api that returns an object containing the information about those online background images.

Like I said I used open weather map api and I don't see such info. I only see the info about the 'icon' which is different from the 'image'. I also used the 'icon' on my app but now I need to add the background 'image'

Below is an example of such returned object:

Code:
{"coord":{"lon":139,"lat":35},
"sys":{"country":"JP","sunrise":1369769524,"sunset":1369821049},
"weather":[{"id":804,"main":"clouds","description":"overcast clouds","icon":"04n"}],
"main":{"temp":289.5,"humidity":89,"pressure":1013,"temp_min":287.04,"temp_max":292.04},
"wind":{"speed":7.31,"deg":187.002},
"rain":{"3h":0},
"clouds":{"all":92},
"dt":1369824698,
"id":1851632,
"name":"Shuzenji",
"cod":200}
In the above, I don't see any info about the image unless someone tells the combination of some of the elements will help retrieve the image.
I don't see much here https://openweathermap.org/current as well.

Thanks
Eric
 

Thread Starter

Eric007

Joined Aug 5, 2011
1,158
Believe me guys my google search skills is not that poor! I carefully looked at the weather app on my iPhone and saw "The Weather Channel" on the bottom left corner.
I did some google and found the corresponding api which is this https://www.wunderground.com/weather/api/d/docs (if I am correct) I then analyzed the example of the json response but still can't find any data related to the background image, there's only for the icon!

It's ok I give up! :)

Thanks all!
 

spinnaker

Joined Oct 29, 2009
7,830
Believe me guys my google search skills is not that poor! I carefully looked at the weather app on my iPhone and saw "The Weather Channel" on the bottom left corner.


Thanks all!
But your skills are "not that good" either. :)

Hi All,

I did some google research but could not find much/enough info maybe my google search skill is not that good.

Eric

Did you see this page?

http://openweathermap.org/weather-conditions

Looks pretty simple to me. So you get your weather condition id. Say it is 501 or moderate rain. Your icon will be 10d.png.

You assemble the URL and get the image.

http://openweathermap.org/img/w/10d.png

Seems pretty straight forward to me. The only issue is it appears you will need to maintain your own translation table.

Took be longer to type this message than it did to find the documentation and figure it all out.


P.S. Not sure what id 1851632 is in your example. Are you using Open Weather?
 

Thread Starter

Eric007

Joined Aug 5, 2011
1,158
But your skills are "not that good" either. :)




Did you see this page?

http://openweathermap.org/weather-conditions

Looks pretty simple to me. So you get your weather condition id. Say it is 501 or moderate rain. Your icon will be 10d.png.

You assemble the URL and get the image.

http://openweathermap.org/img/w/10d.png

Seems pretty straight forward to me. The only issue is it appears you will need to maintain your own translation table.

Took be longer to type this message than it did to find the documentation and figure it all out.


P.S. Not sure what id 1851632 is in your example. Are you using Open Weather?
pffffff my friend this http://openweathermap.org/img/w/10d.png is NOT the background image it's the ICON!!! and I said it several times that this is NOT what I need!!!
Prove to me that your google skills is better than mine! I will post a screenshot of my current app and you will see the icon but the background is white. Do I have to post what a 'weather condition' background image looks like for you to understand? just open the weather app on your iPhone/android and you will see that! It takes up the whole screen!
 
Last edited:

Thread Starter

Eric007

Joined Aug 5, 2011
1,158
Again @spinnaker your previous post is useless!!! yes I used open weather map as I mentioned in a previous post!

Please prove to me that you have a better google search skill and no disrespect BUT I must say that your understanding skill is not that good.
 

spinnaker

Joined Oct 29, 2009
7,830
Again @spinnaker your previous post is useless!!! yes I used open weather map as I mentioned in a previous post!

Please prove to me that you have a better google search skill and no disrespect BUT I must say that your understanding skill is not that good.

What is useless is your explanation of your issue. I am done.
 
Top