MCHALLIS
Weather Guru

OfflineLocation: Long Beach, WA USA Station Type: Davis VP2+
Posts: 948 Local Time: Friday 23:20
|
 |
« on: January 07, 2008, 04:08:24 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#PHPtagsConfigure 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 If you are already using the Weather Display/PHP/AJAX Website Template Set then you can skip this step. Step 2) Install my Multifunction Image Handler PHP Script http://www.proweatherstore.com/weather/scripts.phpJust download the file, adjust a few settings at the top, upload it to your web server, and link to the file like you would an image. Please refer to the "How to use it" section at the top of the script source code for all the details. Make sure step 2 is working, then continue to step 3. Step 3) Edit the Multifunction Image Handler PHP Script file In the settings section at the top make this simple change ... change $text1 = '';
to # Relative path to your testtags.php file, Not the URL. (use ./testtags.php if it is in the same directory.) require "./testtags.php"; $timezone = date('T'); $temperature = preg_replace('/°F/', ' °F', $temperature);
$text1 = "$time $timezone $date $temperature, Rain:$dayrn, Wind:$avgspd, Max Gust:$maxgst $current_summary Long Beach, WA www.ProWeatherStore.com";
Use double quotes for the php variables to display. The text can be a single line or multiple lines. If the line is too long it will auto wrap. You can modify the text to your liking and use any data variables you want from the testtags.php file See a live demo of it here: Demo - Multifunction Image Handlerhttp://www.proweatherstore.com/weather/scripts-image-handler.php#IHdemoNew Tutorials online: PHP Web Cam Image Text Overlay Tutorial by Mike Challis http://www.proweatherstore.com/weather/scripts-weather-cam-text.phpHow To PHP Upload Your Web Cam Image to WeatherUnderground http://www.proweatherstore.com/weather/scripts-weather-cam-uploader.php
|
|
|
|
« Last Edit: September 23, 2008, 06:29:31 PM by MCHALLIS »
|
Logged
|
|
|
|
niko
syzygy
Senior Weather Controller
OfflineLocation: Northern California, U.S.A. Station Type: 2 x Davis VP2 Wireless / Win 2000
Posts: 14,409 Local Time: Friday 23:20
|
 |
« Reply #1 on: January 07, 2008, 04:12:37 AM » |
|
Good one 
|
|
|
|
|
Logged
|
|
|
|
ktrue
Junior Weather Controller
  
OfflineLocation: Saratoga, CA, USA 37:16:28N, 122:01:23W - Elev: 374ft. Station Type: Davis VP1+ FARS, Boltek-PCI, NexStorm StormVue WASP2, GRLevel3, WXSIM
Posts: 2,727 Local Time: Friday 23:20
|
 |
« Reply #2 on: January 07, 2008, 07:42:52 AM » |
|
Very cool, Mike!  /  Congratulations on starting your own "scriptorium"! Best regards, Ken
|
|
|
|
|
Logged
|
Ken True Saratoga WeatherCWOP: CW1792 WeatherUnderground: KCASARAT1 Free weather website PHP scripts and WD website AJAX templates 
|
|
|
smokie
Forecaster
   
OfflineLocation: Newquay, Cornwall UK Station Type: WS2300, Weather display, WDL
Posts: 168 Local Time: Saturday 08:20
WS2300 operational May 2007
|
 |
« Reply #3 on: January 08, 2008, 03:46:46 PM » |
|
Hi, cool script, good job, one thing I must be missing something becasue altering the $textalign to any of the other options has no effect, the overlay still appears top left, any ideas, works great apart from that.
|
|
|
« Last Edit: January 08, 2008, 03:48:43 PM by smokie »
|
Logged
|
|
|
|
MCHALLIS
Weather Guru

OfflineLocation: Long Beach, WA USA Station Type: Davis VP2+
Posts: 948 Local Time: Friday 23:20
|
 |
