Raku / modules.raku.org

Source code for modules.raku.org - Raku module listing
https://modules.raku.org/
Artistic License 2.0
27 stars 27 forks source link

Where is the metadata for each module? #109

Closed JJ closed 6 years ago

JJ commented 6 years ago

I'd like to obtain that data for the Perl6::Ecosystem module.

zoffixznet commented 6 years ago

The "api" is somewhat ad-hoc right now, but you can get it through the search page by giving the name of a dist (not module) and then grepping for the module name in the results: e.g. http://modules.perl6.org/search.json?q=WWW

Some code for how buggable bot does it: https://github.com/zoffixznet/perl6-buggable/blob/3340ca42e2a2da3ff2ddbf869ba86d56e8c5a151/lib/Buggable/Plugin/Eco.pm6#L52-L79

JJ commented 6 years ago

Right, but modules.perl6.org gets it from somewhere, right? I just can't figure it out by looking at the code.

zoffixznet commented 6 years ago

The site fetches META6.json files and reads it from there. It's done by Dist::Source modules for each different dist source we support: https://github.com/perl6/modules.perl6.org/tree/master/lib/ModulesPerl6/DbBuilder/Dist

With list of metas obtained here: https://github.com/perl6/modules.perl6.org/blob/71d4c7965680353ff2b4c6f6bb3b789e09a5f503/lib/ModulesPerl6/DbBuilder.pm#L128-L232

JJ commented 6 years ago

Yep, but it's stored somewhere. I think it's an sqlite database...

zoffixznet commented 6 years ago

http://modules.perl6.org/search.json

JJ commented 6 years ago

Thanks!