Skip to content

oysnet/curl-oauth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

INSTALL

cd $TMPDIR
curl -O https://raw.github.com/oxys-net/curl-oauth/master/curl-oauth
chmod a+x curl-oauth
sudo mv curl-oauth /usr/local/bin/
sudo pip install oauth2
cd -

Optional :
  - for json colorized output:
    pip install pygments
  - for https support:
    pip install certifi

START

export API="http://example.com/api/oauth";
curl-oauth --domain example \
  --request-token \
  --consumer-secret Mq4As9xngJzyqQ2vRaYWGF9qRquvyBxI \
  --consumer-key BQNmyk5sAb7m8vSvbA  \
  --request-token-url $API/request_token/ \
  --request-token-callback http://example.com \
  --request-token-authorize-url $API/authorize/
  --request-token-access-token-url $API/access_token/

USAGE

usage: curl-oauth [-h] [--domain DOMAIN] [--list-domains]
                  [--consumer-key CONSUMER_KEY]
                  [--consumer-secret CONSUMER_SECRET] [--token-key TOKEN_KEY]
                  [--token-secret TOKEN_SECRET] [--request-token]
                  [--request-token-url REQUEST_TOKEN_URL]
                  [--request-token-callback REQUEST_TOKEN_CALLBACK]
                  [--request-token-authorize-url REQUEST_TOKEN_AUTHORIZE_URL]
                  [--request-token-access-token-url REQUEST_TOKEN_ACCESS_TOKEN_URL]
                  [--json] [-X HTTP_METHOD] [-H HEADERS] [-d DATA] [-T FILE_NAME] 
                  [-I] [-i] [urls [urls ...]]

A curl like tool with oauth support

positional arguments:
  urls

optional arguments:
  -h, --help            show this help message and exit
  --domain DOMAIN       config domain
  --list-domains        list available domains
  --consumer-key CONSUMER_KEY, -ck CONSUMER_KEY
                        consumer key
  --consumer-secret CONSUMER_SECRET, -cs CONSUMER_SECRET
                        consumer secret
  --token-key TOKEN_KEY, -tk TOKEN_KEY
                        token key
  --token-secret TOKEN_SECRET, -ts TOKEN_SECRET
                        token secret
  --request-token       create new token
  --request-token-url REQUEST_TOKEN_URL
                        request token url
  --request-token-callback REQUEST_TOKEN_CALLBACK
                        request token callback
  --request-token-authorize-url REQUEST_TOKEN_AUTHORIZE_URL
                        request token authorize url
  --request-token-access-token-url REQUEST_TOKEN_ACCESS_TOKEN_URL
                        request token access verify url
  --json                add content type and prettify output (install pygments
                        for colors)
  -X HTTP_METHOD, --request HTTP_METHOD
                        Specify request command to use
  -H HEADERS, --header HEADERS
                        Custom header to pass to server
  -d DATA, --data DATA  HTTP POST data
  -t FILE_NAME, --upload-file FILE_NAME
                        Transfer a file in the body of the http request. 
                        Defaults to PUT.
  -I, --head            Show document info only
  -i, --include         Include protocol headers in the output

Releases

No releases published

Packages

No packages published

Languages