« Reply #4 on: January 08, 2008, 04:39:27 PM » |
|
smokie, What version of my script are you using? version 1.3 had the bug you describe. If you view the source it says what version at the top Please download the latest version from today, that should fix it Download the latest version here: http://www.carmosaic.com/weather/scripts/multifunction-image-handler.php?sce=view# Version: 1.30 07-Jan-2008 - Bug fix for wordwrap true type font text # Version: 1.40 07-Jan-2008 - Bug fix for text position, not working on vers. 1.30 # Version: 1.50 07-Jan-2008 - Better handling of downloaded file name for local file # Version: 1.60 08-Jan-2008 - Bug fix for true type fonts, bug fix for local file usage
|
|
|
|
« Last Edit: January 08, 2008, 04:58:34 PM by MCHALLIS »
|
Logged
|
|
|
|
MCHALLIS
Weather Guru

OfflineLocation: Long Beach, WA USA Station Type: Davis VP2+
Posts: 948 Local Time: Friday 23:20
|
 |
« Reply #5 on: January 08, 2008, 05:07:23 PM » |
|
I am now using this PHP script to generate my web cam image every 5 minutes. http://www.carmosaic.com/weather/cam.phpI used to manage the text overlay using WD webcamcapture.exe on my WinXP computer. That method works pretty good, but the reason I do it now with PHP on my web server is to have better control of the text overlay since I already have weather information on my server using Ken True's PHP Weather-Display tags feature. I still use WD webcamcapture.exe to send the plain image to my web server every 5 minutes, them my php script overlays text on it. I even figured out a way to upload my web cam image to weather underground from my server using a PHP script I wrote. If anybody wants to know exactly how I do it, let me know, I could write a "how to" article on my web site.
|
|
|
|
« Last Edit: January 08, 2008, 06:33:39 PM by MCHALLIS »
|
Logged
|
|
|
|
niko
syzygy
Senior Weather Controller
OfflineLocation: Northern California, U.S.A. Station Type: 2 x Davis VP2 Wireless / Win 2000
Posts: 14,409 Local Time: Friday 23:20
|
 |
« Reply #6 on: January 08, 2008, 05:17:37 PM » |
|
It would be really nice if it was possible to archive the overlaid images at intervals  (Then I could use it  )
|
|
|
|
|
Logged
|
|
|
|
MCHALLIS
Weather Guru

OfflineLocation: Long Beach, WA USA Station Type: Davis VP2+
Posts: 948 Local Time: Friday 23:20
|
 |
« Reply #7 on: January 08, 2008, 05:35:39 PM » |
|
It would be really nice if it was possible to archive the overlaid images at intervals  (Then I could use it  ) It is possible, I have a cronjob running on my server every 5 minutes to generate the text overlay. I use my image handler slightly modified to do that. It would be easy to put a few lines in there as an option to archive the images. The images would be on the web server, is that what you would like? How would you like the images to be timestamped? I guess I would only do it if someone will actually use it, let me know ...
|
|
|
|
|
Logged
|
|
|
|
jmcmurry
Jim McMurry
Rain Maker
 
OfflineLocation: Mauston, WI, USA Station Type: Davis Vantage Pro 2 Plus Wireless. StartWatch, VirtualVP, Boltek/NexStorm, GR3 & WxSim
Posts: 1,009 Local Time: Saturday 01:20
Core Duo w/4gb ram & Win XP
|
 |
« Reply #8 on: January 08, 2008, 06:09:49 PM » |
|
It would be really nice if it was possible to archive the overlaid images at intervals  (Then I could use it  ) I can see how this would be handy for a lot of folks. I have a similar system running that takes a new photo that's been uploaded, adds an overlay that was previously uploaded by WD, then maintains the last 96 webcam photos. Then my slideshow script can show a sequence. I do this with my Wasp2 images too. I've been thinking about incorporating your new script because of the nice crisp overlay, but haven't gotten to it yet. - Jim
|
|
|
|
|
Logged
|
|
|
|
niko
syzygy
Senior Weather Controller
OfflineLocation: Northern California, U.S.A. Station Type: 2 x Davis VP2 Wireless / Win 2000
Posts: 14,409 Local Time: Friday 23:20
|
 |
« Reply #9 on: January 08, 2008, 06:33:23 PM » |
|
It is possible, I have a cronjob running on my server every 5 minutes to generate the text overlay. I use my image handler slightly modified to do that. It would be easy to put a few lines in there as an option to archive the images. The images would be on the web server, is that what you would like? How would you like the images to be timestamped?
I guess I would only do it if someone will actually use it, let me know ...
Currently mine is similar to Jim's. One pic is stored each hour, the filename is imagehh.jpg e.g. image06.jpg so today's "06" replaces yesterday's "06" and the website just displays the current (frequently updated) image and image06 through image20 - which is a very simple html page. I doubt anyone else would want exactly that scheme, and a .php page can surely handle something more complex.
|
|
|
|
|
Logged
|
|
|
|
MCHALLIS
Weather Guru

