anjanms / DubAPI

A Node.js API for creating queup.net bots.
MIT License
20 stars 10 forks source link

Room playlist history #31

Open FranciscoG opened 8 years ago

FranciscoG commented 8 years ago

Was wondering if you could add fetching Room playlist history with the option of choosing how many pages of history (with max limit of course)

This is the API endpoint for retrieving Room history https://api.dubtrack.fm/room/%RID%/playlist/history?page=##

Each page returns an array of 20 length

It would be cool if I could so something like this:

bot.getRoomHistory(5, callback); // because it would be very very async of course

and that would return 5 pages of history, so an array of 100 length.

14 pages of history is about ~24 hours of playlist history in a room where everyone is playing average 3-6min songs. (array length of 280)

not super important, just something that would be nice

FranciscoG commented 8 years ago

I have my own temporary extension for this

https://github.com/FranciscoG/DerpyBot/blob/dev/bot/extend/getRoomHistory.js

and I added it to the prototype before I instantiate the lib https://github.com/FranciscoG/DerpyBot/blob/dev/bot/index.js#L15