Author Topic: What widget(s) are avalible that I can display the info from PWS on my website  (Read 4437 times)

0 Members and 1 Guest are viewing this topic.

Offline WraxallDave

  • Senior Member
  • **
  • Posts: 65
Hi John

I have written simple scripts to get API data and read JSON data (I use the NASA API), but I am not an expert and I hope you can find a real expert on here.

Dave.

ps: I have been to Oceanside on the train from San Diego.

Offline johnzapf

  • Member
  • *
  • Posts: 43
    • live hummingbird Camera
Ya, I hope to find a little help also.

so you were here? back when we could travel  ;)
PWS NAME: Ocean Breeze Valley, Oceanside

Offline johnzapf

  • Member
  • *
  • Posts: 43
    • live hummingbird Camera
PWS NAME: Ocean Breeze Valley, Oceanside

Offline WraxallDave

  • Senior Member
  • **
  • Posts: 65

Hi John,

I use templates from people sharing them here, my main page is:

https://www.wraxallweather.co.uk/wxindex.php  the Saratoga World Template

The one you visited is an old one, and is by Wim in the Netherlands.

I have a book on JSON it is two inches thick.

Dave.

Offline johnzapf

  • Member
  • *
  • Posts: 43
    • live hummingbird Camera
looks good.

I like the Personal Weather Station Dashboard, looking at that now.

Ya, I have been doing IT for 30 years and I still cant code.

PWS NAME: Ocean Breeze Valley, Oceanside

Offline johnzapf

  • Member
  • *
  • Posts: 43
    • live hummingbird Camera
I see you have a couple cameras.

I have a live AXIS on the hummingbird nest outback, its in between babies right now. I have been trying to get an FTP image from that to WU but that not going so well either.

http://www.artisticimages.com/categories/live-hummingbird-cam
PWS NAME: Ocean Breeze Valley, Oceanside

Offline johnzapf

  • Member
  • *
  • Posts: 43
    • live hummingbird Camera
do you know how I find this code for the PWS setup.

Europe: code for your area, example BE004
Canada: Download this list. Use an editor find your area.
Example: s0000047 is the code for Calgary
PWS NAME: Ocean Breeze Valley, Oceanside

Offline Bunty

  • Forecaster
  • *****
  • Posts: 2432
  • Stillwater, home of Oklahoma State University
    • Welcome to Stillwater Weather
Near the top, ./demodata/clientraw.txt isn't the correct file, assuming your software puts out a realtime file.  When you find out the correct file, don't include demodata with it. And include two dots at the start as in the example.
« Last Edit: May 31, 2020, 02:40:54 PM by Bunty »

Also the 2nd home page using modified AltDashboard 6.95 at http://stillwaterweather.com/2ndhome.php

Offline johnzapf

  • Member
  • *
  • Posts: 43
    • live hummingbird Camera
Thanks Bunty, I added ../clientraw.txt
PWS NAME: Ocean Breeze Valley, Oceanside

Offline WraxallDave

  • Senior Member
  • **
  • Posts: 65
Hi John,

Well done on getting the PWS station template working.

http://www.artisticimages.com/pwswd/index.php

The link to support from Wim is on that page. Select Menu in the top left corner and go down to the support link.

The Anole wxgraphics script I told you about runs off a clientraw.txt file, so if you have that with your data in, you are all set to create your own widget using the clientraw.txt data.

I expect Anole's script can be modified for realtime.txt instead of clientraw.txt.

All the best,
 =D>
Dave.
« Last Edit: May 31, 2020, 05:08:56 PM by WraxallDave »

Offline johnzapf

  • Member
  • *
  • Posts: 43
    • live hummingbird Camera
all set, I got it all working. it was user error.

http://www.artisticimages.com/styles/styles-background/pws

as far as the raw data, NO, I don't have access to it, only API's I have noting running here its all goes direct from the weather station.





« Last Edit: May 31, 2020, 08:51:10 PM by johnzapf »
PWS NAME: Ocean Breeze Valley, Oceanside

Offline WraxallDave

  • Senior Member
  • **
  • Posts: 65
Hi John,

All of this highlights the fact that passing your data directly to someone else, limits what you can do in the way of displaying your data.

Wim's script accesses the API and calls your data back from Weather Underground into a text file that is read by the PWS template.

How Wim does the curl fetch of the API is in the file "XXX_load_files.php"    where XXX is the template name PWS or w34

If you would like to replicate the WIM API fetch code to get your data to drive something like what Anole did, then you need to post your request to WIM on his support page at the Weather Display Forum.

https://www.weather-watch.com/smf/index.php/board,77.0.html

Regards,

Dave

Offline johnzapf

  • Member
  • *
  • Posts: 43
    • live hummingbird Camera
ok, trying to signup on that forum but not getting an email back, nothing in junk etc... will see.

Also I cant get the WU widget to work on my site, I know that is old and they are not supporting it anymore, but it wont display. my site is Joomla/PHP do you know how to add that and make it display/work?

<a href="http://www.wunderground.com/weatherstation/WXDailyHistory.asp?ID=KCAOCEAN408"><img src="http://banners.wunderground.com/cgi-bin/banner/ban/wxBanner?bannertype=wxstnsticker&weatherstationcount=KCAOCEAN408" height="160" width="160" border="0" alt="Weather Underground PWS KCAOCEAN408" /></a>
PWS NAME: Ocean Breeze Valley, Oceanside

