Although not heavily commented, we hope the source code itself should provide some insight into how things work.
The simple client is our console based multi-OS proof of concept client.
Available commands: list [num] List stored playlists rename [num] [string] Rename playlist collab [num] Toggle playlist collaboration search [string] Search for [string] or get next 100 results artist [num] Show information about artist for track [num] album [num] List album for track [num] uri [string] Display info about Spotify URI portrait [num] Save artist portrait to portrait.jpg play [num] Play track [num] in the last viewed list playalbum [num] Play album for track [num] stop, pause, resume Control playback info Details about your account and current connection help This text quit Quit > list 1: I <3 techno in the morning 58 christ0ph 2: Electrogirls 13 nshearing 3: Binary Beats 36 vengo > list 2 1: Crimewave (Crystal Castles vs. Health) 4:18 Crystal Castles 2: Paris Is Burning 3:47 Ladyhawke 3: Stuck On Repeat 3:19 Little Boots 4: Little Bit 4:33 Lykke Li [ .. snip .. ] > search foo Artists found (9): Foo Fighters Kung Foo [ .. snip .. ] Albums found (4): Foo Foo Foo Fighters [ .. snip .. ] Tracks found (100/195): 1: This Is a Call 3:53 Foo Fighters 2: Big Me 2:12 Foo Fighters [ .. snip .. ]
The gateway was implemented to support a HTTP REST API. The idea is to have the gateway running in the background and keep logged in sessions to Spotify alive. The frontend (HTTP) part can easily be implemented by making your favorite web scripting language talk to the backend over a socket.
The gateway uses a text-based protocol to ease testing and integration with other software.
The output format looks like this:
<HTTP-style error code> <payload length> <OK/WARN/ERROR> <description>\n
[eventual payload data, as long as "payload length" says]
Here's an example.
this is going to fail 501 0 WARN Invalid command 'this is going to fail' login foouser barpassword 200 0 OK Login successful country 200 2 OK Assigned country below SE
"The Streisand effect is a phenomenon on the Internet where an attempt to censor or remove a piece of information backfires, causing the information to be widely publicized."
#hack.se demo scene division