#!/bin/sh # # NB I prefer bearer.sh as it checks for number of params and outputs the right syntax for use in a header # # get an app-only auth token (Bearer Token) # pass in consumer key and consumer secret as params # expected JSON response of form {"access_token":"CCCCCCCC","token_type":"bearer"} # # remove | python -m json.tool if no Python installed (or, no need to prettify results) # curl -s -S -u "$1:$2" --data 'grant_type=client_credentials' 'https://api.twitter.com/oauth2/token' | python -m json.tool