-
-
Save satomacoto/5571137b64a0f87d0122fb86741773c7 to your computer and use it in GitHub Desktop.
Revisions
-
apolloclark renamed this gist
Dec 22, 2015 . 1 changed file with 12 additions and 11 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -19,17 +19,6 @@ sudo apt-get install jq # example, fully written curl --get 'https://api.twitter.com/1.1/search/tweets.json' @@ -53,3 +42,15 @@ curl # example, as one-liner curl -G 'https://api.twitter.com/1.1/search/tweets.json' -d 'q=%23archaeology' -h "$(cat ~/twitter_api)" -s # do a search with curl, pretty print with jq # @see http://curl.haxx.se/docs/manpage.html # @see https://dev.twitter.com/rest/public/search curl -s -H "$(cat ~/twitter_api)" -d 'q=%40twitterapi' -G 'https://api.twitter.com/1.1/search/tweets.json' | jq '.' # do a search, print tweet text curl -s -H "$(cat ~/twitter_api)" -d 'q=%40twitterapi' -G 'https://api.twitter.com/1.1/search/tweets.json' | jq '.statuses[].text' -
apolloclark revised this gist
Dec 22, 2015 . 1 changed file with 7 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,6 +12,13 @@ Authorization: OAuth oauth_consumer_key="XXXXXX", oauth_nonce="11111111", oauth_ # @see https://stedolan.github.io/jq/manual/ sudo apt-get install jq # test requests # @see https://dev.twitter.com/rest/tools/console # do a search with curl, pretty print with jq # @see http://curl.haxx.se/docs/manpage.html # @see https://dev.twitter.com/rest/public/search -
apolloclark revised this gist
Dec 22, 2015 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,7 +12,8 @@ Authorization: OAuth oauth_consumer_key="XXXXXX", oauth_nonce="11111111", oauth_ # @see https://stedolan.github.io/jq/manual/ sudo apt-get install jq # do a search with curl, pretty print with jq # @see http://curl.haxx.se/docs/manpage.html # @see https://dev.twitter.com/rest/public/search curl -s -H "$(cat ~/twitter_api)" --data 'q=%40twitterapi' --get 'https://api.twitter.com/1.1/search/tweets.json' | jq '.' -
apolloclark revised this gist
Dec 22, 2015 . 1 changed file with 34 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,16 +1,47 @@ # create an account, create an app # @see https://apps.twitter.com/ # retrieve the access tokens # @see https://dev.twitter.com/oauth/reference/post/oauth2/token # create the file ~/twitter_api nano ~/twitter_api Authorization: OAuth oauth_consumer_key="XXXXXX", oauth_nonce="11111111", oauth_signature="XXXXXX", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1450728725", oauth_token="99999-XXXXXX", oauth_version="1.0" # install JQ # @see https://stedolan.github.io/jq/manual/ sudo apt-get install jq # do a search, pretty print with jq # @see https://dev.twitter.com/rest/public/search curl -s -H "$(cat ~/twitter_api)" --data 'q=%40twitterapi' --get 'https://api.twitter.com/1.1/search/tweets.json' | jq '.' # do a search, print tweet text curl -s -H "$(cat ~/twitter_api)" --data 'q=%40twitterapi' --get 'https://api.twitter.com/1.1/search/tweets.json' | jq '.statuses[].text' # example, fully written curl --get 'https://api.twitter.com/1.1/search/tweets.json' --data '&q=%23archaeology' --header ''Authorization: OAuth oauth_consumer_key="AAAA", oauth_nonce="9999", oauth_signature="AAAA", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1450742465", oauth_token="9999-AAAA", oauth_version="1.0"' --silent # example, loading auth headers from file curl --get 'https://api.twitter.com/1.1/search/tweets.json' --data 'q=%23archaeology' --header "$(cat ~/twitter_api)" --silent # example, using option short-hand curl -G 'https://api.twitter.com/1.1/search/tweets.json' -d 'q=%23archaeology' -h "$(cat ~/twitter_api)" -s # example, as one-liner curl -G 'https://api.twitter.com/1.1/search/tweets.json' -d 'q=%23archaeology' -h "$(cat ~/twitter_api)" -s -
apolloclark revised this gist
Dec 21, 2015 . 1 changed file with 8 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,12 +1,16 @@ # create an account, create an app https://apps.twitter.com/ # retrieve the access tokens https://dev.twitter.com/oauth/reference/post/oauth2/token # create the file ~/twitter_api nano ~/twitter_api Authorization: OAuth oauth_consumer_key="XXXXXX", oauth_nonce="11111111", oauth_signature="XXXXXX", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1450728725", oauth_token="99999-XXXXXX", oauth_version="1.0" # install JQ sudo apt-get install jq # do a search, pretty print with jq # @see https://dev.twitter.com/rest/public/search curl -s -H "$(cat ~/twitter_api)" --data 'q=%40twitterapi' --get 'https://api.twitter.com/1.1/search/tweets.json' | jq '.' -
apolloclark revised this gist
Dec 21, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,4 +9,4 @@ Authorization: OAuth oauth_consumer_key="XXXXXX", oauth_nonce="11111111", oauth_ # do a search # @see https://dev.twitter.com/rest/public/search curl -s -H "$(cat ~/twitter_api)" --get --data 'q=%40twitterapi' 'https://api.twitter.com/1.1/search/tweets.json' | jq '.' -
apolloclark revised this gist
Dec 21, 2015 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,9 +2,11 @@ # retrieve the access tokens, here: https://dev.twitter.com/oauth/reference/post/oauth2/token # create the file ~/twitter_api nano ~/twitter_api Authorization: OAuth oauth_consumer_key="XXXXXX", oauth_nonce="11111111", oauth_signature="XXXXXX", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1450728725", oauth_token="99999-XXXXXX", oauth_version="1.0" # do a search # @see https://dev.twitter.com/rest/public/search curl -H "$(cat ~/twitter_api)" --get --data 'q=%40twitterapi' 'https://api.twitter.com/1.1/search/tweets.json' -
apolloclark revised this gist
Dec 21, 2015 . 1 changed file with 6 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,10 @@ # create an account, get the API access keys # retrieve the access tokens, here: https://dev.twitter.com/oauth/reference/post/oauth2/token # create the file ~/twitter_api nano ~/twitter_api Authorization: OAuth oauth_consumer_key="XXXXXX", oauth_nonce="11111111", oauth_signature="XXXXXX", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1450728725", oauth_token="99999-XXXXXX", oauth_version="1.0" # do a search curl --get 'https://api.twitter.com/1.1/search/tweets.json' --data 'q=%40twitterapi' --header "$(cat ~/twitter_api)" -
apolloclark created this gist
Dec 21, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,6 @@ # create an account, get the API access keys # ~/twitter_api curl --get 'https://api.twitter.com/1.1/search/tweets.json' --data 'q=%40twitterapi' --header "$(cat ~/twitter_api)"