Module talk:Used by

From mediawiki.org
Latest comment: 1 month ago by MyWikis-JeffreyWang in topic Loading data from our own data sources?

Loading data from our own data sources?[edit]

MyWikis maintains our own data source for the extensions that are available on our platform. It's automatically updated whenever we update our collection of extensions. You can find it here: https://selfservicebackend.mywikis.net/extensions/

How can we get this data loaded onto this module's dataset without having to do manual processing? Is it possible for us to make a page like Module:Used by/mywikisdata.json and be able to copy-paste the data from there each time we want to make an update? (Ideally, the data could be dynamically synced, but that's perhaps too much to ask for at this point.) Then, the module could be updated to load our data separately from other services's.

We'd much prefer to use our own schema so we don't have to manually update the data.json file. MyWikis-JeffreyWang (talk) 08:04, 24 July 2023 (UTC)Reply

@MyWikis-JeffreyWang: sorry, didn't see this until now. We could have the Lua module support checking individual JSON files for each wiki farm, if that's what people want? I personally kind of like having one JSON file for simplicity; I think you could have a bot pretty easily just update the MyWikis list every so often from your own file. Legoktm (talk) 18:09, 15 January 2024 (UTC)Reply
That's another possible idea that we could entertain. I agree that having one JSON is better for maintainability. At the same time, having accurate data is also important. Since MyWikis already has an authoritative public data source in JSON of our extensions available, I figured it'd be more faithful to stick to that. The reason I proposed using a different JSON file was because we could write a separate Lua parsing script that's specifically adapted to our own schema (which was developed years before the Used by module was created), and then a bot can easily copy and replace that whole page's contents rather than having to find the appropriate JSON entry in the main file and just replace that little bit. There's a lot less room for error and it's easier for us to develop. But of course, having two parsing scripts in Lua makes things more fragmented.
Let me think about it a bit more and I'll see what we'll end up doing (if we have the time for this).
Thanks for getting back to me! MyWikis-JeffreyWang (talk) 07:52, 7 March 2024 (UTC)Reply