GSoC 2017: Adding Statistics and Graphs to ListenBrainz

Thanks for the comments, @Zas.

Thank you! :smiley:

I have been thinking of what format json the API endpoints would return and for the stats, that I have proposed, it would be something like this. Suppose we make a request to get a user’s top artists, the json would be:

{
     "user_id": "iliekcomputers",
     "artist_count": 10,
     "payload" : [
          {
              "artist_name": "Kanye West",
              "artist_msid": "msid here",
              "timeframe": "last_week",
              "listen_count": 80
          },
          ...
      ]
 }

Some discussion around the format exactly would be needed before we start with the API endpoints, but I completely agree with making the json format usable by telegraf.
I am not completely sure how to design it so that it can be used by telegraf. Some help here would be appreciated. I will add this format to the draft while more discussion on it takes place. :slight_smile:

I’m not sure how saving the data in influx would help with making stats show listen time instead of listen count. Could you please elaborate on this? It would be really helpful. The problem I came across when thinking of how to implement this is how to get listen times from listen counts. This data is not sent by the user and making requests to the MusicBrainz database would be expensive. Also, I think I may not have explained this idea well enough. I will edit the proposal to fix this. :slight_smile: