Slogger
Slogger copied to clipboard
TwitterLogger won't start Safari (default browser)
Hi,
I just recently managed to get Slogger working on my MacBook Pro.
FourSquare and Good Reads are working properly, OmniFocus is mostly working, (I'm trying to figure out how to use the omnifocus_folder_filter properly).
When I try to run Twitter though, Safari never launches, I switched my default to Chrome just to test which also didn't work.
Does anybody have any suggestions...?
Thanks,
Scott
asi1:Slogger-master scottrych$ ./slogger -s Initializing Slogger v2 (2.1.14)... 16:14:10 FoursquareLogger: Getting Foursquare checkins 16:14:11 GoodreadsLogger: Logging read books from Goodreads 16:14:12 OmniFocusLogger: Logging OmniFocus for completed tasks osascript: OpenScripting.framework - scripting addition "/Library/ScriptingAdditions/QXPScriptingAdditions.osax" cannot be used with the current OS because it has no OSAXHandlers entry in its Info.plist. 16:14:12 DayOne: =====[ Saving entry to entries/610FFE265521454E994162F3A5CE155B ] 16:14:14 TwitterLogger: Twitter requires configuration, please run from the command line and follow the prompts
------------- Twitter Configuration --------------
Slogger will now open an authorization page in your default web browser. Copy the code you receive and return here.
Press Enter to continue...
/Library/Ruby/Gems/2.0.0/gems/oauth-0.5.0/lib/oauth/tokens/request_token.rb:29:in build_authorize_url': undefined methodblank?' for nil:NilClass (NoMethodError)
from /Library/Ruby/Gems/2.0.0/gems/oauth-0.5.0/lib/oauth/tokens/request_token.rb:11:in authorize_url' from /Users/scottrych/Downloads/Slogger-master/plugins/twitterlogger.rb:227:indo_log'
from /Users/scottrych/Downloads/Slogger-master/slogger.rb:288:in block in run_plugins' from /Users/scottrych/Downloads/Slogger-master/slogger.rb:275:ineach'
from /Users/scottrych/Downloads/Slogger-master/slogger.rb:275:in run_plugins' from /Users/scottrych/Downloads/Slogger-master/slogger.rb:472:in<top (required)>'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in require' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:inrequire'
from ./slogger:18:in `
It's failing before it gets to the "open" command. What version of Ruby are you running on?
-Brett
On 23 Feb 2016, at 15:18, Scott wrote:
Hi,
I just recently managed to get Slogger working on my MacBook Pro.
FourSquare and Good Reads are working properly, OmniFocus is mostly working, (I'm trying to figure out how to use the omnifocus_folder_filter properly).
When I try to run Twitter though, Safari never launches, I switched my default to Chrome just to test which also didn't work.
Does anybody have any suggestions...?
Thanks,
Scott
asi1:Slogger-master scottrych$ ./slogger -s Initializing Slogger v2 (2.1.14)... 16:14:10 FoursquareLogger: Getting Foursquare checkins 16:14:11 GoodreadsLogger: Logging read books from Goodreads 16:14:12 OmniFocusLogger: Logging OmniFocus for completed tasks osascript: OpenScripting.framework - scripting addition "/Library/ScriptingAdditions/QXPScriptingAdditions.osax" cannot be used with the current OS because it has no OSAXHandlers entry in its Info.plist. 16:14:12 DayOne: =====[ Saving entry to entries/610FFE265521454E994162F3A5CE155B ] 16:14:14 TwitterLogger: Twitter requires configuration, please run from the command line and follow the prompts
------------- Twitter Configuration -------------- Slogger will now open an authorization page in your default web browser. Copy the code you receive and return here. Press Enter to continue... /Library/Ruby/Gems/2.0.0/gems/oauth-0.5.0/lib/oauth/tokens/request_token.rb:29:in
build_authorize_url': undefined methodblank?' for nil:NilClass (NoMethodError) from /Library/Ruby/Gems/2.0.0/gems/oauth-0.5.0/lib/oauth/tokens/request_token.rb:11:inauthorize_url' from /Users/scottrych/Downloads/Slogger-master/plugins/twitterlogger.rb:227:indo_log' from /Users/scottrych/Downloads/Slogger-master/slogger.rb:288:inblock in run_plugins' from /Users/scottrych/Downloads/Slogger-master/slogger.rb:275:ineach' from /Users/scottrych/Downloads/Slogger-master/slogger.rb:275:inrun_plugins' from /Users/scottrych/Downloads/Slogger-master/slogger.rb:472:in<top (required)>' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:inrequire' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:inrequire' from ./slogger:18:in `'
Reply to this email directly or view it on GitHub: https://github.com/ttscoff/Slogger/issues/406
I just checked and I'm running 2.0.0p648.
asi1:~ scottrych$ ruby --version ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin15]
Could it be an issue with OS X 10.11.4 beta 4...?
Do you have twitter_users configured in your slogger_config? That needs to be an array of users (even if it's just one), e.g.:
twitter_users: [ttscoff]
It looks like it's finding a nil variable when trying to build the oauth url, so that's my first guess.
This is what that section looks like within the config file after I reloaded it.
TwitterLogger: description:
- Logs updates and favorites for specified Twitter users
- twitter_users should be an array of Twitter usernames, e.g. [ ttscoff, markedapp ]
- save_images (true/false) determines whether TwitterLogger will look for image urls and include them in the entry
- save_favorites (true/false) determines whether TwitterLogger will look for the favorites of the given usernames and include them in the entry
- save_images_from_favorites (true/false) determines whether TwitterLogger will download images for the favorites of the given usernames and include them in the entry
- save_retweets (true/false) determines whether TwitterLogger will include retweets in the posts for the day
- 'droplr_domain: if you have a custom droplr domain, enter it here, otherwise leave it as d.pr '
- 'digest_timeline: if true will create a single entry for all tweets'
- oauth_token and oauth_secret should be left blank and will be filled in by the plugin TwitterLogger_last_run: Tue Feb 23 16:35:45 2016 twitter_users:
- scottrych save_favorites: true save_images: true save_images_from_favorites: true droplr_domain: d.pr twitter_tags: '#social #twitter' oauth_token: '' oauth_token_secret: '' exclude_replies: true save_retweets: false digest_timeline: true
Sorry, that didn't paste well...
twitter_users:
- scottrych
I cleared the line in the config, updated the config to make sure that the username was cleared. Then added my account back in, updated the config again, ran slogger -s and still got this...
Slogger will now open an authorization page in your default web browser. Copy the code you receive and return here.
Press Enter to continue...
/Library/Ruby/Gems/2.0.0/gems/oauth-0.5.0/lib/oauth/tokens/request_token.rb:29:in build_authorize_url': undefined methodblank?' for nil:NilClass (NoMethodError)
from /Library/Ruby/Gems/2.0.0/gems/oauth-0.5.0/lib/oauth/tokens/request_token.rb:11:in authorize_url' from /Users/scottrych/Downloads/Slogger-master/plugins/twitterlogger.rb:227:indo_log'
from /Users/scottrych/Downloads/Slogger-master/slogger.rb:288:in block in run_plugins' from /Users/scottrych/Downloads/Slogger-master/slogger.rb:275:ineach'
from /Users/scottrych/Downloads/Slogger-master/slogger.rb:275:in run_plugins' from /Users/scottrych/Downloads/Slogger-master/slogger.rb:472:in<top (required)>'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in require' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:inrequire'
from ./slogger:18:in `
Could you try opening up the plugins/twitterlogger.rb file and adding
the following on a new line at line 227, before the gets line?
p request_token
Then run slogger -o twitter (to only parse the twitterlogger plugin)
and see what comes out before the error message.
-Brett
On 24 Feb 2016, at 9:24, Scott wrote:
I cleared the line in the config, updated the config to make sure that the username was cleared. Then added my account back in, updated the config again, ran slogger -s and still got this...
Slogger will now open an authorization page in your default web browser. Copy the code you receive and return here. Press Enter to continue... /Library/Ruby/Gems/2.0.0/gems/oauth-0.5.0/lib/oauth/tokens/request_token.rb:29:in
build_authorize_url': undefined methodblank?' for nil:NilClass (NoMethodError) from /Library/Ruby/Gems/2.0.0/gems/oauth-0.5.0/lib/oauth/tokens/request_token.rb:11:inauthorize_url' from /Users/scottrych/Downloads/Slogger-master/plugins/twitterlogger.rb:227:indo_log' from /Users/scottrych/Downloads/Slogger-master/slogger.rb:288:inblock in run_plugins' from /Users/scottrych/Downloads/Slogger-master/slogger.rb:275:ineach' from /Users/scottrych/Downloads/Slogger-master/slogger.rb:275:inrun_plugins' from /Users/scottrych/Downloads/Slogger-master/slogger.rb:472:in<top (required)>' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:inrequire' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:inrequire' from ./slogger:18:in `'
Reply to this email directly or view it on GitHub: https://github.com/ttscoff/Slogger/issues/406#issuecomment-188304595
That didn't work...
Here's the section of code before and after just in case I didn't put that in the correct spot.
puts "------------- Twitter Configuration --------------"
puts "Slogger will now open an authorization page in your default web browser. Copy the code you receive and return here."
print "Press Enter to continue..."
p request_token
gets
%x{open "#{request_token.authorize_url}"}
puts "#{request_token.authorize_url}"
print "Paste the code you received here: "
code = gets.strip
And this is what happened.
`asi1:Slogger-master scottrych$ ./slogger -o twitter Initializing Slogger v2 (2.1.14)... 11:17:16 TwitterLogger: Twitter requires configuration, please run from the command line and follow the prompts
------------- Twitter Configuration -------------- Slogger will now open an authorization page in your default web browser. Copy the code you receive and return here. Press Enter to continue...#<OAuth::RequestToken:0x007fb7d4a8b6d0 @token="FMLgtAAAAAAAR-szAAABUxQR-74", @secret="4gUhMWRLsicxNTyIbEib2qD49r9zx7f7", @consumer=#<OAuth::Consumer:0x007fb7d3484328 @key="53aMoQiFaQfoUtxyJIkGdw", @secret="Twnh3SnDdtQZkJwJ3p8Tu5rPbL5Gt1I0dEMBBtQ6w", @options={:signature_method=>"HMAC-SHA1", :request_token_path=>"/oauth/request_token", :authorize_path=>"/oauth/authenticate", :access_token_path=>"/oauth/access_token", :proxy=>nil, :scheme=>:header, :http_method=>:post, :oauth_version=>"1.0", :site=>"https://api.twitter.com", :request_endpoint=>nil}, @http_method=:post, @http=#<Net::HTTP api.twitter.com:443 open=false>>, @params={:oauth_token=>"FMLgtAAAAAAAR-szAAABUxQR-74", "oauth_token"=>"FMLgtAAAAAAAR-szAAABUxQR-74", :oauth_token_secret=>"4gUhMWRLsicxNTyIbEib2qD49r9zx7f7", "oauth_token_secret"=>"4gUhMWRLsicxNTyIbEib2qD49r9zx7f7", :oauth_callback_confirmed=>"true", "oauth_callback_confirmed"=>"true"}>
/Library/Ruby/Gems/2.0.0/gems/oauth-0.5.0/lib/oauth/tokens/request_token.rb:29:in build_authorize_url': undefined methodblank?' for nil:NilClass (NoMethodError)
from /Library/Ruby/Gems/2.0.0/gems/oauth-0.5.0/lib/oauth/tokens/request_token.rb:11:in authorize_url' from /Users/scottrych/Downloads/Slogger-master/plugins/twitterlogger.rb:228:indo_log'
from /Users/scottrych/Downloads/Slogger-master/slogger.rb:288:in block in run_plugins' from /Users/scottrych/Downloads/Slogger-master/slogger.rb:275:ineach'
from /Users/scottrych/Downloads/Slogger-master/slogger.rb:275:in run_plugins' from /Users/scottrych/Downloads/Slogger-master/slogger.rb:472:in<top (required)>'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in require' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:inrequire'
from ./slogger:18:in <main>'
That's what it was supposed to do, I just wanted to see if the object was populated.
Any chance you're on a proxy or behind a firewall? Have you run bundle install (your oauth version seems to be different than what the plugin
was built on).
-Brett
On 24 Feb 2016, at 10:21, Scott wrote:
That didn't work...
Here's the section of code before and after just in case I didn't put that in the correct spot.
puts "------------- Twitter Configuration --------------" puts "Slogger will now open an authorization page in your default web browser. Copy the code you receive and return here." print "Press Enter to continue..." p request_token gets %x{open "#{request_token.authorize_url}"} puts "#{request_token.authorize_url}" print "Paste the code you received here: " code = gets.stripAnd this is what happened.
` asi1:Slogger-master scottrych$ ./slogger -o twitter Initializing Slogger v2 (2.1.14)... 11:17:16 TwitterLogger: Twitter requires configuration, please run from the command line and follow the prompts
------------- Twitter Configuration -------------- Slogger will now open an authorization page in your default web browser. Copy the code you receive and return here. Press Enter to continue...#<OAuth::RequestToken:0x007fb7d4a8b6d0 @token="FMLgtAAAAAAAR-szAAABUxQR-74", @secret="4gUhMWRLsicxNTyIbEib2qD49r9zx7f7", @consumer=#<OAuth::Consumer:0x007fb7d3484328 @key="53aMoQiFaQfoUtxyJIkGdw", @secret="Twnh3SnDdtQZkJwJ3p8Tu5rPbL5Gt1I0dEMBBtQ6w", @options={:signature_method=>"HMAC-SHA1", :request_token_path=>"/oauth/request_token", :authorize_path=>"/oauth/authenticate", :access_token_path=>"/oauth/access_token", :proxy=>nil, :scheme=>:header, :http_method=>:post, :oauth_version=>"1.0", :site=>"https://api.twitter.com", :request_endpoint=>nil}, @http_method=:post, @http=#<Net::HTTP api.twitter.com:443 open=false>>, @params={:oauth_token=>"FMLgtAAAAAAAR-szAAABUxQR-74", "oauth_token"=>"FMLgtAAAAAAAR-szAAABUxQR-74", :oauth_token_secret=>"4gUhMWRLsicxNTyIbEib2qD49r9zx7f7", "oauth_token_secret"=>"4gUhMWRLsicxNTyIbEib2qD49r9zx7f7", :oauth_callback_confirmed=>"true", "oauth_callback_confirmed"=>"true"}>
/Library/Ruby/Gems/2.0.0/gems/oauth-0.5.0/lib/oauth/tokens/request_token.rb:29:in
build_authorize_url': undefined methodblank?' for nil:NilClass (NoMethodError) from /Library/Ruby/Gems/2.0.0/gems/oauth-0.5.0/lib/oauth/tokens/request_token.rb:11:inauthorize_url' from /Users/scottrych/Downloads/Slogger-master/plugins/twitterlogger.rb:228:indo_log' from /Users/scottrych/Downloads/Slogger-master/slogger.rb:288:inblock in run_plugins' from /Users/scottrych/Downloads/Slogger-master/slogger.rb:275:ineach' from /Users/scottrych/Downloads/Slogger-master/slogger.rb:275:inrun_plugins' from /Users/scottrych/Downloads/Slogger-master/slogger.rb:472:in<top (required)>' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:inrequire' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:inrequire' from ./slogger:18:in<main>'
Reply to this email directly or view it on GitHub: https://github.com/ttscoff/Slogger/issues/406#issuecomment-188332042
My Mac isn't running through a Proxy server, but it is behind a corporate firewall.
I just re-ran bundle install just so that I could grab the output for you.
asi1:Slogger-master scottrych$ bundle install
Rubygems 2.0.14.1 is not threadsafe, so your gems will be installed one at a time. Upgrade to Rubygems 2.1.0 or higher to enable parallel gem installation.
Using rake 10.5.0
Using addressable 2.4.0
Using buftok 0.2.0
Using safe_yaml 1.0.4
Using thread_safe 0.3.5
Using diff-lcs 1.2.5
Using digest 0.0.1
Using equalizer 0.0.11
Using multipart-post 2.0.0
Using hpricot 0.8.6
Using simple-rss 1.3.1
Using hashdiff 0.3.0
Using hashie 3.4.3
Using http_parser.rb 0.6.0
Using multi_json 1.11.2
Using json 1.8.3
Using mime-types-data 3.2016.0221
Using mini_portile2 2.0.0
Using multimap 1.1.3
Using oauth 0.5.0
Using rack 1.6.4
Using rmagick 2.13.2
Using rspec-support 3.4.1
Using simple_oauth 0.2.0
Using tilt 2.0.2
Using sqlite3 1.3.11
Using vcr 3.0.1
Using bundler 1.11.2
Using crack 0.4.3
Using descendants_tracker 0.0.4
Using memoizable 0.4.2
Using faraday 0.9.2
Using feed-normalizer 1.5.2
Using http 0.5.1
Using mime-types 3.0
Using nokogiri 1.6.7.2
Using rack-protection 1.5.3
Using rspec-core 3.4.3
Using rspec-expectations 3.4.0
Using rspec-mocks 3.4.1
Using webmock 1.24.1
Using faraday_middleware 0.9.2
Using twitter 5.3.1
Using twitter_oauth 0.4.94
Using sinatra 1.4.7
Using rspec 3.4.0
Using instagram 1.1.6
Bundle complete! 15 Gemfile dependencies, 47 gems now installed.
Use bundle show [gemname] to see where a bundled gem is installed.
I'm not sure what's causing the error. I'll have to test with a clean install, I guess, but I don't have any immediate solutions. Something must have changed in the Twitter oauth gem at some point.
On 24 Feb 2016, at 11:40, Scott wrote:
My Mac isn't running through a Proxy server, but it is behind a corporate firewall.
I just re-ran bundle install just so that I could grab the output for you.
asi1:Slogger-master scottrych$ bundle install Rubygems 2.0.14.1 is not threadsafe, so your gems will be installed one at a time. Upgrade to Rubygems 2.1.0 or higher to enable parallel gem installation. Using rake 10.5.0 Using addressable 2.4.0 Using buftok 0.2.0 Using safe_yaml 1.0.4 Using thread_safe 0.3.5 Using diff-lcs 1.2.5 Using digest 0.0.1 Using equalizer 0.0.11 Using multipart-post 2.0.0 Using hpricot 0.8.6 Using simple-rss 1.3.1 Using hashdiff 0.3.0 Using hashie 3.4.3 Using http_parser.rb 0.6.0 Using multi_json 1.11.2 Using json 1.8.3 Using mime-types-data 3.2016.0221 Using mini_portile2 2.0.0 Using multimap 1.1.3 Using oauth 0.5.0 Using rack 1.6.4 Using rmagick 2.13.2 Using rspec-support 3.4.1 Using simple_oauth 0.2.0 Using tilt 2.0.2 Using sqlite3 1.3.11 Using vcr 3.0.1 Using bundler 1.11.2 Using crack 0.4.3 Using descendants_tracker 0.0.4 Using memoizable 0.4.2 Using faraday 0.9.2 Using feed-normalizer 1.5.2 Using http 0.5.1 Using mime-types 3.0 Using nokogiri 1.6.7.2 Using rack-protection 1.5.3 Using rspec-core 3.4.3 Using rspec-expectations 3.4.0 Using rspec-mocks 3.4.1 Using webmock 1.24.1 Using faraday_middleware 0.9.2 Using twitter 5.3.1 Using twitter_oauth 0.4.94 Using sinatra 1.4.7 Using rspec 3.4.0 Using instagram 1.1.6 Bundle complete! 15 Gemfile dependencies, 47 gems now installed. Use
bundle show [gemname]to see where a bundled gem is installed.
Reply to this email directly or view it on GitHub: https://github.com/ttscoff/Slogger/issues/406#issuecomment-188372223
No problem, I'll keep checking on it occasionally to see if I can get it to work.
Thanks for your help with this.