-
Notifications
You must be signed in to change notification settings - Fork 2
Home
JSON calls depend on user status (logged in, logged out, blocked etc). JSON objects are passed via POST, using a simple javascript mserver() call. As much as possible, we implement cacheable urls.
mserver(class,method,p,d,successCallback,errorCallback)
examples:
mserver("user","logout","",{},successfunc(), errorfunc())
mserver("muse","get","new",{},successfunc(), errorfunc())
JSON Requests:
-
Login /app/user/login {"email":"[email protected]","pwd":"mypassword"}
-
Logout /app/user/logout
-
Ban songs /app/unlikedsongs/add?song_id=["SONG ID","SONG ID","SONG ID"]
response: "success" = true
- Explore by tag /app/discover/tag
ex: http://stoikov.rollingmuse.com/app/discover/electronic/
response: "songs" = list of songs, each song has the following attributes {"musetype": -2, "title": "A Thing for Me", "artist": "Metronomy", "muse": { "overlap_user": { "has_song": 0, "playlist_overlaps": null, "total_overlaps": 11 }, "tips": 4, "displayName": "Morta_", "avatar": "https://lastfm-img2.akamaized.net/i/u/174s/15608c62ae664d1bcda1483207d0a72e.png", "museID": "aSDiO_g" }, "tag": "electronic", "trendsetter_id": "aQjit8Q", "playcount": 0, "type": 4, "id": "aFs7P5A", "fk_id": "4b6af9d33e14e6aec7d1c78f83f4a5217553a66e"}
- Leaderboard by tag (e.g. tag could be 80s or indie) /app/leaderboard/get/tag
ex: http://stoikov.rollingmuse.com/app/leaderboard/get/electronic
response: "success" = list of songs, each song has the following attributes {"musetype": -2, "title": "A Thing for Me", "artist": "Metronomy", "muse": { "overlap_user": { "has_song": 0, "playlist_overlaps": null, "total_overlaps": 11 }, "tips": 4, "displayName": "Morta_", "avatar": "https://lastfm-img2.akamaized.net/i/u/174s/15608c62ae664d1bcda1483207d0a72e.png", "museID": "aSDiO_g" }, "tag": "electronic", "trendsetter_id": "aQjit8Q", "playcount": 0, "type": 4, "id": "aFs7P5A", "fk_id": "4b6af9d33e14e6aec7d1c78f83f4a5217553a66e"}
- Get muses for logged in user /app/muses/own
ex: http://stoikov.rollingmuse.com/app/muses/own
response: "success" = list of songs, each song has the following attributes {"musetype": -2, "title": "A Thing for Me", "artist": "Metronomy", "muse": { "overlap_user": { "has_song": 0, "playlist_overlaps": null, "total_overlaps": 11 }, "tips": 4, "displayName": "Morta_", "avatar": "https://lastfm-img2.akamaized.net/i/u/174s/15608c62ae664d1bcda1483207d0a72e.png", "museID": "aSDiO_g" }, "tag": "electronic", "trendsetter_id": "aQjit8Q", "playcount": 0, "type": 4, "id": "aFs7P5A", "fk_id": "4b6af9d33e14e6aec7d1c78f83f4a5217553a66e"}
- Get muses (gets the muses for user_id) /app/muses/:user_id
ex: http://stoikov.rollingmuse.com/app/muses/a9xzf5g
response: "success" = list of songs, each song has the following attributes {"musetype": -2, "title": "A Thing for Me", "artist": "Metronomy", "muse": { "overlap_user": { "has_song": 0, "playlist_overlaps": null, "total_overlaps": 11 }, "tips": 4, "displayName": "Morta_", "avatar": "https://lastfm-img2.akamaized.net/i/u/174s/15608c62ae664d1bcda1483207d0a72e.png", "museID": "aSDiO_g" }, "tag": "electronic", "trendsetter_id": "aQjit8Q", "playcount": 0, "type": 4, "id": "aFs7P5A", "fk_id": "4b6af9d33e14e6aec7d1c78f83f4a5217553a66e"}
- Status of the current user, logged in or not etc. /app/user
ex: http://stoikov.rollingmuse.com/app/user
response: "user": { "email": "[email protected]", "followers": 10060, "user_id": "a2_rvXQ", "avatar": "http://graph.facebook.com/10154003794300410/picture?type=square&width=120&height=120", "displayName": "Sasha", "tips": 629, "balance": 148, "type": 1, "campaign_id": null, "songs": 632 }
- Upcount played songs (increase the playcount when a new song is loaded into the player) /app/usersong/upcount/:songID
ex: http://stoikov.rollingmuse.com/app/usersong/upcount/aGAX2QQ
response: "success":true
- Search /app/search/for/:term (general search) /app/search/owned/:term (search for songs that are owned by another user)
ex: http://stoikov.rollingmuse.com/app/search/for/bob%20dylan?limit=20&offset=0
response: "songs": { "avatar": "https://lastfm-img2.akamaized.net/i/u/174s/4b7e17767ae24adcbef7404fd78382f9.png", "song": [ list of songs]}
- Get a list of all playlists for a user /app/playlists/get/ {"uid": :userID}
ex: http://stoikov.rollingmuse.com/app/playlists/get/%7B%22uid%22:a2_rvXQ%7D
response: "playlists" a list of playlists each playlist has the following attributes: { "type": 1, "id": "az74UHA", "num_songs": 80, "name": "electronic" },
- All songs in a user's playlist specified by name /app/playlist/get/ {"userID": :userID, "playlistID": :name}
ex: http://stoikov.rollingmuse.com/app/playlist/get?playlistID=a4OzaWQ&userID=aBPS0Dg
response: "user": { "email": "[email protected]", "followers": 10060, "user_id": "a2_rvXQ", "avatar": "http://graph.facebook.com/10154003794300410/picture?type=square&width=120&height=120", "displayName": "Sasha", "tips": 629, "balance": 148, "type": 1, "campaign_id": null, "songs": 632 }, "songs" a list of songs like { "musetype": -2, "title": "Move If You Wanna", "artist": "MIMS", "muse": { "overlap_user": { "has_song": 1, "playlist_overlaps": null, "total_overlaps": 12 }, "tips": 5, "displayName": "ArsenEatsACat", "avatar": "https://lastfm-img2.akamaized.net/i/u/174s/0b487c7fbe4744f5c45e3ebae8cc8b2e.png", "museID": "arTAkGw" }, "tag": "hip hop", "trendsetter_id": "a2_rvXQ", "playcount": 1, "type": 4, "id": "aGAX2QQ", "fk_id": "" }