Skip to content
This repository has been archived by the owner on Aug 11, 2021. It is now read-only.

Where to fetch an up-to-date list of recently modified packages? #242

Open
lukehorvat opened this issue Aug 12, 2015 · 6 comments
Open

Where to fetch an up-to-date list of recently modified packages? #242

lukehorvat opened this issue Aug 12, 2015 · 6 comments

Comments

@lukehorvat
Copy link

(I hope this is the right place to post issues regarding the registry's main CouchDB.)

I'm trying to fetch an up-to-date list of the most recently updated npm packages, identical to what is currently shown on the https://npmjs.com homepage.

A couple of different queries I've tried:

But as you can see, the very last updated/modified package is atomdoc, all the way back on Aug 26th 2014. Is there any way I can get a more up-to-date list, short of scraping https://npmjs.com?

@julianlam
Copy link

I am also interested in this, as my method of retrieving this data stopped working about two weeks ago.

I used to ping https://registry.npmjs.com/-/_list/index/modified?startkey=1439480888643, but the route returns empty data now (with a 200 OK code too, which is just... great).

julianlam added a commit to NodeBB/nodebb-package-manager that referenced this issue Aug 18, 2015
Instead of using the broken hourly partial-sync, we'll just do an
exhaustive initial sync daily at midnight.

It sucks to do this against npm, but their API broke and I've not
received a response in a week.

re: npm/npm-registry-couchapp#242
@julianlam
Copy link

Hey, I think I found something...

, { from: "/-/all/since", to:"_list/index/modified", method: "GET" }

☝️ This line seems to suggest that /-/all/since was deprecated and is automatically rewritten to _list/index/modified, so on a whim I tried the old url, and got 301'd to /-/all/static/today.json

So that's progress, I think, and definitely something I can use now...

https://registry.npmjs.org/-/all/static/today.json

@eirikb
Copy link

eirikb commented Jan 17, 2016

An option is to use https://skimdb.npmjs.com/registry/_changes?since=<seq>, ref http://docs.couchdb.org/en/1.6.1/api/database/changes.html .
This should allow include_docs=true, but doesn't work for me.

@julianlam
Copy link

@eirikb Yes, I ended up switching to that method shortly afterwards, as that is the "official" way to stay up to date.

@eirikb
Copy link

eirikb commented Jan 17, 2016

@julianlam Do you have an example url which includes the documents?

I'm tempted to use ../static/today.json since I'm going to periodically update once a day.

@soldair
Copy link

soldair commented Jan 19, 2016

I would recommend using a follower if you can. Here is module https://github.com/npm/concurrent-couch-follower that we use for processes like this.

Just make sure to pass include_docs:true and set the database to skimdb.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants