Twitter Forecast

I’ve successfully set up a twitter account and I’ve been tweeting weather updates for a some time now. I’m looking to try and tweet a forecast a couple of times a day. Has anyone managed to do this or any suggestions for achieving it?

I had thought of using WD email to something like facebook?? with a twitter link? - Don’t know whether that’s possible, but I don’t think you can use WD twitter as I want to tweet forecasts as well as current conditions.

Thoughts?

I have been using Mike’s messenger scripts for a while: http://www.642weather.com/weather/scripts.php They work great! =D> You can see the Twitter results here: http://twitter.com/planowx

Maybe he would be interested in adding a WXSIM option to the NWS messenger? :-k

Thanks Lauren for the links.

I really want my WxSim forecast to be tweeted. I’m thinking of setting up a new Wordpress site to tweet new posts and then also link my WxSim RSS forecast to it.

Could be interesting - anyone done this already?

Done it! :smiley: using php and Kens plaintext parser script. Together with weather Display, I’m automatically tweeting exactly what I want (I already have 14 followers :slight_smile:

http://twitter.com/#search?q=weatherwelly

Can you share your code please?

Chris

Hi Chris, yes of course I’ll share, but the authorisation procedure is a little complicated :?

I can’t take much credit for this as others have done all the hard work, but I’ll explain all the steps I took giving links where appropriate.

The first thing you need to do is create a twitter account ( if you have not done so go to https://twitter.com/signup )

Then set up Weather Display to tweet your current conditions. I use the string:

Wellington @ %time%: Temp %tempinmetric%

Thanks Rob,
I look forward to part 2.

Chris

Sorry for such a big post. I’ve included a word doc file of it, so you can print it out if required.

Ok, once you


Twitter Setup.doc (34.5 KB)

Hi Welly

Thank you very much for the description - I have finally got it working - and yes it was a bit complicated - I had to read the guide over and over before I got it working.

I have only one problem - its the Danish letter

Rob,
Thanks for the instructions- I now have tweets of conditions and forecasts at CarseWeatherUK
Chris

Well done Chris. You may want to tweak the twitter.plaintext-parser file to get it just right. I’m still playing as I’ve noticed that certain symbols break the tweet (such as the down arrow symbol)

Henrik, have you used Weather Display to do a test tweet with that character in.WD does change the degree symbol to a unicode character, perhaps it will give you a clue.

can anyone please help.

I have uploaded the files to my host server.

I really want a cron job to run a php file to execute the tweet.

is this possible?

A simple way, without getting involved in cron jobs, to regularly run a .php script on your webserver is to use WD’s scheduled webpage search function.

Control Panel, FTP, Webpage Search. Put the url of the .php script in the URL box, there’s no need to put anything in the key word boxes, hit Test, should work. Add schedule to taste.

sorry I don’t understand. how does that tweet my forecast from wxsim?

Sorry, forget it, I misunderstood, I thought you posted that you had uploaded the forecast tweet .php script to your website and wanted to run it by cron.

no worries.

i have got all my tokens (i think)

and have got to the tweet.php part.

i get

Fatal error: Call to undefined function post_tweet() in /home/content/m/u/p/muppet77/html/tweet.php on line 10

line 10 is

$retarr = post_tweet(OAUTH_CONSUMER_KEY,OAUTH_CONSUMER_SECRET,$tweet,$access_token,$access_token_secret,true,true);
exit(0);

even when i change

OAUTH_CONSUMER_KEY,OAUTH_CONSUMER_SECRET

to the values it still fails.

any ideas?

i have values for

request_token
request_token_secret
oauth_verifier

sorted.

I had missed off the first two require lines from tweet.php

works perfectly now. what a great piece of php. many thanks, it was well worth the effort.

www.twitter.com/meschoolweather

Does anybody know if this would also work with the Wunderground Forecasts coming from WU-forecasts.php?

Massive BUMP for ancient thread I know, but I wanted to add my thanks. I’ve just implemented this and it works. (Still, 2 years later.)

Is anybody aware of any other mechanisms for automatically posting WXSim forecasts to Twitter and/or Facebook?