cloudy

Author Topic: New Script: Text Overlay Web Cam Image from PHP Weather-Display tags  (Read 29290 times)

0 Members and 2 Guests are viewing this topic.

Offline MCHALLIS

  • Posts: 2,102
  • Long Beach, WA USA
    • Weather for Long Beach, WA USA
Re: New Script: Text Overlay Web Cam Image from PHP Weather-Display tags
« Reply #30 on: January 10, 2008, 03:04:40 PM »
niko and Jim,

from my tutorials ..
http://www.642weather.com/weather/scripts-weather-cam-text.php
http://www.642weather.com/weather/scripts-weather-cam-uploader.php

To Schedule automatic timed updates.... There are a few ways to do this, I use method 2

Method 1: If you already have weather-display software click on Control Panel | FTP & Connections | HTTP Download tab Click on #1,#2 or #3 setup button | switch on the button for "downloads on | enter your image-webcam-overlay.php url in the box called "URL of file to be downloaded" | click "add to list" | check the tick that says "Tick if text file" | enter image-webcam-overlay.txt in the box that says "Local filename to be downloaded" | click "add to list" | click "download every 5 minutes" | click "save now" | click OK

Method 2: Schedule a server cron job to run this php file every 5 minutes.
Example using crontab -e: (first change /path/to/ to your server path)
1,6,11,16,21,26,31,36,41,46,51,56 * * * * php /path/to/image-webcam-overlay.php 2>&1 > /dev/null

Method 3: Use Scheduled HTTP Request - Windows Task Scheduler to make a HTTP Request to the URL
http://www.yourwebsite.com/image-webcam-overlay.php every 5 minutes
« Last Edit: December 17, 2008, 04:44:15 AM by MCHALLIS »

Online jmcmurry

  • Jim McMurry
  • Posts: 2,213
  • Mauston, WI, USA
    • Juneau County Weather
Re: New Script: Text Overlay Web Cam Image from PHP Weather-Display tags
« Reply #31 on: January 10, 2008, 03:19:53 PM »
Yup, and I guess we're discussing a way of combining Methods 2 & 3 for folks whose server doesn't support Method 2 directly.  I think.  Absolutely great script and it's got me re-thinking how I have things working in the hodge-podge setup that I have on my computer.

Thanks.  - Jim

 Home of NSLog NexStorm Lightning Data Manager

Offline Fox_Of_The_Wind

  • Anthony
  • Posts: 1,163
  • C:\DOS C:\DOS\RUN RUN\DOS\RUN
  • De Soto Wisconsin USA
    • De Soto Valley Weather
Re: New Script: Text Overlay Web Cam Image from PHP Weather-Display tags
« Reply #32 on: January 10, 2008, 05:52:40 PM »
Jim. Did you get the script to run the weather underground webcam working? Mine will not work at all. I have no ideas what I did wrong.

Thanks!

Tony


Online jmcmurry

  • Jim McMurry
  • Posts: 2,213
  • Mauston, WI, USA
    • Juneau County Weather
Re: New Script: Text Overlay Web Cam Image from PHP Weather-Display tags
« Reply #33 on: January 10, 2008, 09:24:41 PM »
Sorry Tony but I haven't had a chance to try it yet.

- Jim

 Home of NSLog NexStorm Lightning Data Manager

Offline MCHALLIS

  • Posts: 2,102
  • Long Beach, WA USA
    • Weather for Long Beach, WA USA
Re: New Script: Text Overlay Web Cam Image from PHP Weather-Display tags
« Reply #34 on: January 10, 2008, 09:45:14 PM »
Version: 1.83  10-Jan-2008 - Added feature, can now archive and auto rotate images with or without thumbs.
Feature can be utilized for web cam image archiving.
Thanks Jim McMurry at http://www.jcweather.us/ for the feature suggestion

Offline Fox_Of_The_Wind

  • Anthony
  • Posts: 1,163
  • C:\DOS C:\DOS\RUN RUN\DOS\RUN
  • De Soto Wisconsin USA
    • De Soto Valley Weather
Re: New Script: Text Overlay Web Cam Image from PHP Weather-Display tags
« Reply #35 on: January 10, 2008, 10:18:41 PM »
Sorry Tony but I haven't had a chance to try it yet.

- Jim

Well if you do give me a yell. Thanks!!!

Wow you guys are fast on the updates for this script. But I got it updated http://www.desotowiwx.com/imagecam.php
http://www.desotowiwx.com/webcam/

Now I just have to get it into my website.
« Last Edit: January 10, 2008, 10:47:52 PM by Fox_Of_The_Wind »


Offline MCHALLIS

  • Posts: 2,102
  • Long Beach, WA USA
    • Weather for Long Beach, WA USA
Re: New Script: Text Overlay Web Cam Image from PHP Weather-Display tags
« Reply #36 on: January 11, 2008, 04:43:02 PM »
Here is a tip when you are using the testtags.php weather data text overlay and using the image archive feature:

If you only want to archive your web cam images in daytime hours and not at night, do this:
change

Code: [Select]
# Auto archive/rotate image feature
$archive =1;

to
Code: [Select]
# Auto archive/rotate image feature
if($dayornight == 'Night') {
       $archive =0;
}else{
       $archive =1;
}
« Last Edit: January 20, 2008, 01:08:09 AM by MCHALLIS »

Offline MCHALLIS

  • Posts: 2,102
  • Long Beach, WA USA
    • Weather for Long Beach, WA USA
Re: New Script: Text Overlay Web Cam Image from PHP Weather-Display tags
« Reply #37 on: January 14, 2008, 10:09:48 PM »
Just added a new feature to select font colors and font shadow colors

