Bloomsky Latest Image
- Johnny
- Developer
- Posts: 313
- Joined: Sat Aug 19, 2017 10:16 pm
- Location: Watford, Hertfordshire, England
- Station model: Davis Vantage Pro2 Plus
- Software: Meteobridge
- Contact:
Bloomsky Latest Image
If you'd like to add the latest picture from your Bloomsky camera to your home page please read on.
I wanted to display the latest still image from my Bloomsky to my home page and found an old thread on the WX forum by Jachym on doing something like this, so I thought it would be nice to let you know how I managed to do it.
First off go to this link https://www.wxforum.net/index.php?topic=28883.0
1. In the very first post by Jáchym you will see a link to download the php script file he wrote called bloomSkyLatest.php.zip You need to download this file and then unzip it.
2. Next you need to know your Bloomsky API key, if you don't have one go to this link and sign in
https://dashboard.bloomsky.com/
Once you've signed in go to the left column and click on the word 'Developers' a pop up will appear and show you your API key, hi-light it and copy it.
3. Now go back to your bloomSkyLatest.php file that you unzipped and right click on it and choose to open it with Notepad, (if Notepad doesn't show, drop down to 'Choose Another App' and then select Notepad)
Now look for this line in the code:
$APIkey = ""; // your API key
You need to paste in the API code you copied to your clipboard, this needs to go inbetween the quotation marks, example: $APIkey = "123456789ABCDEFG"; // your API key
Now go to file and choose 'Save'
Next using your ftp upload software you need to copy the file you just altered bloomSkyLatest.php and place it on your website, I personally placed it in the root along with all the other meteotemplate php files
4. Having got this far you now deserve a cup of tea and a chocolate biscuit
5. Next you need to download the 'webcam' block, so go to
http://www.meteotemplate.com/web/blocks.php
and scroll right to the bottom of the blocks and look for the 'webcam' block. Click on it and then select 'Download' now unzip the block and add it like you would any other block to your Homepage/Blocks section.
6. Now go to the homepage of your Meteotemplate website and sign in, click on 'Block Setup' then look for the webcam block you just installed (should be at the bottom somewhere) click on the 'Settings' button to the right.
In the first field you need to enter the URL of where you just placed the bloomSkyLatest.php file. I entered:
http://www.watfordweather.co.uk/bloomSkyLatest.php
If you've placed it elsewhere then alter the location accordingly. Needless to say enter the URL of your own site (not mine please).
The next field is the title you'd like to give your camera source, in my case 'The Sky in Watford'
The next field are your camera's geographical co-ordinates, if you don't know these you can find them using Google Maps.
The next field is the duration between picture updates, in my case they are every five minutes, so I changed this to 300 seconds. Saying that, you might want to consider the fact that if someone comes to your page and seconds later your Bloomsky has generated a new image, they're not going to see it for a further five minutes, so you might want to consider reducing this duration down.
The next field is the tranparency of the image, I personally chose 'False'
The next field is the tiny globe icon, which when clicked on shows a Google Map of your camera's location.
Now click 'Save' at the bottom
7. We're nearly there, (put the Champagne in the ice bucket) Go to your site's Control Panel and from the 'Homepage' box select Setup for Desktop and add the text 'webcam' in whatever postion you desire (as you would for any other block). In my case I wanted it to take up 25% of room on the left with a different block taking 75% room on the right, so I have this:
multipleBlock(webcam,25;interactiveGraph,75)
Then click 'Save' at the bottom and review your home page, all being well you should now see an image from your Bloomsky on your Homepage, if it works you can now have a glass of Champagne and some petit fours, or maybe like me a cup of tea and a jam and peanut butter sandwich.
If it doesn't work then open a window and scream "I'm not going to take this any longer"
Hope it works for you - John
I wanted to display the latest still image from my Bloomsky to my home page and found an old thread on the WX forum by Jachym on doing something like this, so I thought it would be nice to let you know how I managed to do it.
First off go to this link https://www.wxforum.net/index.php?topic=28883.0
1. In the very first post by Jáchym you will see a link to download the php script file he wrote called bloomSkyLatest.php.zip You need to download this file and then unzip it.
2. Next you need to know your Bloomsky API key, if you don't have one go to this link and sign in
https://dashboard.bloomsky.com/
Once you've signed in go to the left column and click on the word 'Developers' a pop up will appear and show you your API key, hi-light it and copy it.
3. Now go back to your bloomSkyLatest.php file that you unzipped and right click on it and choose to open it with Notepad, (if Notepad doesn't show, drop down to 'Choose Another App' and then select Notepad)
Now look for this line in the code:
$APIkey = ""; // your API key
You need to paste in the API code you copied to your clipboard, this needs to go inbetween the quotation marks, example: $APIkey = "123456789ABCDEFG"; // your API key
Now go to file and choose 'Save'
Next using your ftp upload software you need to copy the file you just altered bloomSkyLatest.php and place it on your website, I personally placed it in the root along with all the other meteotemplate php files
4. Having got this far you now deserve a cup of tea and a chocolate biscuit
5. Next you need to download the 'webcam' block, so go to
http://www.meteotemplate.com/web/blocks.php
and scroll right to the bottom of the blocks and look for the 'webcam' block. Click on it and then select 'Download' now unzip the block and add it like you would any other block to your Homepage/Blocks section.
6. Now go to the homepage of your Meteotemplate website and sign in, click on 'Block Setup' then look for the webcam block you just installed (should be at the bottom somewhere) click on the 'Settings' button to the right.
In the first field you need to enter the URL of where you just placed the bloomSkyLatest.php file. I entered:
http://www.watfordweather.co.uk/bloomSkyLatest.php
If you've placed it elsewhere then alter the location accordingly. Needless to say enter the URL of your own site (not mine please).
The next field is the title you'd like to give your camera source, in my case 'The Sky in Watford'
The next field are your camera's geographical co-ordinates, if you don't know these you can find them using Google Maps.
The next field is the duration between picture updates, in my case they are every five minutes, so I changed this to 300 seconds. Saying that, you might want to consider the fact that if someone comes to your page and seconds later your Bloomsky has generated a new image, they're not going to see it for a further five minutes, so you might want to consider reducing this duration down.
The next field is the tranparency of the image, I personally chose 'False'
The next field is the tiny globe icon, which when clicked on shows a Google Map of your camera's location.
Now click 'Save' at the bottom
7. We're nearly there, (put the Champagne in the ice bucket) Go to your site's Control Panel and from the 'Homepage' box select Setup for Desktop and add the text 'webcam' in whatever postion you desire (as you would for any other block). In my case I wanted it to take up 25% of room on the left with a different block taking 75% room on the right, so I have this:
multipleBlock(webcam,25;interactiveGraph,75)
Then click 'Save' at the bottom and review your home page, all being well you should now see an image from your Bloomsky on your Homepage, if it works you can now have a glass of Champagne and some petit fours, or maybe like me a cup of tea and a jam and peanut butter sandwich.
If it doesn't work then open a window and scream "I'm not going to take this any longer"
Hope it works for you - John
Last edited by Johnny on Mon Oct 02, 2017 7:12 pm, edited 2 times in total.
- Jachym
- Site Admin
- Posts: 1686
- Joined: Fri Aug 18, 2017 10:12 pm
- Location: Brno, Czech Republic
- Station model: WH1080
- Software: Meteobridge
- Contact:
Re: Bloomsky Latest Image
Thanks John for sharing, in fact I completely forgot about that script
Re: Bloomsky Latest Image
Thanks
- Fraggboy
- Forecaster
- Posts: 193
- Joined: Wed Sep 27, 2017 2:45 pm
- Location: Sunny California
- Station model: Bloomsky II + Storm
- Software: Bloomsky
- Contact:
Re: Bloomsky Latest Image
I navigated to the link above and didn't see the script. I came across this script on the Bloomsky forum that does the same thing. The full script would download the image and then upload it to WU for you. I just removed the upload portion of the script. I love that it over-writes image.jpg so it doesn't fill up with multiple images.
I created a folder named staticimage and run the script from there. I then point the webcam URL to this location..
Code: Select all
<?php
header('Content-Type: application/json');
$api = "**ENTER YOUR API KEY HERE**";
$url = "http://api.bloomsky.com/api/skydata/?unit=intl";
$opts = array('http'=>array('method'=>"GET",'header'=>"Authorization: ".$api."\r\n"));
$context = stream_context_create($opts);
$file = file_get_contents($url, false, $context);
$array = json_decode($file, true);
$url = $array['0']['Data']['ImageURL'];
$img = 'image.jpg';
file_put_contents($img, file_get_contents($url));
?>
- Johnny
- Developer
- Posts: 313
- Joined: Sat Aug 19, 2017 10:16 pm
- Location: Watford, Hertfordshire, England
- Station model: Davis Vantage Pro2 Plus
- Software: Meteobridge
- Contact:
Re: Bloomsky Latest Image
Hi Fraggboy, just placed an image above (first post) showing the link.
- Johnny
- Developer
- Posts: 313
- Joined: Sat Aug 19, 2017 10:16 pm
- Location: Watford, Hertfordshire, England
- Station model: Davis Vantage Pro2 Plus
- Software: Meteobridge
- Contact:
Re: Bloomsky Latest Image
Fraggboy,
My apologies - I thought that link could be seen by anyone. I don't know if this will work, but I'll post the full link here (assuming it's allowed)
https://www.wxforum.net/index.php?actio ... tach=21270
John
My apologies - I thought that link could be seen by anyone. I don't know if this will work, but I'll post the full link here (assuming it's allowed)
https://www.wxforum.net/index.php?actio ... tach=21270
John
- Fraggboy
- Forecaster
- Posts: 193
- Joined: Wed Sep 27, 2017 2:45 pm
- Location: Sunny California
- Station model: Bloomsky II + Storm
- Software: Bloomsky
- Contact:
Re: Bloomsky Latest Image
Johnny,
Thank you. When I click on the link, it asks for me to sign in. It's OK. The script I shared above works just as good. What you could do is download it, and attach it to this thread so anyone can download it here.
Thank you. When I click on the link, it asks for me to sign in. It's OK. The script I shared above works just as good. What you could do is download it, and attach it to this thread so anyone can download it here.
- Johnny
- Developer
- Posts: 313
- Joined: Sat Aug 19, 2017 10:16 pm
- Location: Watford, Hertfordshire, England
- Station model: Davis Vantage Pro2 Plus
- Software: Meteobridge
- Contact:
Re: Bloomsky Latest Image
Okay, let's give it a try:
Hope it works
Hope it works
- Fraggboy
- Forecaster
- Posts: 193
- Joined: Wed Sep 27, 2017 2:45 pm
- Location: Sunny California
- Station model: Bloomsky II + Storm
- Software: Bloomsky
- Contact:
Re: Bloomsky Latest Image
I downloaded and checked it out. There are some differences, but both work.