Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: username selection command line option #10

Closed
HamishMacEwan opened this issue Oct 11, 2010 · 8 comments
Closed

Feature Request: username selection command line option #10

HamishMacEwan opened this issue Oct 11, 2010 · 8 comments
Assignees

Comments

@HamishMacEwan
Copy link

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?

@iPhoneDevGuy
Copy link

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')

@thwarted
Copy link

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.

@nublaii
Copy link

nublaii commented Jan 22, 2013

I'm using this workaround and it works perfectly. It should get into the master

@AgoraSecurity
Copy link

+1

@AgoraSecurity
Copy link

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)

@smaeda-ks
Copy link
Collaborator

created #125

@smaeda-ks smaeda-ks self-assigned this Nov 28, 2019
@smaeda-ks smaeda-ks modified the milestone: Target v0.9.4 Nov 29, 2019
smaeda-ks added a commit that referenced this issue Dec 4, 2019
* make username option settable on requests

#10

* update deprecated name
@smaeda-ks
Copy link
Collaborator

This is merged into master.

@smaeda-ks
Copy link
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

7 participants