Closed HamishMacEwan closed 4 years ago
Modifying the file " GemPath /gems/twurl-0.6.3/lib/twurl/oauth_client.rb" in following way (replace line 14 with the 3 lines) solves this issue:
# elsif options.username || (options.command == 'authorize')
# modified by me to have secondary twitter account specified from CLI using -u option
elsif options.username
load_client_for_username(options.username)
elsif (options.command == 'authorize')
I discovered the above patch on my own, as I need this feature also. Not having to change the default before invoking also means you can run two requests simultaneously without a race condition.
I'm using this workaround and it works perfectly. It should get into the master
+1
If it helps someone, I created this small ruby code that helps achieve the goal:
require 'twurl'
path = "/1.1/account/verify_credentials.json?include_entities=false&skip_status=true"
options = Twurl.options.dup
options.command = "get"
options.path = path
options.data = []
client = Twurl::OAuthClient.load_client_for_username(username)
Twurl::RequestController.dispatch(client, options)
This is merged into master.
Hi,
The two step process to ensure the correct username is used (in a script for example):
twurl set default username twurl tweet -d status="why's that?"
Seems a bit awkward. Couldn't -u be used for this or that would be curly?