Skip to content

Instantly share code, notes, and snippets.

View nettofarah's full-sized avatar

Netto Farah nettofarah

View GitHub Profile
@nettofarah
nettofarah / token_auth.sh
Created November 12, 2012 19:46
token auth
curl --request POST -d "" http://8tracks.com/mixes/14/toggle_like.xml?user_token=1%3B123456789
- or -
curl --header "X-User-Token: 1;123456789" --request POST -d "" http://8tracks.com/mixes/14/toggle_like.xml
@nettofarah
nettofarah / bad_basic_auth_request.sh
Created November 13, 2012 20:50
bad basic auth request
curl -u remi:bad --request POST -d "" http://8tracks.com/mixes/14/toggle_like.xml
@nettofarah
nettofarah / bad_basic_auth_response.xml
Created November 13, 2012 20:51
bad basic auth response
<response>
<logged_in>false</logged_in>
<status>401 Unauthorized</status>
<errors nil="true"></errors>
<notices>
<notice>You must log in to do this.</notice>
</notices>
</response>
@nettofarah
nettofarah / basic_good_auth_request.sh
Created November 13, 2012 20:53
basic good auth request
curl -u remi:good --request POST -d "" http://8tracks.com/mixes/14/toggle_like.xml
@nettofarah
nettofarah / basic_good_auth_response.xml
Created November 13, 2012 20:54
basic good auth response
<response>
<logged_in>true</logged_in>
<status>200 OK</status>
<errors nil="true"></errors>
<notices nil="true"></notices>
...
</response>
@nettofarah
nettofarah / user_signup_request.sh
Created November 16, 2012 16:46
user signup request
curl --header 'X-Api-Key: xxxxxx' --request POST -d "user[login]=remi&user[password]=password&user[email]=remi@8tracks.com&user[agree_to_terms]=1" https://8tracks.com/users.xml
@nettofarah
nettofarah / user_signup_response.xml
Created November 16, 2012 16:47
user signup response
<response>
<status>201 Created</status>
<user-created>true</user-created>
<current-user>
<id>1821436</id>
<login>remi123</login>
<popup-prefs>ask</popup-prefs>
<next-mix-prefs>ask</next-mix-prefs>
<slug>remi123</slug>
<bio-html nil="true"></bio-html>
@nettofarah
nettofarah / gist:4088895
Created November 16, 2012 16:50
find mixes request
curl http://8tracks.com/mixes.xml
@nettofarah
nettofarah / gist:4088898
Created November 16, 2012 16:50
find mixes response
<response>
<id>3</id>
<path>/mix_sets/3</path>
<restful-url>http://8tracks.com/mix_sets/3</restful-url>
<total-entries>326448</total-entries>
<page>1</page>
<per-page>12</per-page>
<next-page>2</next-page>
<previous-page nil="true"></previous-page>
<total-pages>27204</total-pages>
curl http://8tracks.com/mixes.xml?page=2