1
0
Fork 0
mirror of https://github.com/perlbot/perlbuut-pastebin synced 2025-06-07 14:17:26 -04:00

prelim channel and language api, not documented

This commit is contained in:
Ryan Voots 2017-04-23 19:01:25 -04:00
parent 4d9ca6c6fb
commit 32a5d5115a

34
app.pl
View file

@ -234,5 +234,39 @@ post '/api/v1/paste' => sub {
#$c->render(text => "post accepted! $id");
};
get '/api/v1/languages' => sub {
my $c=shift;
$c->render(json => {languages => [
{name => "perl", description => "Perl (blead/git)"},
{name => "perl4", description => "Perl 4.0.36"},
{name => "perl5.5", description => "Perl 5.5"},
{name => "perl5.6", description => "Perl 5.6"},
{name => "perl5.8", description => "Perl 5.8"},
{name => "perl5.10", description => "Perl 5.10"},
{name => "perl5.12", description => "Perl 5.12"},
{name => "perl5.14", description => "Perl 5.14"},
{name => "perl5.16", description => "Perl 5.16"},
{name => "perl5.18", description => "Perl 5.18"},
{name => "perl5.20", description => "Perl 5.20"},
{name => "perl5.22", description => "Perl 5.22"},
{name => "perl5.24", description => "Perl 5.24"},
{name => "text", description => "Plain text"},
]});
};
get '/api/v1/channels' => sub {
my $c=shift;
$c->render(json => {channels => [
{name => "localhost:perlbot:#perl", description => "Freenode #perl"},
{name => "localhost:perlbot:#perlbot", description => "Freenode #perlbot"},
{name => "localhost:perlbot:#perlcafe", description => "Freenode #perlcafe"},
{name => "localhost:perlbot:#buutbot", description => "Freenode #buubot"},
{name => "localhost:perlbot:##botparadise", description => "Freenode ##botparadise"},
{name => "localhost:perlbot-magnet:#perl", description => "irc.perl.net #perl"},
]});
};
app->start;