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
MOJO_MAX_REDIRECTS=0 perl -Mojo -E 'say h(shift)->headers->location' http://yandex.ru |
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
<!-- Applifto Smart Banners code, insert after <body> --> | |
<script type="text/javascript" src="http://www.applifto.ru/info/smart-banners.js"></script> | |
<!-- Baby DJ Smart Banners code, insert after <body> --> | |
<script type="text/javascript" src="http://www.applifto.ru/info/smart-banners.js?name=babydj"></script> |
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
perl -Mojo -E 'say g(shift, {"User-Agent" => "Mozilla/5.0 (iPad; CPU OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A403 Safari/8536.25"})->dom->find("meta")' \ | |
https://mobile.twitter.com/sharifulin | |
<meta content="yes" name="apple-mobile-web-app-capable" /> | |
<meta content="app-id=333903271, app-argument=twitter://user?screen_name=sharifulin, affiliate-data=partnerId=30&siteID=UkOLawSuc90" name="apple-itunes-app" /> | |
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" id="viewport" name="viewport" /> |
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 common::sense; | |
use lib qw(../.. /tk/lib /tk/mojo2/lib); | |
use ojo; | |
use Util; | |
use Unicode::Normalize 'NFD'; | |
use Data::Dumper; | |
my $conf = { |
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
$list = [ | |
grep { | |
my $what; | |
$what->{retweet} = !!$_->{retweeted_status}; | |
$what->{reply } = !!$_->{in_reply_to_user_id_str}; | |
$what->{tweet } = !$what->{retweet} && !$what->{reply}; | |
warn qq(It's tweet "$what->{tweet}", reply "$what->{reply}", retweet "$what->{retweet}": $_->{text}\n); | |
my $yes; |
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 strict; | |
use lib 'lib'; | |
use Mojo::DOM; | |
use Test::More tests => 9; | |
my $dom = Mojo::DOM->new('<div> <ul> <li> Text <ul> <li>abc </li>def </ul> </li> </ul> </div>'); | |
my $find; |
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
use Mojolicious::Lite; | |
get '/tasks' => sub { | |
my $self = shift; | |
$self->stash( | |
tasks => [ | |
map { [ split /\s+/ ] } | |
split /\n/, qx(ps axh -o comm,stat,\%cpu,nice,pid,rss,user) | |
] |
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 common::sense; | |
# BEGIN { $ENV{MOJO_USERAGENT_DEBUG}++ }; | |
use Mojo::IOLoop; | |
use Mojo::UserAgent; | |
use Mojo::Util 'b64_encode'; | |
use MongoDB; |
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 common::sense; | |
use Mojo::IOLoop; | |
use Mojo::UserAgent; | |
use MongoDB; | |
use Data::Dumper; | |
my $ua = Mojo::UserAgent->new; |
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
# сходу написал так, но завелось только на 3000 (дефолтном порту) | |
app->start('daemon', '--listen http://*:5000'); | |
# затем так | |
app->start('daemon', listen => 'http://*:5000'); | |
# посмотрел Mojo::Server::Daemon | |
app->start('daemon', listen => ['http://*:5000']); | |
# и даже так попробовал |