Created
March 11, 2015 22:31
-
-
Save tempire/36fa47983b4cff9a6fc0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env perl | |
| use Mojolicious::Lite; | |
| use POSIX 'strftime'; | |
| my $ua = Mojo::UserAgent->new; | |
| get '/' => sub { | |
| my $c = shift; | |
| $c->delay( | |
| sub { | |
| $ua->get('https://duckduckgo.com/?q=test&format=json' => shift->begin); | |
| }, | |
| sub { | |
| $c->render(json => {results => pop->res->json('/AbstractURL')}); | |
| }, | |
| ); | |
| }; | |
| app->start; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment