Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 37 lines (27 sloc) 0.576 kb
ff7a10d @kappa Import Dancer skeleton
authored
1 package cpanhubble;
2 use Dancer;
3
8da717f @kappa First shot at actual web iface
authored
4 use lib './lib';
5 use CpanHub;
6 use AnyEvent;
7
ff7a10d @kappa Import Dancer skeleton
authored
8 get '/' => sub {
9 template 'index';
10 };
11
8da717f @kappa First shot at actual web iface
authored
12 get '/search' => sub {
13 my ($cpan, $gh);
14
15 my $cv = AnyEvent->condvar;
16 $cv->begin;
17 cpan_search_req(params->{q}, sub {
18 $cpan = $_[0];
19 $cv->end;
20 });
21
22 $cv->begin;
23 github_search_req(params->{q}, sub {
24 $gh = $_[0];
25 $cv->end;
26 });
27
28 $cv->recv;
29
30 my $res =
31 merge_cpan_and_github($cpan, $gh);
32
33 template 'serp', { res => $res, query => params->{q} };
34 };
35
ff7a10d @kappa Import Dancer skeleton
authored
36 true;
Something went wrong with that request. Please try again.