OfflineLocation: Long Beach, WA USA Station Type: Davis VP2+
Posts: 948 Local Time: Friday 23:20
|
 |
« Reply #10 on: January 08, 2008, 06:37:48 PM » |
|
niko, I can write a separate cron job PHP script to do that, it is way simple. Are you able to schedule a cron job on your web server? Crontab how to http://www.crontabrocks.org/
|
|
|
|
|
Logged
|
|
|
|
niko
syzygy
Senior Weather Controller
OfflineLocation: Northern California, U.S.A. Station Type: 2 x Davis VP2 Wireless / Win 2000
Posts: 14,409 Local Time: Friday 23:20
|
 |
« Reply #11 on: January 08, 2008, 06:50:14 PM » |
|
niko, I can write a separate cron job PHP script to do that, it is way simple. Are you able to schedule a cron job on your web server? Crontab how to http://www.crontabrocks.org/No, I can't cron so don't do anything specifically for me, only put your time into this if it's a general interest thing. I think I could work around it with pseudo-chron though...
|
|
|
|
|
Logged
|
|
|
|
Fox_Of_The_Wind
Anthony
Weather Guru

OfflineLocation: De Soto Wisconsin USA Station Type: Wireless davis vantage pro II Windows XP
Posts: 803 Local Time: Saturday 01:20
C:\DOS C:\DOS\RUN RUN\DOS\RUN
|
 |
« Reply #12 on: January 08, 2008, 08:52:02 PM » |
|
I am now using this PHP script to generate my web cam image every 5 minutes. http://www.carmosaic.com/weather/cam.phpI used to manage the text overlay using WD webcamcapture.exe on my WinXP computer. That method works pretty good, but the reason I do it now with PHP on my web server is to have better control of the text overlay since I already have weather information on my server using Ken True's PHP Weather-Display tags feature. I still use WD webcamcapture.exe to send the plain image to my web server every 5 minutes, them my php script overlays text on it. I even figured out a way to upload my web cam image to weather underground from my server using a PHP script I wrote. If anybody wants to know exactly how I do it, let me know, I could write a "how to" article on my web site. Well I would like to say good job on the script. If I can get it running anyone can. LOL Anyway I would like to find out how you made the php script for the weather underground. Thanks!!!!
|
|
|
|
|
Logged
|
|
|
|
MCHALLIS
Weather Guru

OfflineLocation: Long Beach, WA USA Station Type: Davis VP2+
Posts: 948 Local Time: Friday 23:20
|
 |
« Reply #13 on: January 08, 2008, 09:32:55 PM » |
|
I will make a tutorial on my site for how I did the weather underground PHP upload. The script is very simple, but you have to be able to schedule a cron job on your web server. Give me a day or so to work on it.
|
|
|
|
|
Logged
|
|
|
|
smokie
Forecaster
   
OfflineLocation: Newquay, Cornwall UK Station Type: WS2300, Weather display, WDL
Posts: 168 Local Time: Saturday 08:20
WS2300 operational May 2007
|
 |
« Reply #14 on: January 08, 2008, 09:34:03 PM » |
|
smokie, What version of my script are you using? version 1.3 had the bug you describe. If you view the source it says what version at the top Please download the latest version from today, that should fix it Download the latest version here: http://www.carmosaic.com/weather/scripts/multifunction-image-handler.php?sce=view# Version: 1.30 07-Jan-2008 - Bug fix for wordwrap true type font text # Version: 1.40 07-Jan-2008 - Bug fix for text position, not working on vers. 1.30 # Version: 1.50 07-Jan-2008 - Better handling of downloaded file name for local file # Version: 1.60 08-Jan-2008 - Bug fix for true type fonts, bug fix for local file usage Yes I am using 1.30, have down loaded the latest, will try 1.60 tomorrow  Update, I had a spare 5 mins, yes thats done the trick MCHALLIS 
|
|
|
|
« Last Edit: January 08, 2008, 10:19:52 PM by smokie »
|
Logged
|
|
|
|
|