Permalink
Browse files

search the recent uploads first, since FriendFeed search index might …

…not be up-to-date
  • Loading branch information...
1 parent 6dcbb9c commit a73ac5906190e972825ec42d5be38059e62a2003 @miyagawa committed Sep 2, 2009
Showing with 7 additions and 5 deletions.
  1. +7 −5 lib/App/CPAN/Fresh.pm
View
@@ -88,11 +88,13 @@ sub inject {
my($self, $dist) = @_;
$dist =~ s/::/-/g;
- my $res = $self->call("/search", { q => "$dist group:cpan" });
- for my $entry (@{$res->{entries}}) {
- my $info = $self->parse_entry($entry->{body}, $entry->{date}) or next;
- if ($info->{dist} eq $dist) {
- return $self->do_inject($info);
+ for my $method ([ "/feed/cpan" ], [ "/search", { q => "$dist group:cpan" } ]) {
+ my $res = $self->call($method->[0], $method->[1]);
+ for my $entry (@{$res->{entries}}) {
+ my $info = $self->parse_entry($entry->{body}, $entry->{date}) or next;
+ if ($info->{dist} eq $dist) {
+ return $self->do_inject($info);
+ }
}
}

0 comments on commit a73ac59

Please sign in to comment.