How to get the top tracks and new release album information from web api or libspotify
? I tried SPToplist
in libspotify
but it wasn't working for me.
Asked
Active
Viewed 644 times
-2

the
- 21,007
- 11
- 68
- 101

user817112
- 11
-
Please be more specific. What did not work? What errors did you get? – Daniel Hedberg Jan 15 '13 at 16:39
-
[SPToplist toplistForCurrentUserInSession:aSession] – user817112 Jan 16 '13 at 09:33
-
is there any web api url to get the top tracks and new releases ? please help – user817112 Jan 16 '13 at 09:34
1 Answers
0
Top tracks
Look at the spshell example provided with libspotify. The toplist.c file has the toplist-specific parts, while spshell.c, spshell_win32.c and spshell_posix.c have the basic event-loop code that you'll need to use libspotify at all. At a minimum you're going to need to:
- Create a session. (For which you'll need an app key.)
- Log in.
- Run an event loop on your main thread to call sp_session_process_events as needed.
- Handle the notify_main_thread callback and use it to wake up your event loop so that it calls sp_session_process_events.
- Call sp_toplist_browse_create to request a toplist, passing it a callback to invoke when the toplist is ready.
- In your callback, you can access the results.
New releases
I think for this you want to do a search for "tag:new". Have a look at search.c in the spshell example. Searching works similarly to browsing toplists.

Weeble
- 17,058
- 3
- 60
- 75