dgw / sopel-llsif

2 stars 1 forks source link

Supplement or replace Sukutomo API with Kach Again data #2

Closed dgw closed 4 weeks ago

dgw commented 4 years ago

There is a pretty comprehensive data set available at https://kachagain.com/llsif/app/songs.json

It contains a list of "songs" as the only JSON key, where each song contains data like so:

      {
         "name":"Bokura no LIVE Kimi to no LIFE",
         "jp":"僕らのLIVE 君とのLIFE",
         "group":"muse",
         "id":1,
         "length":"2'02\"00",
         "seconds":122,
         "attribute":"smile",
         "data":{
            "easy":{
               "combo":95,
               "bond":13,
               "stars":1
            },
            "normal":{
               "combo":120,
               "bond":25,
               "stars":4
            },
            "hard":{
               "bond":34,
               "combo":181,
               "stars":6
            },
            "expert":{
               "bond":85,
               "combo":348,
               "stars":9
            },
            "master":{
               "bond":191,
               "combo":697,
               "stars":11
            }
         }
      }

That's all the info we need for .sifsong output, with the exception of whether a given song is on "Hits" or "B-sides". It's debatable whether that's truly useful to include in the output.

The main benefit of using Kach Again's JSON instead of the Sukutomo API is ease of caching. This plugin could easily load the JSON file once at startup, or the first time .sifsong is used, and keep it in memory. The file could be persisted to disk, as well, providing resiliency in case of either data source going down, whether temporarily or permanently.

Periodic checks for a newer version wouldn't be too difficult. It might make sense to check for updates on a schedule, and check for an update if a query fails to match any known song (throttled to something like one "failed search" check per hour, of course).

dgw commented 4 years ago

I still kinda like this idea, but Kach Again doesn't appear to provide any card data. Safe to say that if Sukutomo were to go down, this plugin would still lose most of its utility.

dgw commented 4 weeks ago

Revisiting from the future to close as Not Planned. SIF was shut down about 18 months ago.