@@ -7,7 +7,6 @@ var path = require('path');
77var program = require ( 'commander' ) ;
88const Mustache = require ( 'mustache' ) ;
99var scrawl = require ( './www/scrawl' ) ;
10- var Twitter = require ( 'twitter' ) ;
1110const yaml = require ( 'js-yaml' ) ;
1211
1312program
@@ -18,7 +17,6 @@ program
1817 // the do something switches
1918 . option ( '-m, --html' , 'If set, write the minutes to an index.html file' )
2019 . option ( '-e, --email' , 'If set, publish the minutes to the mailing list' )
21- . option ( '-t, --twitter' , 'If set, publish the minutes to Twitter' )
2220 . option ( '-g, --google' , 'If set, publish the minutes to G+' )
2321 . option ( '-i, --index' , 'Build meeting index' )
2422 // the tweak the cli switch
@@ -43,8 +41,7 @@ if(!program.directory) {
4341 process . exit ( 1 ) ;
4442}
4543
46- if ( ! program . html && ! program . email && ! program . twitter
47- && ! program . google && ! program . index ) {
44+ if ( ! program . html && ! program . email && ! program . google && ! program . index ) {
4845 console . error ( 'Error: Nothing to do...' ) ;
4946 program . outputHelp ( ) ;
5047 process . exit ( 1 ) ;
@@ -396,55 +393,6 @@ Full text of the discussion follows for archival purposes.
396393 } else {
397394 callback ( ) ;
398395 }
399- } , function ( callback ) {
400- // publish the minutes to Twitter
401- if ( program . twitter ) {
402- if ( ! process . env . SCRAWL_TWITTER_CONSUMER_KEY ||
403- ! process . env . SCRAWL_TWITTER_SECRET ||
404- ! process . env . SCRAWL_TWITTER_TOKEN_KEY ||
405- ! process . env . SCRAWL_TWITTER_TOKEN_SECRET ) {
406- console . log ( 'scrawl: You must set the following environment variables ' +
407- 'for twitter\nposting to work: SCRAWL_TWITTER_CONSUMER_KEY, ' +
408- 'SCRAWL_TWITTER_SECRET,\nSCRAWL_TWITTER_TOKEN_KEY, ' +
409- 'SCRAWL_TWITTER_TOKEN_SECRET.' ) ;
410- return callback ( ) ;
411- }
412- // create the twitter client
413- var twitter = new Twitter ( {
414- consumer_key : process . env . SCRAWL_TWITTER_CONSUMER_KEY ,
415- consumer_secret : process . env . SCRAWL_TWITTER_SECRET ,
416- access_token_key : process . env . SCRAWL_TWITTER_TOKEN_KEY ,
417- access_token_secret : process . env . SCRAWL_TWITTER_TOKEN_SECRET
418- } ) ;
419-
420- // get the tweet text
421- console . log ( 'scrawl: Creating new tweet.' ) ;
422- var prompt = require ( 'prompt' ) ;
423- prompt . start ( ) ;
424- prompt . get ( {
425- properties : {
426- message : {
427- description : 'Enter the tweet contents (what was discussed)' ,
428- pattern : / ^ .{ 4 , 100 } $ / ,
429- message : 'The message must be between 4-100 characters.'
430- }
431- }
432- } , function ( err , results ) {
433- // construct the tweet
434- var tweet = Mustache . render ( TWITTER_BODY ,
435- { group : scrawl . group ,
436- message : results . message , gDate,
437- minutes_base_url : scrawl . minutes_base_url } ) ;
438-
439- // send the tweet
440- twitter . updateStatus ( tweet , function ( data ) {
441- console . log ( 'scrawl: Tweet sent:' , data . text ) ;
442- callback ( ) ;
443- } ) ;
444- } ) ;
445- } else {
446- callback ( ) ;
447- }
448396} ] , function ( err ) {
449397 // check to ensure there were no errors
450398 if ( err ) {
0 commit comments