This file contains 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 | |
BEGIN { | |
unshift(@INC, | |
'home/me/cgi-bin/lib' # absolute path | |
}; | |
use Mojolicious::Lite; | |
my $count = 0; |
This file contains 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; | |
our $counter = 0; | |
app->secret('kashkgfsjgnscjzgang'); | |
app->config({ | |
hypnotoad => { | |
listen => ['http://*:8765'], |
This file contains 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 Mojo::URL; | |
my $url = Mojo::URL->new('http://example.com/?action=test'); | |
my $url2 = Mojo::URL->new('broker.js?foo=bar'); | |
$url->path($url2->path); | |
$url->query($url2->query); | |
# http://example.combroker.js?foo=bar | |
# ^ ??? |
This file contains 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 Mojo; | |
my $ua = Mojo::UserAgent->new; | |
$ua->max_redirects(5); | |
my $base_url ='http://api.powerhousemuseum.com/api/v1/category/xml/'; | |
my $api_key = 'xxx'; | |
my $base_rest_url = Mojo::URL->new($base_url)->query({ api_key => $api_key}); |
This file contains 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 Mojo; | |
use Mojo::Base -strict; | |
my $ua = Mojo::UserAgent->new; | |
$ua->max_redirects(5); | |
my $domain = 'http://api.powerhousemuseum.com'; | |
my $base_url ="$domain/api/v1/category/xml/"; | |
my $api_key = '8fbb61ea34d6f5d'; |
This file contains 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
# test.pl: | |
#!/usr/bin/env perl | |
use TestApp; | |
TestApp->start; | |
# TestApp.pm: | |
package TestApp; | |
use Mojo::Base 'Mojolicious'; |
OlderNewer