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
package MT::Test::DebugSQL; | |
use strict; | |
use warnings; | |
our $TRY_TO_EMBED_BIND_ARRAY = 1; | |
my $started = 0; | |
my $start_query_org; | |
sub wrap { |
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
# login | |
my $tx1 = $ua->get($urlbase->clone->path('/admin/login')); | |
my $tx2 = post_form_by_dom($tx1->res->dom->at('#form'), $ua, $urlbase, { | |
'_method' => 'POST', | |
'data[AdminUser][username]' => 'test', | |
'data[AdminUser][password]' => 'test', | |
}); | |
$tx2->res->dom->find('.container td a')->each(sub($a, $) { | |
my $url = $urlbase->clone->parse($a->attr('href')); |
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
use strict; | |
use warnings; | |
use Mojo::IOLoop; | |
use Mojo::Asset::File; | |
my @files; | |
my $id; | |
$id = Mojo::IOLoop->recurring(0, sub { | |
my $file = Mojo::Asset::File->new; | |
$file->add_chunk(''); |
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
<!DOCTYPE html> | |
<title></title> | |
<meta charset="UTF-8" /> | |
<script> | |
var request = new XMLHttpRequest(); | |
request.open('GET', 'http://dev.skyarc.org/cgi-bin/mt/mt-data-api.cgi/v1/sites/1', false); | |
request.send(); | |
</script> | |
</div> |
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
$(function(){ | |
var api = new MT.MTDataAPIYetAnother({ | |
//baseUrl:"http://192.168.56.101:5000/mt-data-api.cgi", | |
//baseUrl:"http://127.0.0.1:5000", | |
baseUrl:<$MTCGIPath$>mt-data-api.cgi, | |
internalLimit: 1000 | |
}); | |
var routes = { |
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
/** | |
* 最新のエントリー一覧 | |
*/ | |
api.listEntries(<$MTBlogID$>, {limit:10}, function(res){ | |
for (idx in res.items) { | |
var item = res.items[idx]; | |
var cont = $(".layouts > .entryContainer").clone(); | |
cont.find(".title").html(item.title); | |
cont.find(".body").html(item.excerpt); | |
$(".main").append(cont); |
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
$(function(){ | |
var api = new MT.MTDataAPIYetAnother({ | |
baseUrl:"<$MTCGIPath$>mt-data-api.cgi", | |
internalLimit: 1000 | |
}); | |
/** | |
* ブログタイトルを表示 | |
*/ |
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 strict; | |
use warnings; | |
use Mojo::UserAgent; | |
my $ua = Mojo::UserAgent->new; | |
$ua->inactivity_timeout(1); | |
$ua->get('http://cpan.org/'); |
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
sub dom { | |
return Mojo::DOM->new(<<EOF); | |
<div id="div1"> | |
A | |
<a>B</a> | |
<a>C</a> | |
<span>D</span> | |
</div> | |
<div id="div2"> | |
E |