/usr/share/perl5/App/Nopaste/Service/Pastie.pm is in libapp-nopaste-perl 1.007-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 | use strict;
use warnings;
package App::Nopaste::Service::Pastie;
# ABSTRACT: Service provider for Pastie - pastie.org
our $VERSION = '1.007';
use parent 'App::Nopaste::Service';
my %languages = (
"bash" => "13",
"c#" => "20",
"c/c++" => "7",
"css" => "8",
"diff" => "5",
"go" => "21",
"html (erb / rails)" => "12",
"html / xml" => "11",
"java" => "9",
"javascript" => "10",
"objective-c/c++" => "1",
"perl" => "18",
"php" => "15",
"plain text" => "6",
"python" => "16",
"ruby" => "3",
"ruby on rails" => "4",
"sql" => "14",
# hidden
"apache" => "22",
"clojure" => "38",
"d" => "26",
"erlang" => "27",
"fortran" => "28",
"haskell" => "29",
"ini" => "35",
"io" => "24",
"lisp" => "25",
"lua" => "23",
"makefile" => "31",
"nu" => "36",
"pascal" => "17",
"puppet" => "39",
"scala" => "32",
"scheme" => "33",
"smarty" => "34",
"tex" => "37",
# aliases
"sh" => "13",
"c" => "7",
"c++" => "7",
"objective-C" => "1",
"objective-C++" => "1",
"plain" => "6",
"raw" => "6",
"rails" => "4",
"html" => "11",
"xml" => "11",
"js" => "10",
"make" => "31",
);
sub uri { 'http://pastie.org/' }
sub fill_form {
my $self = shift;
my $mech = shift;
my %args = @_;
my $lang_id = $languages{"plain text"};
$lang_id = $languages{lc($args{lang})}
if (exists $args{lang} && exists $languages{lc($args{lang})});
$mech->submit_form(
fields => {
"paste[body]" => $args{text},
"paste[authorization]" => 'burger', # set with JS to avoid bots
"paste[restricted]" => $args{private},
"paste[parser_id]" => $lang_id,
},
);
}
sub return {
my $self = shift;
my $mech = shift;
my $prefix ='';
my ($id) = $mech->title =~ /\#(\d+)/;
if (!$id) {
($id) = $mech->content =~ m{http://pastie.org/\d+/wrap\?key=([a-z0-9]+)};
$prefix = 'private/';
}
return (0, "Could not construct paste link.") if !$id;
return (1, "http://pastie.org/$prefix$id");
}
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
App::Nopaste::Service::Pastie - Service provider for Pastie - pastie.org
=head1 VERSION
version 1.007
=head1 SUPPORT
Bugs may be submitted through L<the RT bug tracker|https://rt.cpan.org/Public/Dist/Display.html?Name=App-Nopaste>
(or L<bug-App-Nopaste@rt.cpan.org|mailto:bug-App-Nopaste@rt.cpan.org>).
=head1 AUTHOR
Shawn M Moore, <sartak@gmail.com>
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2008 by Shawn M Moore.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
=cut
|