Version: 1.84  13-Jan-2008 - Fixed jpeg compression bug in archived thumbnail images feature
Version: 1.85  14-Jan-2008 - Added feature: can now select font colors and font shadow colors

I now use this script to generate a images for my web cam archive/history page located here:
http://www.642weather.com/weather/cam-history.php
« Last Edit: December 17, 2008, 04:46:09 AM by MCHALLIS »

Offline Fox_Of_The_Wind

  • Anthony
  • Posts: 1,163
  • C:\DOS C:\DOS\RUN RUN\DOS\RUN
  • De Soto Wisconsin USA
    • De Soto Valley Weather
Re: New Script: Text Overlay Web Cam Image from PHP Weather-Display tags
« Reply #38 on: January 15, 2008, 05:32:51 PM »
Don't look like there will be a end to this great script :-) thanks!!!


Offline MCHALLIS

  • Posts: 2,102
  • Long Beach, WA USA
    • Weather for Long Beach, WA USA
Re: New Script: Text Overlay Web Cam Image from PHP Weather-Display tags
« Reply #39 on: January 19, 2008, 10:03:46 PM »
New version released:

Version: 1.86  19-Jan-2008 - Added feature: can now crop images,
renamed $rotate setting variables to $archive variables, checks for PHP GD function - gives error if it is not supported

I added the "Crop From Center" feature to the demo available here:
http://www.642weather.com/weather/scripts-image-handler.php#IHdemo
« Last Edit: December 17, 2008, 04:46:28 AM by MCHALLIS »

Offline niko

  • syzygy
  • Global Moderator
  • Posts: 21,998
  • Crystal Ball broken! Please post the URL.
  • Northern California, U.S.A.
    • http://www.realweatherstation.com
Re: New Script: Text Overlay Web Cam Image from PHP Weather-Display tags
« Reply #40 on: January 21, 2008, 03:08:10 AM »
I wanted to try this but didn't want to change WD to go the testtags.php route. I already have the clientraw files being uploaded so I used Anole's clientraw parser instead.

Offline MCHALLIS

  • Posts: 2,102
  • Long Beach, WA USA
    • Weather for Long Beach, WA USA
Re: New Script: Text Overlay Web Cam Image from PHP Weather-Display tags
« Reply #41 on: January 21, 2008, 04:58:00 AM »
I wanted to try this but didn't want to change WD to go the testtags.php route. I already have the clientraw files being uploaded so I used Anole's clientraw parser instead.

Great  :D How did it work out?

I recently added a cam archive page that stores the last 1,000 5 minute daytime images that were generated from my image handler script.

http://www.642weather.com/weather/cam-history.php
« Last Edit: December 17, 2008, 04:46:48 AM by MCHALLIS »

Offline niko

  • syzygy
  • Global Moderator
  • Posts: 21,998
  • Crystal Ball broken! Please post the URL.
  • Northern California, U.S.A.
    • http://www.realweatherstation.com
Re: New Script: Text Overlay Web Cam Image from PHP Weather-Display tags
« Reply #42 on: January 21, 2008, 01:10:41 PM »
Great  :D How did it work out?

Fine, very simple change, just include the different file and use the correct variable names. I'm just testing at the moment but the whole thing is very clearly commented and easy to use, you've done a great job :thumbright:

Offline Zalmor

  • Posts: 550
  • Erin, NY
    • Zalmors' corner of the Web
Re: New Script: Text Overlay Web Cam Image from PHP Weather-Display tags
« Reply #43 on: January 23, 2008, 12:06:54 AM »
You can use my new Multifunction Image Handler PHP Script as a Webcam Text Overlay PHP Script

Here is how to use it to overlay text from your weather data

Step 1) Install Ken True's PHP Weather-Display tags feature
http://saratoga-weather.org/scripts.php#PHPtags
Configure WD to upload the testtags.php to your web server every 5 minutes.
The testtags.php will have the weather variables you can use on your web cam overlay text
Would it be possible for this script to check the time stamp of the testtags.php file? I upload the testtags.php file every five minutes, but only upload the jpgwebcam.jpg file between 6am and 6pm to save some bandwidth.

Would like to see the script overlay the jpgwebcam.jpg during the non upload times also based on the time stamp of the testtags.php file?
http://southerin-ny.org/image-jpgwebcam.php is what I am using now.

Or is that what the
Code: [Select]
$no_output =0; is for?
« Last Edit: January 23, 2008, 12:15:33 AM by Zalmor »
Michael A

Windows XP Pro SP3, Pentium D 2.80GHz 3GB RAM, Quickcam Pro 4000, and APC

Offline MCHALLIS

  • Posts: 2,102
  • Long Beach, WA USA
    • Weather for Long Beach, WA USA
Re: New Script: Text Overlay Web Cam Image from PHP Weather-Display tags
« Reply #44 on: January 23, 2008, 12:38:43 AM »
Zalmore

find
Code: [Select]
        if ($islocal) {
              $GraphicTime = filectime($Imagefilename);

change to
Code: [Select]
#        if ($islocal) {
#             $GraphicTime = filectime($Imagefilename);
# Zalmore modified to base last-modified time on testtags.php instead of image
        if ($islocal) {
              $GraphicTime = filectime('testtags.php');

The $no_output =1; setting suppresses the image output for scheduled operation, makes it just save the file only.
No output is for Scheduling automatic timed updates for cron or system scheduler

You could use it to do what you are asking if you can schedule the script to run every 5 minutes...
see
http://www.642weather.com/weather/scripts-weather-cam-text.php
« Last Edit: December 17, 2008, 04:47:29 AM by MCHALLIS »

 

cumulus