WXforum.net

Weather Station Hardware => Weather Web Cams => Bloomsky Sky Camera+sensors => Topic started by: weathergirl on May 15, 2016, 05:13:26 PM

Title: Displaying BloomSky images only
Post 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?
Title: Re: Displaying BloomSky images only
Post by: Jáchym on May 15, 2016, 05:34:34 PM
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
Title: Re: Displaying BloomSky images only
Post by: weathergirl on May 15, 2016, 06:33:46 PM
Thanks Jáchym: Does your script display the Bloom Sky timelapse movie as well?
Title: Re: Displaying BloomSky images only
Post by: Jáchym on May 15, 2016, 06:48:54 PM
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.
Title: Re: Displaying BloomSky images only
Post by: weathergirl on May 15, 2016, 07:15:00 PM
If you would add the timelapse movie to your script as well, that would be awesome.
Title: Re: Displaying BloomSky images only
Post by: Jáchym on May 15, 2016, 07:26:23 PM
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?
Title: Re: Displaying BloomSky images only
Post by: weathergirl on May 15, 2016, 07:40:02 PM
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.
Title: Re: Displaying BloomSky images only
Post by: SpringHillWeather on May 15, 2016, 10:50:56 PM
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
Title: Re: Displaying BloomSky images only
Post by: Jáchym on May 16, 2016, 05:04:12 AM
Tom she wanted no weather data, also, I noticed none of your videos work, is that a problem with your BS?
Title: Re: Displaying BloomSky images only
Post by: Jáchym on May 16, 2016, 05:43:46 AM
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.

Code: [Select]
<?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($urlfalse$context);

$data json_decode($filetrue);

$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>
Title: Re: Displaying BloomSky images only
Post by: weathergirl on May 16, 2016, 06:00:20 AM
Thanks very much, Jáchym.
Title: Re: Displaying BloomSky images only
Post by: SpringHillWeather on May 16, 2016, 11:42:09 AM
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.

Title: Re: Displaying BloomSky images only
Post by: weathergirl on May 21, 2016, 01:07:01 PM
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.
Title: Re: Displaying BloomSky images only
Post by: Jáchym on May 21, 2016, 01:09:39 PM
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:

Code: [Select]
$video = $data[0]['VideoList'][0];
to this:
Code: [Select]
$countVideos = count($data[0]['VideoList'])-1;
$video = $data[0]['VideoList'][$countVideos];
Title: Re: Displaying BloomSky images only
Post by: weathergirl on May 21, 2016, 01:17:07 PM
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?
Title: Re: Displaying BloomSky images only
Post by: Jáchym on May 21, 2016, 01:25:36 PM
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.
Title: Re: Displaying BloomSky images only
Post by: weathergirl on May 21, 2016, 01:41:15 PM
That's too bad. I thought I saw a Bloomsky video image using Celsius, but that may have been in another script, oh well.
Title: Re: Displaying BloomSky images only
Post by: Jáchym on May 21, 2016, 05:43:52 PM
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.
Title: Re: Displaying BloomSky images only
Post by: RainmanWeather on May 31, 2016, 09:48:43 AM
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.


Title: Re: Displaying BloomSky images only
Post by: DeepdaleFarm on June 13, 2022, 10:19:25 AM
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.