Weather Station Hardware > Bloomsky Sky Camera+sensors
PHP script - Get the latest BloomSky image
Jáchym:
Hi guys,
I have seen several people already asking about how to get the latest BloomSky image. Since it is a dynamic URL it is not as easy, so I created a little script which will do it for you.
Instructions:
1. Download the attached PHP file
2. Open the file in a text editor and insert your API key - if you don't have one, you need to get one for free from the official BloomSky developer's site
3. Upload the file anywhere on your server
4. For the image source on your page, use this php file.
eg:
<img src="...../bloomSkyLatest.php">
It should work, but since I cannot test properly because I dont have the camera, I would appreciate if someone could confirm it.
Enjoy
Bob3rd:
I see two zipped PHP files with the same name. For some reason I am unable to download either of them even though I am logged in to the forum. Perhaps it is a forum issue. .....(update)...now it works. Thanks. I am going to tinker with it a bit now.
PaulMy:
Funny, just last night I looked if I could do something like that - but I couldn't :oops:
Have downloaded the zip (I think the latest when only one was showing) and get this http://www.komokaweather.com/bloomsky/bloomSkyLatest.php
Did I miss something
Paul
Jáchym:
I checked the link Paul and I see an image of your snowy street, so I dont see any problems with it
PaulMy:
Hmm, with that link I get
--- Quote ---<br /> <b>Warning</b>: file_get_contents(https://api.bloomsky.com/api/skydata): failed to open stream: HTTP request failed! HTTP/1.0 401 Unauthorized in <b>/home/content/96/5379896/html/bloomsky/bloomSkyLatest.php</b> on line <b>22</b><br /> <br /> <b>Warning</b>: file_get_contents(): Filename cannot be empty in <b>/home/content/96/5379896/html/bloomsky/bloomSkyLatest.php</b> on line <b>28</b><br />
--- End quote ---
At least you know the script is correct. Now to find what is different for me ](*,)
Regards,
Paul
Navigation
[0] Message Index
[#] Next page
Go to full version