Author Topic: Displaying BloomSky images only  (Read 1664 times)

0 Members and 1 Guest are viewing this topic.

Offline weathergirl

  • Forecaster
  • *****
  • Posts: 674
    • Beamsville Weather Station
Displaying BloomSky images only
« 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?
Ann-Marie
Beamsville, Ontario, Canada

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8572
    • Meteotemplate
Re: Displaying BloomSky images only
« Reply #1 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

Offline weathergirl

  • Forecaster
  • *****
  • Posts: 674
    • Beamsville Weather Station
Re: Displaying BloomSky images only
« Reply #2 on: May 15, 2016, 06:33:46 PM »
Thanks Jáchym: Does your script display the Bloom Sky timelapse movie as well?
Ann-Marie
Beamsville, Ontario, Canada

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8572
    • Meteotemplate
Re: Displaying BloomSky images only
« Reply #3 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.

Offline weathergirl

  • Forecaster
  • *****
  • Posts: 674
    • Beamsville Weather Station
Re: Displaying BloomSky images only
« Reply #4 on: May 15, 2016, 07:15:00 PM »
If you would add the timelapse movie to your script as well, that would be awesome.
Ann-Marie
Beamsville, Ontario, Canada

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8572
    • Meteotemplate
Re: Displaying BloomSky images only
« Reply #5 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?

Offline weathergirl

  • Forecaster
  • *****
  • Posts: 674
    • Beamsville Weather Station
Re: Displaying BloomSky images only
« Reply #6 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.
Ann-Marie
Beamsville, Ontario, Canada

Offline SpringHillWeather

  • Weather Hobbyist
  • Forecaster
  • *****
  • Posts: 533
  • Spring Hill, Florida
    • Spring Hill
Re: Displaying BloomSky images only
« Reply #7 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://dhweather.net/ws_bloomsky
« Last Edit: May 15, 2016, 10:55:19 PM by StatenIslandWeather »
Saratoga
HomeWeatherStation
Meteotemplate
Homebrew
Ambient 1001 | ObserverIP | Meteobridge | MeteoPlug

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8572
    • Meteotemplate
Re: Displaying BloomSky images only
« Reply #8 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?

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8572
    • Meteotemplate
Re: Displaying BloomSky images only
« Reply #9 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>

Offline weathergirl

  • Forecaster
  • *****
  • Posts: 674
    • Beamsville Weather Station
Re: Displaying BloomSky images only
« Reply #10 on: May 16, 2016, 06:00:20 AM »
Thanks very much, Jáchym.
Ann-Marie
Beamsville, Ontario, Canada

Offline SpringHillWeather

  • Weather Hobbyist
  • Forecaster
  • *****
  • Posts: 533
  • Spring Hill, Florida
    • Spring Hill
Re: Displaying BloomSky images only
« Reply #11 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.

Saratoga
HomeWeatherStation
Meteotemplate
Homebrew
Ambient 1001 | ObserverIP | Meteobridge | MeteoPlug

Offline weathergirl

  • Forecaster
  • *****
  • Posts: 674
    • Beamsville Weather Station
Re: Displaying BloomSky images only
« Reply #12 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.
Ann-Marie
Beamsville, Ontario, Canada

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8572
    • Meteotemplate
Re: Displaying BloomSky images only
« Reply #13 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];

Offline weathergirl

  • Forecaster
  • *****
  • Posts: 674
    • Beamsville Weather Station
Re: Displaying BloomSky images only
« Reply #14 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?
Ann-Marie
Beamsville, Ontario, Canada

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8572
    • Meteotemplate
Re: Displaying BloomSky images only
« Reply #15 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.

Offline weathergirl

  • Forecaster
  • *****
  • Posts: 674
    • Beamsville Weather Station
Re: Displaying BloomSky images only
« Reply #16 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.
« Last Edit: May 21, 2016, 10:28:57 PM by weathergirl »
Ann-Marie
Beamsville, Ontario, Canada

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8572
    • Meteotemplate
Re: Displaying BloomSky images only
« Reply #17 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.

Offline RainmanWeather

  • Contributor
  • ***
  • Posts: 137
    • RainmanWeather
Re: Displaying BloomSky images only
« Reply #18 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/


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.



 

anything