twitter / twurl

OAuth-enabled curl for the Twitter API
https://developer.twitter.com
MIT License
1.8k stars 301 forks source link

aliases not working on MacOS 10.11.6 #93

Closed stevej098 closed 4 years ago

stevej098 commented 6 years ago

MacOS 10.11.6: tweeting with alias fails: twurl tweet -d 'status=Testing twurl'

Expected behavior

twurl works with pathnames, no aliases work.

Actual behavior

steve$ twurl -v 0.9.3

steve$ ruby --version ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin15]

steve$ twurl alias h: /1.1/statuses/home_timeline.json tweet: /1.1/statuses/update.json

steve$ twurl h Usage: twurl authorize --consumer-key key --consumer-secret secret twurl [options] /1.1/statuses/home_timeline.json

Supported Commands: accounts, alias, authorize, set

[[snip]]

steve$ twurl -q -d "status=twurl test 3" /1.1/statuses/update.json

[works, posts tweet]

steve$ twurl tweet -d 'status=Testing twurl' Usage: twurl authorize --consumer-key key --consumer-secret secret twurl [options] /1.1/statuses/home_timeline.json

Supported Commands: accounts, alias, authorize, set

Getting started: -T, --tutorial Narrative overview of how to get started using Twurl

Authorization options: -u, --username [username] Username of account to authorize (required) -p, --password [password] Password of account to authorize (required) -c, --consumer-key [key] Your consumer key (required) -s, --consumer-secret [secret] Your consumer secret (required) -a, --access-token [token] Your access token -S, --token-secret Your token secret

Common options: -t, --[no-]trace Trace request/response traffic (default: --no-trace) -d, --data [data] Sends the specified data in a POST request to the HTTP server. -r, --raw-data [data] Sends the specified data as it is in a POST request to the HTTP server. -A, --header [header] Adds the specified header to the request to the HTTP server. -H, --host [host] Specify host to make requests to (default: api.twitter.com) -q, --quiet Suppress all output (default: output is printed to STDOUT) -U, --no-ssl Disable SSL (default: SSL is enabled) -X, --request-method [method] Request method (default: GET) -P, --proxy [proxy] Specify HTTP proxy to forward requests to (default: No proxy) -f, --file [path_to_file] Specify the path to the file to upload -F, --file-field [field_name] Specify the POST parameter name for the file upload data (default: media) -b, --base64 Encode the uploaded file as base64 (default: false) -h, --help Show this message -v, --version Show version

Steps to reproduce the behavior

Followed tutorial.

andypiper commented 6 years ago

Ack, I'm seeing the same thing here (although I think I have some other environmental issues in play as well, unfortunately). I'm running under Ruby 2.1.2. Will see if I can understand what is happening here.

stevej098 commented 6 years ago

The method/function "alias_from_options" is defined in rcfile.rb, but not called in that module.

The only other reference is in request_controller.rb, but that looks to be another Class entirely. options.path ||= OAuthClient.rcfile.alias_from_options(options)

I'd look in the github change log to see more, if I knew how. Sorry for stopping there.

smaeda-ks commented 4 years ago

PR for this fix is here and will be merged into master soon (hopefully). https://github.com/twitter/twurl/pull/114