cloudy

Author Topic: Weather Display Conditions Messenger PHP Script  (Read 19145 times)

0 Members and 1 Guest are viewing this topic.

Offline MCHALLIS

  • Posts: 2,102
  • Long Beach, WA USA
    • Weather for Long Beach, WA USA
Re: Weather Display Conditions Messenger PHP Script
« Reply #15 on: July 18, 2009, 05:32:38 AM »
The night time was in there twice because one has a capital T and one does not.

Version: 1.05 - 17-Jul-2009 - trim spaces from current conditions

abaldish

  • Guest
Re: Weather Display Conditions Messenger PHP Script
« Reply #16 on: July 18, 2009, 05:45:59 AM »
ok left the script as is to check still get that extra space from wd: cloudy -, Temp

Checking the testtags.php shows: $Currentsolardescription = 'Night Time/Dry/mostly cloudy - ';


The night time was in there twice because one has a capital T and one does not.
Version: 1.05 - 17-Jul-2009 - trim spaces from current conditions
« Last Edit: July 18, 2009, 05:51:13 AM by JtwnPaWeather »

Offline MCHALLIS

  • Posts: 2,102
  • Long Beach, WA USA
    • Weather for Long Beach, WA USA
Re: Weather Display Conditions Messenger PHP Script
« Reply #17 on: July 18, 2009, 06:00:19 AM »
ok left the script as is to check still get that extra space from wd: cloudy -, Temp

Checking the testtags.php shows: $Currentsolardescription = 'Night Time/Dry/mostly cloudy - ';


put this line in the $shorten_words_array
'mostly cloudy -'  => 'Cldy',

abaldish

  • Guest
Re: Weather Display Conditions Messenger PHP Script
« Reply #18 on: July 18, 2009, 06:04:38 AM »
Ok mike that works. I will keep an eye out for any of the tags and what they are. and add them in one by one. I am sure there are a few there.

put this line in the $shorten_words_array
'mostly cloudy -'  => 'Cldy',

Offline MCHALLIS

  • Posts: 2,102
  • Long Beach, WA USA
    • Weather for Long Beach, WA USA
Re: Weather Display Conditions Messenger PHP Script
« Reply #19 on: July 19, 2009, 02:07:36 PM »
Version: 1.06 - 19-Jul-2009 - added email Bcc feature

Offline MCHALLIS

  • Posts: 2,102
  • Long Beach, WA USA
    • Weather for Long Beach, WA USA
Re: Weather Display Conditions Messenger PHP Script
« Reply #20 on: July 23, 2009, 12:55:07 AM »
Version: 1.07 - 22-Jul-2009 - added post authentication feature.
Now you can edit your cron job to use CURL and pass a username and password
so that the script can be in public view and it only emails when called from your cron job with the correct username and password.
This is the best way to allow the script to be in public  and have the most accurate cron times, such as I use: every hour
This is a sample of my cron: (be sure to set your_username and your_password)
curl -d 'username=your_username&password=your_password' http://www.642weather.com/weather/wd-conditions-messenger.php >/dev/null 2>&1

Offline MCHALLIS

  • Posts: 2,102
  • Long Beach, WA USA
    • Weather for Long Beach, WA USA
Re: Weather Display Conditions Messenger PHP Script
« Reply #21 on: July 31, 2009, 04:31:28 PM »

I figured out how to send my tweets to Facebook. This is how:
Log into Facebook and go to this app:
http://www.facebook.com/selectivetwitter
Click settings and add your Twitter username, then grant permissions.
End a tweet with #fb when you want it to update your Facebook status - simple.

I made a Facebook page for 642weather, then made a personal profile for myself, I am the admin of the page now.
Pages and profiles are two different things.

http://www.facebook.com/pages/Long-Beach-Weather-Long-Beach-Washington-98631-USA/102474670891?ref=nf

Offline wxtech

  • Posts: 7
  • Lexington, Ga. USA
    • Lexington, Georgia Weather
Re: Weather Display Conditions Messenger PHP Script
« Reply #22 on: August 06, 2009, 10:24:33 AM »
I figured out how to send my tweets to Facebook. This is how:
Log into Facebook and go to this app:
http://www.facebook.com/selectivetwitter
Click settings and add your Twitter username, then grant permissions.
End a tweet with #fb when you want it to update your Facebook status - simple.

