line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mojolicious::Command::nopaste::Service::debian; |
2
|
1
|
|
|
1
|
|
1006
|
use Mojo::Base 'Mojolicious::Command::nopaste::Service'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
5
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
has description => "Post to paste.debian.net\n"; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
has name => 'anonymous'; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
my %languages = ( |
9
|
|
|
|
|
|
|
"abap" => 1, |
10
|
|
|
|
|
|
|
"ada" => 1, |
11
|
|
|
|
|
|
|
"ahk" => 1, |
12
|
|
|
|
|
|
|
"antlr" => 1, |
13
|
|
|
|
|
|
|
"antlr-as" => 1, |
14
|
|
|
|
|
|
|
"antlr-cpp" => 1, |
15
|
|
|
|
|
|
|
"antlr-csharp" => 1, |
16
|
|
|
|
|
|
|
"antlr-java" => 1, |
17
|
|
|
|
|
|
|
"antlr-objc" => 1, |
18
|
|
|
|
|
|
|
"antlr-perl" => 1, |
19
|
|
|
|
|
|
|
"antlr-python" => 1, |
20
|
|
|
|
|
|
|
"antlr-ruby" => 1, |
21
|
|
|
|
|
|
|
"apacheconf" => 1, |
22
|
|
|
|
|
|
|
"applescript" => 1, |
23
|
|
|
|
|
|
|
"as" => 1, |
24
|
|
|
|
|
|
|
"as3" => 1, |
25
|
|
|
|
|
|
|
"aspx-cs" => 1, |
26
|
|
|
|
|
|
|
"aspx-vb" => 1, |
27
|
|
|
|
|
|
|
"asy" => 1, |
28
|
|
|
|
|
|
|
"awk" => 1, |
29
|
|
|
|
|
|
|
"basemake" => 1, |
30
|
|
|
|
|
|
|
"bash" => 1, |
31
|
|
|
|
|
|
|
"bat" => 1, |
32
|
|
|
|
|
|
|
"bbcode" => 1, |
33
|
|
|
|
|
|
|
"befunge" => 1, |
34
|
|
|
|
|
|
|
"blitzmax" => 1, |
35
|
|
|
|
|
|
|
"boo" => 1, |
36
|
|
|
|
|
|
|
"brainfuck" => 1, |
37
|
|
|
|
|
|
|
"bro" => 1, |
38
|
|
|
|
|
|
|
"c" => 1, |
39
|
|
|
|
|
|
|
"cfengine3" => 1, |
40
|
|
|
|
|
|
|
"cfm" => 1, |
41
|
|
|
|
|
|
|
"cfs" => 1, |
42
|
|
|
|
|
|
|
"cheetah" => 1, |
43
|
|
|
|
|
|
|
"clojure" => 1, |
44
|
|
|
|
|
|
|
"cmake" => 1, |
45
|
|
|
|
|
|
|
"c-objdump" => 1, |
46
|
|
|
|
|
|
|
"coffee-script" => 1, |
47
|
|
|
|
|
|
|
"common-lisp" => 1, |
48
|
|
|
|
|
|
|
"console" => 1, |
49
|
|
|
|
|
|
|
"control" => 1, |
50
|
|
|
|
|
|
|
"coq" => 1, |
51
|
|
|
|
|
|
|
"cpp" => 1, |
52
|
|
|
|
|
|
|
"cpp-objdump" => 1, |
53
|
|
|
|
|
|
|
"csharp" => 1, |
54
|
|
|
|
|
|
|
"css" => 1, |
55
|
|
|
|
|
|
|
"css+django" => 1, |
56
|
|
|
|
|
|
|
"css+erb" => 1, |
57
|
|
|
|
|
|
|
"css+genshitext" => 1, |
58
|
|
|
|
|
|
|
"css+mako" => 1, |
59
|
|
|
|
|
|
|
"css+myghty" => 1, |
60
|
|
|
|
|
|
|
"css+php" => 1, |
61
|
|
|
|
|
|
|
"css+smarty" => 1, |
62
|
|
|
|
|
|
|
"Cucumber" => 1, |
63
|
|
|
|
|
|
|
"cython" => 1, |
64
|
|
|
|
|
|
|
"d" => 1, |
65
|
|
|
|
|
|
|
"dart" => 1, |
66
|
|
|
|
|
|
|
"delphi" => 1, |
67
|
|
|
|
|
|
|
"diff" => 1, |
68
|
|
|
|
|
|
|
"django" => 1, |
69
|
|
|
|
|
|
|
"d-objdump" => 1, |
70
|
|
|
|
|
|
|
"dpatch" => 1, |
71
|
|
|
|
|
|
|
"dtd" => 1, |
72
|
|
|
|
|
|
|
"duel" => 1, |
73
|
|
|
|
|
|
|
"dylan" => 1, |
74
|
|
|
|
|
|
|
"ec" => 1, |
75
|
|
|
|
|
|
|
"ecl" => 1, |
76
|
|
|
|
|
|
|
"elixir" => 1, |
77
|
|
|
|
|
|
|
"erb" => 1, |
78
|
|
|
|
|
|
|
"erl" => 1, |
79
|
|
|
|
|
|
|
"erlang" => 1, |
80
|
|
|
|
|
|
|
"evoque" => 1, |
81
|
|
|
|
|
|
|
"factor" => 1, |
82
|
|
|
|
|
|
|
"fan" => 1, |
83
|
|
|
|
|
|
|
"fancy" => 1, |
84
|
|
|
|
|
|
|
"felix" => 1, |
85
|
|
|
|
|
|
|
"fortran" => 1, |
86
|
|
|
|
|
|
|
"fsharp" => 1, |
87
|
|
|
|
|
|
|
"gas" => 1, |
88
|
|
|
|
|
|
|
"genshi" => 1, |
89
|
|
|
|
|
|
|
"genshitext" => 1, |
90
|
|
|
|
|
|
|
"glsl" => 1, |
91
|
|
|
|
|
|
|
"gnuplot" => 1, |
92
|
|
|
|
|
|
|
"go" => 1, |
93
|
|
|
|
|
|
|
"gooddata-cl" => 1, |
94
|
|
|
|
|
|
|
"gosu" => 1, |
95
|
|
|
|
|
|
|
"groff" => 1, |
96
|
|
|
|
|
|
|
"groovy" => 1, |
97
|
|
|
|
|
|
|
"gst" => 1, |
98
|
|
|
|
|
|
|
"haml" => 1, |
99
|
|
|
|
|
|
|
"haskell" => 1, |
100
|
|
|
|
|
|
|
"html" => 1, |
101
|
|
|
|
|
|
|
"html+cheetah" => 1, |
102
|
|
|
|
|
|
|
"html+django" => 1, |
103
|
|
|
|
|
|
|
"html+evoque" => 1, |
104
|
|
|
|
|
|
|
"html+genshi" => 1, |
105
|
|
|
|
|
|
|
"html+mako" => 1, |
106
|
|
|
|
|
|
|
"html+myghty" => 1, |
107
|
|
|
|
|
|
|
"html+php" => 1, |
108
|
|
|
|
|
|
|
"html+smarty" => 1, |
109
|
|
|
|
|
|
|
"html+velocity" => 1, |
110
|
|
|
|
|
|
|
"http" => 1, |
111
|
|
|
|
|
|
|
"hx" => 1, |
112
|
|
|
|
|
|
|
"hybris" => 1, |
113
|
|
|
|
|
|
|
"iex" => 1, |
114
|
|
|
|
|
|
|
"ini" => 1, |
115
|
|
|
|
|
|
|
"io" => 1, |
116
|
|
|
|
|
|
|
"ioke" => 1, |
117
|
|
|
|
|
|
|
"irc" => 1, |
118
|
|
|
|
|
|
|
"jade" => 1, |
119
|
|
|
|
|
|
|
"java" => 1, |
120
|
|
|
|
|
|
|
"js" => 1, |
121
|
|
|
|
|
|
|
"js+cheetah" => 1, |
122
|
|
|
|
|
|
|
"js+django" => 1, |
123
|
|
|
|
|
|
|
"js+erb" => 1, |
124
|
|
|
|
|
|
|
"js+genshitext" => 1, |
125
|
|
|
|
|
|
|
"js+mako" => 1, |
126
|
|
|
|
|
|
|
"js+myghty" => 1, |
127
|
|
|
|
|
|
|
"json" => 1, |
128
|
|
|
|
|
|
|
"jsp" => 1, |
129
|
|
|
|
|
|
|
"js+php" => 1, |
130
|
|
|
|
|
|
|
"js+smarty" => 1, |
131
|
|
|
|
|
|
|
"kotlin" => 1, |
132
|
|
|
|
|
|
|
"lhs" => 1, |
133
|
|
|
|
|
|
|
"lighty" => 1, |
134
|
|
|
|
|
|
|
"llvm" => 1, |
135
|
|
|
|
|
|
|
"logtalk" => 1, |
136
|
|
|
|
|
|
|
"lua" => 1, |
137
|
|
|
|
|
|
|
"make" => 1, |
138
|
|
|
|
|
|
|
"mako" => 1, |
139
|
|
|
|
|
|
|
"maql" => 1, |
140
|
|
|
|
|
|
|
"mason" => 1, |
141
|
|
|
|
|
|
|
"matlab" => 1, |
142
|
|
|
|
|
|
|
"matlabsession" => 1, |
143
|
|
|
|
|
|
|
"minid" => 1, |
144
|
|
|
|
|
|
|
"modelica" => 1, |
145
|
|
|
|
|
|
|
"modula2" => 1, |
146
|
|
|
|
|
|
|
"moocode" => 1, |
147
|
|
|
|
|
|
|
"moon" => 1, |
148
|
|
|
|
|
|
|
"mupad" => 1, |
149
|
|
|
|
|
|
|
"mxml" => 1, |
150
|
|
|
|
|
|
|
"myghty" => 1, |
151
|
|
|
|
|
|
|
"mysql" => 1, |
152
|
|
|
|
|
|
|
"nasm" => 1, |
153
|
|
|
|
|
|
|
"nemerle" => 1, |
154
|
|
|
|
|
|
|
"newlisp" => 1, |
155
|
|
|
|
|
|
|
"newspeak" => 1, |
156
|
|
|
|
|
|
|
"nginx" => 1, |
157
|
|
|
|
|
|
|
"nimrod" => 1, |
158
|
|
|
|
|
|
|
"numpy" => 1, |
159
|
|
|
|
|
|
|
"objdump" => 1, |
160
|
|
|
|
|
|
|
"objective-c" => 1, |
161
|
|
|
|
|
|
|
"objective-j" => 1, |
162
|
|
|
|
|
|
|
"ocaml" => 1, |
163
|
|
|
|
|
|
|
"octave" => 1, |
164
|
|
|
|
|
|
|
"ooc" => 1, |
165
|
|
|
|
|
|
|
"opa" => 1, |
166
|
|
|
|
|
|
|
"openedge" => 1, |
167
|
|
|
|
|
|
|
"perl" => 1, |
168
|
|
|
|
|
|
|
"php" => 1, |
169
|
|
|
|
|
|
|
"plpgsql" => 1, |
170
|
|
|
|
|
|
|
"postgresql" => 1, |
171
|
|
|
|
|
|
|
"postscript" => 1, |
172
|
|
|
|
|
|
|
"pot" => 1, |
173
|
|
|
|
|
|
|
"pov" => 1, |
174
|
|
|
|
|
|
|
"powershell" => 1, |
175
|
|
|
|
|
|
|
"prolog" => 1, |
176
|
|
|
|
|
|
|
"properties" => 1, |
177
|
|
|
|
|
|
|
"protobuf" => 1, |
178
|
|
|
|
|
|
|
"psql" => 1, |
179
|
|
|
|
|
|
|
"py3tb" => 1, |
180
|
|
|
|
|
|
|
"pycon" => 1, |
181
|
|
|
|
|
|
|
"pypylog" => 1, |
182
|
|
|
|
|
|
|
"pytb" => 1, |
183
|
|
|
|
|
|
|
"python" => 1, |
184
|
|
|
|
|
|
|
"python3" => 1, |
185
|
|
|
|
|
|
|
"ragel" => 1, |
186
|
|
|
|
|
|
|
"ragel-c" => 1, |
187
|
|
|
|
|
|
|
"ragel-cpp" => 1, |
188
|
|
|
|
|
|
|
"ragel-d" => 1, |
189
|
|
|
|
|
|
|
"ragel-em" => 1, |
190
|
|
|
|
|
|
|
"ragel-java" => 1, |
191
|
|
|
|
|
|
|
"ragel-objc" => 1, |
192
|
|
|
|
|
|
|
"ragel-ruby" => 1, |
193
|
|
|
|
|
|
|
"raw" => 1, |
194
|
|
|
|
|
|
|
"rb" => 1, |
195
|
|
|
|
|
|
|
"rbcon" => 1, |
196
|
|
|
|
|
|
|
"rconsole" => 1, |
197
|
|
|
|
|
|
|
"rebol" => 1, |
198
|
|
|
|
|
|
|
"redcode" => 1, |
199
|
|
|
|
|
|
|
"rhtml" => 1, |
200
|
|
|
|
|
|
|
"rst" => 1, |
201
|
|
|
|
|
|
|
"sass" => 1, |
202
|
|
|
|
|
|
|
"scala" => 1, |
203
|
|
|
|
|
|
|
"scaml" => 1, |
204
|
|
|
|
|
|
|
"scheme" => 1, |
205
|
|
|
|
|
|
|
"scilab" => 1, |
206
|
|
|
|
|
|
|
"scss" => 1, |
207
|
|
|
|
|
|
|
"smalltalk" => 1, |
208
|
|
|
|
|
|
|
"smarty" => 1, |
209
|
|
|
|
|
|
|
"sml" => 1, |
210
|
|
|
|
|
|
|
"snobol" => 1, |
211
|
|
|
|
|
|
|
"sourceslist" => 1, |
212
|
|
|
|
|
|
|
"splus" => 1, |
213
|
|
|
|
|
|
|
"sql" => 1, |
214
|
|
|
|
|
|
|
"sqlite3" => 1, |
215
|
|
|
|
|
|
|
"squidconf" => 1, |
216
|
|
|
|
|
|
|
"ssp" => 1, |
217
|
|
|
|
|
|
|
"sv" => 1, |
218
|
|
|
|
|
|
|
"tcl" => 1, |
219
|
|
|
|
|
|
|
"tcsh" => 1, |
220
|
|
|
|
|
|
|
"tea" => 1, |
221
|
|
|
|
|
|
|
"tex" => 1, |
222
|
|
|
|
|
|
|
"text" => 1, |
223
|
|
|
|
|
|
|
"trac-wiki" => 1, |
224
|
|
|
|
|
|
|
"urbiscript" => 1, |
225
|
|
|
|
|
|
|
"v" => 1, |
226
|
|
|
|
|
|
|
"vala" => 1, |
227
|
|
|
|
|
|
|
"vb.net" => 1, |
228
|
|
|
|
|
|
|
"velocity" => 1, |
229
|
|
|
|
|
|
|
"vhdl" => 1, |
230
|
|
|
|
|
|
|
"vim" => 1, |
231
|
|
|
|
|
|
|
"xml" => 1, |
232
|
|
|
|
|
|
|
"xml+cheetah" => 1, |
233
|
|
|
|
|
|
|
"xml+django" => 1, |
234
|
|
|
|
|
|
|
"xml+erb" => 1, |
235
|
|
|
|
|
|
|
"xml+evoque" => 1, |
236
|
|
|
|
|
|
|
"xml+mako" => 1, |
237
|
|
|
|
|
|
|
"xml+myghty" => 1, |
238
|
|
|
|
|
|
|
"xml+php" => 1, |
239
|
|
|
|
|
|
|
"xml+smarty" => 1, |
240
|
|
|
|
|
|
|
"xml+velocity" => 1, |
241
|
|
|
|
|
|
|
"xquery" => 1, |
242
|
|
|
|
|
|
|
"xslt" => 1, |
243
|
|
|
|
|
|
|
"yaml" => 1, |
244
|
|
|
|
|
|
|
); |
245
|
|
|
|
|
|
|
|
246
|
|
|
|
|
|
|
sub paste { |
247
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
248
|
0
|
0
|
|
|
|
|
my $lang = exists $languages{$self->language} ? $self->language : 'text'; |
249
|
|
|
|
|
|
|
|
250
|
0
|
0
|
|
|
|
|
my $tx = $self->ua->post( 'http://paste.debian.net', form => { |
251
|
|
|
|
|
|
|
code => $self->text, |
252
|
|
|
|
|
|
|
expire => '-1', |
253
|
|
|
|
|
|
|
poster => $self->name, |
254
|
|
|
|
|
|
|
lang => $lang, |
255
|
|
|
|
|
|
|
( $self->private ? ( private => 1 ) : () ), |
256
|
|
|
|
|
|
|
}); |
257
|
|
|
|
|
|
|
|
258
|
0
|
0
|
|
|
|
|
unless ($tx->res->is_status_class(200)) { |
259
|
0
|
|
|
|
|
|
say $tx->res->message; |
260
|
0
|
|
|
|
|
|
say $tx->res->body; |
261
|
0
|
|
|
|
|
|
exit 1; |
262
|
|
|
|
|
|
|
} |
263
|
|
|
|
|
|
|
|
264
|
0
|
|
|
|
|
|
return $tx->req->url; |
265
|
|
|
|
|
|
|
} |
266
|
|
|
|
|
|
|
|
267
|
|
|
|
|
|
|
1; |
268
|
|
|
|
|
|
|
|