Offline johnzapf

  • Member
  • *
  • Posts: 43
    • live hummingbird Camera
I am trying to add Anole Weather Graphic to my website but I don't have a data file. I only have API's from WU and Ambient Weather. Is there a way to do this? and if so how? http://www.artisticimages.com/styles/styles-background/wt

I am able to pull data from API's to do other things so there must be a way. http://www.artisticimages.com/styles/styles-background/pws This must have a data file? I am wondering if I can use the data file from this for wxgraphic?

See attached ambient.txt data file. I added a path to it and nothing happened $data_file_path  = '/pwsWD/jsondata/ambient.txt';

Thanks, John
PWS NAME: Ocean Breeze Valley, Oceanside

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9296
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
I responded to your question on Weather-Watch.com forum. (duplicated here)

Quote
Hi John,
The Anole weather graphic script set (now distributed via my legacy scripts) uses a simple text file with the needed weather data.  As distributed, the script uses a Weather-Display clientraw.txt or other weather software stickertags.txt file for the required data.

The ambient.txt file you'd attached in your post is a JSON-formatted data file, and can't be read/parsed by the existing Anole script directly.
However, it should be a simple matter to use a small PHP script to read the ambient.txt, parse the JSON, and return a stickertag text, and then the wxgraphic.php can load the small PHP script (by URL) to get the data needed.    Alternatively, the wxgraphic.php could be modified to read/parse the JSON data in ambient.txt directly.

Lastly, a note about your sample above of
Code: [Select]
$data_file_path  = '/pwsWD/jsondata/ambient.txt'; Filesystem paths that start with / always reference the root of the filesystem, and likely not the root of the webserver's documents.
it's always best to use relative path addressing in PHP for files, so just adding a . (period) makes it
Code: [Select]
$data_file_path  = './pwsWD/jsondata/ambient.txt'; then the file can be found (but in this case, due to it's contents, unable to be used by the wxgraphic.php script as-is).

Hope this helps...

and


Quote
As a general guideline, I recommend you NOT alter someone else's scripts (beyond settings customization) unless you're willing to assume full support for the resulting script.  Personally, I prefer to create a 'shim' script to take something and convert it to the format needed by something else, so the script for something else can remain mostly unmodified (beyond normal settings customization).  Easier to maintain in the future.

With that said, I've attached a shim script that takes the JSON data from ambient.txt and creates a stickertag return.

See the script comments for more info.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline johnzapf

  • Member
  • *
  • Posts: 43
    • live hummingbird Camera
I cant get wxgraphic to read any other fonts? only $font_file = 'none'; works.  I have tried this:  $font_file = './arial.ttf';  so many ways and nothing works, has anyone figured this out?

John

PWS NAME: Ocean Breeze Valley, Oceanside

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9296
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
You can use other TTF fonts.  You have to copy your chosen font from c:\windows\Fonts to the ./wxgraphic/ directory on your website to use it with $font_file = './arial.ttf'; in the config.txt file.

Be aware that some fonts are .TTF and others are .ttf
Make sure to note the EXACT NAME of the file.ext used.. on *nix websites, the capitalization counts.  ARIAL.TTF is not the same as arial.ttf or Arial.ttf.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline johnzapf

  • Member
  • *
  • Posts: 43
    • live hummingbird Camera
 [ You are not allowed to view attachments ]


$font_file = './arial.ttf';

I have been trying for hours, I don't get it. I have tried several kinds of fonts and all kinds of locations and nothing works but $font_file = 'none';

http://www.artisticimages.com/styles/styles-background/wt
PWS NAME: Ocean Breeze Valley, Oceanside

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9296
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Yes, I see the file is on the website.

It's likely that the GD library in PHP does not have FreeType Support font capability enabled.  Contact your website hoster technical support and ask if if they do.  Can't tell remotely as there are no diagnostic scripts available on your site.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline johnzapf

  • Member
  • *
  • Posts: 43
    • live hummingbird Camera
I host my own sites. this is a Joomla site. Is it something I need to turn on in Joomla or IIS 10?

PHP.INI looks good

 [ You are not allowed to view attachments ]

« Last Edit: June 02, 2020, 09:55:34 PM by johnzapf »
PWS NAME: Ocean Breeze Valley, Oceanside

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9296
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Then check the IIS error log for PHP errors.. that will give you a clue where to go next.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline johnzapf

  • Member
  • *
  • Posts: 43
    • live hummingbird Camera
no error in the logs or in IIS event viewer.
PWS NAME: Ocean Breeze Valley, Oceanside

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9296
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Absence of logs might be caused by the error_reporting being turned off.

In wxgraphic.php at the top change
Code: [Select]
<?php 
/******************************************************************************
* wxgraphic.php v6.3
to
Code: [Select]
<?php 
error_reporting
(E_ALL);
ini_set('display_errors','1');
/******************************************************************************
* wxgraphic.php v6.3
Then see what may be logged.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline johnzapf

  • Member
  • *
  • Posts: 43
    • live hummingbird Camera
I think something is missing in that code? If I change to that I it brakes it.

PWS NAME: Ocean Breeze Valley, Oceanside

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9296
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
What does the error log say?
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

 

anything