Comments (6)
This would be the feed to use: http://cpan.cpantesters.org/modules/01modules.mtime.rss
from metacpan-api.
File::Rsync::Mirror::Recent and Linux::Inotify2 could be useful for this as well.
from metacpan-api.
We could write a simple IRC bot that sits in irc.freenode.net/perl and waits for GumbyPAN to announce new releases (or we use https://github.com/bingos/gumbypan directly). When there is a upload, we fire up File::Rsync::Mirror::Recent and get the latest and greatest releases.
I think this is the most lightweight and OS independent approach.
My idea is that we add a "queue" index to elasticsearch. Every time there is an upload to pause, the irc bot adds the name of the release to the queue. A worker checks the queue periodically and indexes the tarball, if the file exists in the local cpan mirror. Otherwise wait until the rsync process got the files.
This should give us a nice ~5 min delay from upload to index.
from metacpan-api.
Or we do this instead of the irc bot:
use AnyEvent::FriendFeed::Realtime;
my $done = AnyEvent->condvar;
my $client = AnyEvent::FriendFeed::Realtime->new(
request => "/feed/cpan",
on_entry => sub {
my $entry = shift;
$entry->{body} =~ /href="(.*?)"/;
my $file = $1;
# push to queue
},
on_error => sub {
warn "ERROR: $_[0]";
$done->send;
},
);
$done->recv;
from metacpan-api.
I implemented the above in my fork:
https://github.com/monken/cpan-api/blob/master/lib/MetaCPAN/Script/Watcher.pm
It forks a new perl process that indexes the release. This is pretty much as fast as you can update the index.
See http://api.netcubed.de:5000/release/_search?q=*&sort=date:desc&pretty=true&fields=name,author,date
from metacpan-api.
I think if we used the new faster mirroring setup and File::ChangeNotify, it would make local.metaCPAN trivial to implement. Your own mirror is indexed as the files appear and the same goes for your own DarkPAN. It would be a pretty cool setup to have your own custom packages show up in the index shortly after copying them over to the correct directory.
from metacpan-api.
Related Issues (20)
- App::Yabsm not being detected by MetaCPAN after changing version scheme HOT 15
- Update Module::Faker dependency
- api: /cve/release/ returns wrong matches HOT 1
- Distribution name should be treated case insensitively HOT 1
- page_size has no effect on the result HOT 3
- Result is returned with content-type `text/html` HOT 1
- POST /v1/author/{author} and join
- Favorite Leaderboard missing total value in result HOT 1
- File mapping pod_lines property type ought to be array HOT 2
- Difference of output between explorer and actual API HOT 3
- `/v1/rating` returns property `author` and `release` with value `PLACEHOLDER` for all results HOT 1
- Wrong order of arguments for method `all_by_author` HOT 10
- Endpoint `/v1/release/files_by_category` is unexpectedly sensitive to the `Content-Type` submitted
- `/release/by_author` is missing a `from` or `page` option HOT 2
- Missing `user` ID in CPAN accounts HOT 5
- Inconsistent result when using `join`
- Query to endpoint `/package` returns sometimes `version` property with string value of `undef`
- Field 'maturity' in /release/recent API end point HOT 3
- search.cpan.org/api/dist/perl does not list perl 5.26.3
- Getting `download_url` for a specific older release of Perl
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from metacpan-api.