Closed edgardmessias closed 7 years ago
@hiqsol , we can use the https://libraries.io/api
Can you check the permission to use?
I just tried a couple of searches... Did you try? Do you find it suitable? I didn't find a way to limit package search to npm/bower. I tried search like q='npm moment' and it gives not really useful results :-/
What do you mean about permissions?
In https://libraries.io/api, you can filter by Bower or NPM using &platforms=<value>
Ex.: Only Bower: https://libraries.io/api/search?q=moment&platforms=Bower
Ex.: Only NPM: https://libraries.io/api/search?q=moment&platforms=NPM
Ex.: Only Bower and NPM: https://libraries.io/api/search?q=moment&platforms=Bower,NPM
Note: Remove /api
to show site.
For sort, add &sort=<value>
, you can sort by relevance(blank value)
, rank
, stars
, dependents_count
, dependent_repos_count
, latest_release_published_at
, contributions_count
and created_at
We can implement the \yii\data\BaseDataProvider
using guzzle
For platforms: https://github.com/librariesio/libraries.io/blob/master/app/controllers/application_controller.rb#L75 For sort: https://github.com/librariesio/libraries.io/blob/master/app/controllers/search_controller.rb#L26
About permission, if the libraries.io allows us to use in the asset-packagist, with a higher rate limit
Current rate limit is 60/request/minute
Cool about platform
filter :) Didn't see it in their doc.
With this feature it looks quite nice to use.
According to the current usage of asset-packagist.org — 60 requests per minute is more then enough :)
If you're about to implement it please consider yii2-hiart, we've developped this library and use it for api interactions very successfully.
I'll start as soon as possible.
Cool! Thank you!
@hiqsol, I done without using yii2-hiart.
I tried with yii2-hiart, but the DataProvider part needs to improve a lot.
Rework the search page to show multiple packages by search.
For bower, use the
search
method inBowerRepository
For npm, implement npms inNpmRegistry
For search field, we can use Buttons with dropdowns, but using the selec field instead of the button.