TweetWX package (Thanks to Joe Chung and Ken True for providing the auth code)  

 Originally packaged for TweetWX by Ken True - Saratoga-weather.org  08-Jun-2010


 Repackaged for TweetWX by Mike Challis - 642weather.com  13-Jun-2010
 http://www.642weather.com/weather/scripts.php


Contents:
  README.txt  -- this file
  LICENSE.txt -- copyright information
  CHANGELOG.txt - description of changes to the files
  TweetWX-globals.php - common code used by other scripts in the package
  TweetWX-setup1.php - setup file for OAuth - part 1
  TweetWX-setup2.php - setup file for OAuth - part 2
  
  
This package has two setup functions that serve to obtain a durable access token/access token secret for the application to securely update your Twitter status with conditions from WD and forecasts from NOAA/NWS.
My thanks to Joe Chung who wrote a simple OAuth/Twitter set of functions documented on his blog and these scripts are based on his code.
Requirements:

    * These scripts need PHP5+ to run. They will not run on PHP4.
    * You will need a valid Twitter account to receive the postings.
   
Setup

   1. Download the distribution .zip file, unpack it preserving directory structure, and upload contents to your weather website.

   2. Register your own application with Twitter at http://twitter.com/oauth_clients/new using your Twitter account.
     
     After you setup your own application registration at Twitter, then copy the consumer key and consumer secret key values into the TweetWX-globals.php values at the top of the page. Then save and upload the modified TweetWX-globals.php file.


   3. Run TweetWX-setup1.php on your website. It will produce a page with two OAuth request values that must be copied into TweetWX-setup2.php and a link to Twitter to allow connection of the TweetWX app to your twitter account.
         1. Click on the link and Twitter will ask you to sign-in, then ask permission for Your Twitter Application to be allowed access to your account.
         2. Click to agree, that will produce a Twitter page with a verification number, and that number needs to be copied into the proper variable inside of TweetWX-setup2.php.
***** NEXT 2 STEPS MUST BE COMPLETED BEFORE THE VERIFICATION REQUEST KEYS EXPIRE (MAYBE ONLY A FEW MINUTES) ******

Update TweetWX-setup2.php with the two request keys and the verification number from Twitter and upload the modified TweetWX-setup2.php to your website.


   4. Run TweetWX-setup2.php on your website. It will produce two keys as copy code.
      These keys are to be copied into the top of TweetWX-globals.php replacing the values there.
      These OAuth credentials do not expire (AFAIK) and using them allows the script(s) to post to your Twitter account status.
      Keep these access keys secret .. they are similar to your user:pass on the old basic authentication scheme and allow read/write to your Twitter account.
 

   5. Set the correct file path to $tweetWXdir inside your 642weather PHP application (nws-forecast-messenger.php, rss-weather-alerter.php, or wd-conditions-messenger.php). 
 
   6. Enable twitter $twitter_enabled = 1; inside your 642weather PHP application (nws-forecast-messenger.php, rss-weather-alerter.php, or wd-conditions-messenger.php). 

   7. Try your 642weather PHP application (nws-forecast-messenger.php, rss-weather-alerter.php, or wd-conditions-messenger.php). 

   8. After you confirm your script is posting to Twitter, delete TweetWX-setup1.php and TweetWX-setup2.php from your server.

   9. It is OK to share Your Twitter Application with multiple 642weather PHP applications on the same web site (nws-forecast-messenger.php, rss-weather-alerter.php, or wd-conditions-messenger.php). So if you already have setup one script with a /TweetWX/ folder, the next script can share the same auth tokens. Just repeat steps 5, 6, and 7. 
  