libraries.io icon indicating copy to clipboard operation
libraries.io copied to clipboard

Get all CPAN distributions using scroll API for MetaCPAN

Open zmughal opened this issue 3 years ago • 4 comments

  • Get all CPAN distributions using scroll API for MetaCPAN
  • Revert "Remove CPAN from missing task"

Fixes https://github.com/librariesio/libraries.io/issues/1961.

irb(main)> PackageManager::CPAN.project_names.size
=> 37945

which is roughly what we get from

$ curl -s 'https://fastapi.metacpan.org/v1/release/_search?q=status:latest'  | jq '.hits.total'
37972

Of note, searching for distributions directly gets:

$ curl -s 'https://fastapi.metacpan.org/v1/distribution/_search'  | jq '.hits.total'
42548

I'm not yet sure about why there is a discrepancy.

zmughal avatar May 18 '21 19:05 zmughal

I think I could shorten the code a little bit by using a ternary operator inside the loop. Let me know which approach you prefer!

zmughal avatar May 19 '21 00:05 zmughal

@tiegz , @jsonperl, any thoughts? I believe I’ll need to rebase this now.

If this isn’t the right place or the right issue to tackle, let me know.

zmughal avatar May 28 '21 04:05 zmughal

Fixed the merge conflict.

zmughal avatar May 30 '21 16:05 zmughal

Hello! What can I do to get this merged or, if needed, implement similar functionality in another repository?

zmughal avatar Jun 25 '21 16:06 zmughal