I thought I would share what I have done for the next person who is looking 
around for this so that they can save some time. If there are any 
suggestions to improve on this please reply to this message with them :)

   - Installed Oystter (https://github.com/oysttyer/oysttyer)
   - I needed a twitter client I can run from a cron / command line - but 
      that also supported 280 characters, this is what I found YMMV
      - to do this edit lines *659* and *660* ($linelength and 
      $quotelinelength) to *280* and *256* respectively
      
      - Add to skins.conf to create the output file for the tweet
   
       [[TwitterHourly]]
            encoding = strict_ascii
            template = twitterHourly.out.tmpl

   - Create the template for the twitterHourly.out file in <path to your 
   weewx skin> e.g.: /etc/weewx/skins/Standard/twitterHourly.out.tmpl 
   In my case I used (change as you need for links, hashtags, etc)

Current Conditions for #$station.location\nTemp: 
$current.outTemp\nHumidity: $current.outHumidity\nBarometer: 
$current.barometer\nWind: $current.windSpeed from the 
$current.windDir.ordinal_compass\nRain Rate: $current.rainRate\nRain Total: 
$day.rain.sum\nSolar Radiation: $current.radiation\n 
https://t.co/O5QrLrWXj9 #weewx #nepa #nepaweather #poconos #poconomountains


   - Add this to a user's crontab to run 2m after every hour (to give time 
   for reports to generate)

 2 * * * *       <path_to>/oysttyer.pl -newline -script -status= < 
/<path_to_weewx_webroot>/twitterHourly.out


The -newline switch replaces \n with a newline in the tweet, -script 
suppresses stdout ... there are more switches available for 
location/lat/long etc etc 

The status update on twitter ends up looking like 
this: https://twitter.com/iml_weather/status/981577650782244865 initially - 
will evolve as I go on ...

*Things I would like to add/tweak:*

   - Figure out how to add one line if/else statements in cheetah along the 
   lines of 
   *         IF *$current.windSpeed < 1 *THEN* Wind: Calm \n *ELSE* Wind: 
   $current.windSpeed from the $current.windDir.ordinal_compass\n 

*ENDIF *This would look better, but not sure how to pull this off in the 
   template 

Hope this helps the future me looking for an answer :)

-john
 

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to