WXforum.net
Weather Station Hardware => Weather Web Cams => Bloomsky Sky Camera+sensors => Topic started by: weathergirl on May 15, 2016, 05:13:26 PM
-
The BloomSky scripts for displaying images are wonderful but I wondered if they could be made to only display the latest image and timelapse movie, with no weather data at all, is this possible?
-
Hi,
yes, you are not the first person asking this and I have created a script for this, see:
http://www.wxforum.net/index.php?topic=28883.0
-
Thanks Jáchym: Does your script display the Bloom Sky timelapse movie as well?
-
No it doesn't, that guy only asked for the latest image, but I guess it should not be a problem to add the video as well, I have that feature in the plugin I made for my template so I have worked with the BS videos in the past.
-
If you would add the timelapse movie to your script as well, that would be awesome.
-
OK I will try tomorrow, it is a bit too late now for this, but I will let you know how it goes and I think it should work.
Just to make it absolutely clear, what you are after is a script that will show the latest image and video right?
-
Yes, Jáchym, that is what I want, thank-you. The images could be on one page, or a page for each image, it's up you.
-
Hello,
There is also this script that Wim created. It has both image and lastest timelapse.
http://www.wxforum.net/index.php?topic=28820.0
(http://www.wxforum.net/index.php?action=dlattach;topic=28820.0;attach=21126;image)
http://dhweather.net/ws_bloomsky
-
Tom she wanted no weather data, also, I noticed none of your videos work, is that a problem with your BS?
-
OK, here is the code to use.
All you need to do is specify your Bloomsky API key at the top.
For some reason the videos do not work, however I checked other users´s sites, even ones using Wim´s script and the videos do not work... so I suspect this is some temporary problem with the BS Api, the links are ok, but when you click the link, the video doesn´t load.
I made the HTML the simplest possible, so that you can see how to use it and simply insert the code for the IMG and video into your existing code the way you like it.
<?php
$APIkey = "";
$url = "https://api.bloomsky.com/api/skydata";
$opts = array(
'http'=>array(
'method'=>"GET",
'header'=>"Authorization: ".$APIkey."\r\n"
)
);
$context = stream_context_create($opts);
$file = file_get_contents($url, false, $context);
$data = json_decode($file, true);
$imageURL = $data[0]['Data']['ImageURL'];
$video = $data[0]['VideoList'][0];
?>
<html>
<body>
<h1>Image</h1>
<img src="<?php echo $imageURL?>">
<h1>Video</h1>
<video style="width: 70%;margin:0 auto" controls>
<source src="<?php echo $video?>" type="video/mp4">
Your browser does not support the video tag.
</video>
</body>
</html>
-
Thanks very much, Jáchym.
-
Tom she wanted no weather data, also, I noticed none of your videos work, is that a problem with your BS?
The only way to get video's without the weather data is to do what WU does, captures each image and then creates a video stream/file. Technically with your BS plugin for Meteotemplate it wouldn't be hard to create a stream from the daily images that are saved. This might be what she and others are actually looking for.
And yes my Bloomsky working fine must be a temporary system problem.
-
Your script is displaying the BloomSky static and video images nicely, Jáchym, however, the video image is from five days ago, any reason for this? I checked my data portal and the video from yesterday is there.
-
Aha, I see... sorry I dont have BS myself so it is a bit difficult.
The images are probably sorted the other way around.
in that case try changing this line:
$video = $data[0]['VideoList'][0];
to this:
$countVideos = count($data[0]['VideoList'])-1;
$video = $data[0]['VideoList'][$countVideos];
-
That's perfect! Thanks, Jáchym! One more thing. The video image is displaying the temperature in Fahrenheit. Can it be changed in the script to display the temperature in Celsius?
-
No, as far as I know the temperature is embedded in the actual video, it is part of the actual video image, so there is no way you can remove it.
-
That's too bad. I thought I saw a Bloomsky video image using Celsius, but that may have been in another script, oh well.
-
I doubt that because it has nothing to do with the script. And since it is embedded in the video file there is no way any script can remove it.
-
There is a way to specify Celsius or "International" units per discussion here: http://weatherlution.com/bloomsky-api/ (http://weatherlution.com/bloomsky-api/)
2/2/16 API Update:
1. The endpoint /api/skydata/ can take an argument now: ‘unit=intl’, which will transfer all the imperial units to international units. If no argument is given, the units default to imperial ones.
2. As a result, we no longer provide both units in one response, so the key ‘Temperature_f’ is gone. Please make sure to change your program accordingly, otherwise you may get a key error.
3. The time-lapse videos are also in either Fahrenheit or Celsius, according to the request argument, so you don’t need to modify the video URLs if you did before.
-
Thought I'd ask, but know this question hasn't been updated for a while. Is anyone else finding that the Bloomsky app is updating its image, but the helpful script above isn't updating the image? Not sure what is going on, other than Bloomsky switching off their facilities having ceased trading.