I made a Facebook page for 642weather, then made a personal profile for myself, I am the admin of the page now.
Pages and profiles are two different things.

http://www.facebook.com/pages/Long-Beach-Weather-Long-Beach-Washington-98631-USA/102474670891?ref=nf

Thanks, it works beautifully, and so easy.
Al
Davis VP2+ wireless using RMYoung 05103 wind sensor & WaterLog H-340 rain sensor, RMYoung 50202/Basic Stamp 2.  NWS Coop LXTG1.  CoCoRaHS GA-OG-1. CWOP=CW2074.  Wunderground=KGALEXIN1.  Weatherlink, VWS v13.01p09, ImageSalsa 1.9.14.
Retired USAF

Offline i_fiorentino

  • Posts: 1,350
  • 160 mls Carmignano (Po), Tuscany, Italy
    • Meteocarmignano.it
Re: Weather Display Conditions Messenger PHP Script
« Reply #23 on: September 03, 2009, 03:55:08 PM »
Hi Mike!
Actually this application sent weather condictions (in twitter and FB) every one hour. Is it possibile to set it every 6 hours?
Thanks in advance,

Alessandro

Offline MCHALLIS

  • Posts: 2,102
  • Long Beach, WA USA
    • Weather for Long Beach, WA USA
Re: Weather Display Conditions Messenger PHP Script
« Reply #24 on: September 03, 2009, 04:07:17 PM »
Hi Mike!
Actually this application sent weather condictions (in twitter and FB) every one hour. Is it possibile to set it every 6 hours?
Thanks in advance,

Alessandro

Just change the cron schedule
http://slavi.biz/blog/how-to-run-a-cron-job-every-6-hours-2009-02-10.html

Offline i_fiorentino

  • Posts: 1,350
  • 160 mls Carmignano (Po), Tuscany, Italy
    • Meteocarmignano.it
Re: Weather Display Conditions Messenger PHP Script
« Reply #25 on: September 05, 2009, 06:40:30 AM »
 #-o
Cheers,

Alessandro

Offline Traj

  • Posts: 260
  • Weather is for the birds.
  • Woonsocket, RI USA
    • We do stuff...
Re: Weather Display Conditions Messenger PHP Script
« Reply #26 on: September 06, 2009, 02:26:42 PM »
Mike,

I have tested your great script.  It works well.  I can't seem to get my cron to work.  Do you see anything wrong?

Code: [Select]
0,15,30,45 * * * * php trajnet/wdl/wd-conditions-messenger.php5 2>&1 > /dev/null
I have similar crons in the the cron.txt file and they are working, so I can't figure out why this isn't.  Any advice is appreciated.

Traj

Offline MCHALLIS

  • Posts: 2,102
  • Long Beach, WA USA
    • Weather for Long Beach, WA USA
Re: Weather Display Conditions Messenger PHP Script
« Reply #27 on: September 06, 2009, 03:27:49 PM »
Mike,

I have tested your great script.  It works well.  I can't seem to get my cron to work.  Do you see anything wrong?

Code: [Select]
0,15,30,45 * * * * php trajnet/wdl/wd-conditions-messenger.php5 2>&1 > /dev/null
I have similar crons in the the cron.txt file and they are working, so I can't figure out why this isn't.  Any advice is appreciated.

Traj


try to run this manually and make sure it works, then work on cron if still needed.
wd-conditions-messenger.php5

Offline Traj

  • Posts: 260
  • Weather is for the birds.
  • Woonsocket, RI USA
    • We do stuff...
Re: Weather Display Conditions Messenger PHP Script
« Reply #28 on: September 06, 2009, 04:14:46 PM »
Thanks Mike.  The script definitely works for me, twitter, facebook and all.  I'll keep at the cron.

Offline Traj

  • Posts: 260
  • Weather is for the birds.
  • Woonsocket, RI USA
    • We do stuff...
Re: Weather Display Conditions Messenger PHP Script
« Reply #29 on: September 06, 2009, 05:05:20 PM »
I found what the cause was:

0,15,30,45 * * * * php5 trajnet/wdl/wd-conditions-messenger.php5 2>&1 > /dev/null

I had to add the 5 to it.  At 1and1, the default is php4.x.  To use php5.x, one of the ways is to add the 5 after php on the file.  I had it on the file, so I tried placing it before the path as well.  That did the trick.

Regards,
Traj