Created
November 11, 2012 00:11
-
-
Save spacechurro/4053091 to your computer and use it in GitHub Desktop.
rdio
This file contains 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 characters
~/play/rdiorb$ ./rdio-call --consumer-key <key> --consumer-secret <secret> search query=Morrissey types=artist count=1 -i | |
{"query"=>"Morrissey", "types"=>"artist", "count"=>"1"} | |
args: {"query"=>"Morrissey", "types"=>"artist", "count"=>"1"} | |
Called method: search({"query"=>"Morrissey", "types"=>"artist", "count"=>"1"}) : auth= | |
Post to url=/1/ method=search args={"query"=>"Morrissey", "types"=>"artist", "count"=>"1"} | |
{ | |
"status": "ok", | |
"result": { | |
"artist_count": 29, | |
"number_results": 29, | |
"results": [ | |
{ | |
"key": "r85752", | |
"name": "Morrissey", | |
... | |
} | |
] | |
} | |
} | |
./rdio-call --consumer-key qsg9wezwt7pjsc26hmgza73b --consumer-secret F2nGvD2vu6 getAlbumsForArtist artist=r85752 count=1 -i | |
# oauth use | |
1.9.3-p0 :001 > require 'oauth' | |
=> true | |
1.9.3-p0 :002 > consumer = OAuth::Consumer.new(<key>,<secret>, :site => "http://api.rdio.com/1/") | |
1.9.3-p0 :004 > consumer.request(:post, "http://api.rdio.com/1/", nil, {}, {:method => 'search', :types => 'artist', :query => 'Morrissey', :count => 1}).body | |
=> "{\"status\": \"ok\", \"result\": {\"artist_count\": 29, \"number_results\": 29, \"results\": [{\"key\": \"r85752\", \"name\": \"Morrissey\", \"shortUrl\": \"http://rd.io/x/Qi1DEbs\", \"url\": \"/artist/Morrissey/\", \"hasRadio\": true, \"length\": 260, \"baseIcon\": \"artist/no-artist-image-square.png\", \"radioKey\": \"rr85752\", \"icon\": \"http://cdn3.rd.io/artist/no-artist-image-square.png\", \"type\": \"r\", \"topSongsKey\": \"tr85752\"}]}}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment