1WWW::Pastebin::PastebinUCsoemr::CCornetartieb(u3t)ed PerWlWWD:o:cPuamsetnetbaitni:o:nPastebinCom::Create(3)
2
3
4
6 WWW::Pastebin::PastebinCom::Create - paste on www.pastebin.com without
7 API keys
8
10 IMPORANT. Please read.
11
12 You kinda, sorta, maybe shouldn't really use this module. Use
13 WWW::Pastebin::PastebinCom::API instead. Pastebin.com switched to a
14 key-based API (which is what "::API" version implements), and using
15 this, keyless, module lets you paste only 10 pastes per day.
16
17 The limit is higher with the WWW::Pastebin::PastebinCom::API module, so
18 check it out.
19
20 This module primarily exists for use with App::Nopaste.
21
23 use WWW::Pastebin::PastebinCom::Create;
24
25 my $bin = WWW::Pastebin::PastebinCom::Create->new;
26
27 # all options as defaults
28 my $paste_uri = $bin->paste( text => 'Some text to paste' )
29 or die $bin->error;
30
31 # all options as custom (module's defaults are shown)
32 my $paste_uri = $bin->paste(
33 text => 'Some text to paste',
34 format => 'none', # no syntax highlights
35 expiry => 'm', # expire after a month
36 private => 1, # make the paste unlisted
37 desc => '', # no "title/name" for the paste
38 ) or die $bin->error;
39
40 # object's ->paste_uri() method is overloaded to string interpolation:
41 print "Your paste uri is $bin\n";
42
44 This module provides the means to paste on www.pastebin.com pastebin,
45 without the need for API keys <http://pastebin.com/api>. See the
46 WARNING!!! section above.
47
49 "new"
50 my $bin = WWW::Pastebin::PastebinCom::Create->new;
51
52 Creates and returns a brand new WWW::Pastebin::PastebinCom::Create
53 object. Does not take any arguments.
54
55 "paste"
56 my $paste_uri = $bin->paste( text => 'Some text to paste' )
57 or die $bin->error;
58
59 $bin->paste(
60 text => 'Some text to paste',
61 format => 'perl', # perl syntax highlights
62 expiry => 'asap', # expire in 10 minutes
63 private => 1, # make the paste unlisted
64 desc => 'Some title', # "title/name" for the paste
65 ) or die $bin->error;
66
67 Pastes to the pastebin. On succcess returns the link to the newly-
68 created paste (see also the overloaded "->paste_uri" method below). On
69 failure returns "undef" or an empty list, depending on the context, and
70 the human-readable error message will be available via the "->error"
71 method. Takes arguments as key/value pairs. Argument "text" is
72 mandatory, the rest are optional. Possible arguments are as follows:
73
74 "text"
75
76 $bin->paste(
77 text => 'Some text to paste',
78 ) or die $bin->error;
79
80 Mandatory. Takes a string as a value that contains the text to paste.
81
82 "private"
83
84 $bin->paste(
85 text => 'Some text to paste',
86 private => 1, # make the paste unlisted
87 ) or die $bin->error;
88
89 Optional. This really should be named "unlisted", but for compatibility
90 with old code is still named "private". Takes true or value as a
91 value. If set to a true value, the paste will be "unlisted" (i.e.
92 people will be able to access them if they have a link, but the paste
93 will not be announced on the pastebin.com home page), otherwise the
94 paste will be public and listed on the home page. To make private
95 pastes, you need to be logged in; use WWW::Pastebin::PastebinCom::API
96 if you need that feature. Defaults to: 1 (make pastes unlisted).
97
98 "desc"
99
100 $bin->paste(
101 text => 'Some text to paste',
102 desc => '', # no "title/name" for the paste
103 ) or die $bin->error;
104
105 Optional. Takes a string as a value that specifies the title/name for
106 the paste. If this string is longer than 60 characters, it will be
107 truncated and "..." will be appended to the end of it. By default is
108 not specified.
109
110 "expiry"
111
112 $bin->paste(
113 text => 'Some text to paste',
114 expiry => 'm', # expire after a month
115 ) or die $bin->error;
116
117 Optional. Takes an expiry code as a value that specifies when the paste
118 should expire. Defaults to: "m" (expire after a month). Valid expiry
119 codes are as follows (there are multiple possible codes for each
120 duration; they are equivalent):
121
122 # Expire after 10 Minutes
123 10m
124 m10
125 asap
126
127 # Expire after 1 Hour
128 h
129 1h
130
131 # Expire after 1 Day
132 d
133 1d
134 soon
135
136 # Expire after 1 Week
137 w
138 1w
139 awhile
140
141 # Expire after 2 weeks
142 2w
143 w2
144
145 # Expire after 1 Month
146 1m
147 m
148 m1
149 eventually
150
151 # Never expire
152 n
153 never
154
155 "format"
156
157 $bin->paste(
158 text => 'Some text to paste',
159 format => 'C++ (with QT extensions)',
160 ) or die $bin->error;
161
162 Optional. Takes a format code as a value that specifies the paste text
163 format (what syntax highlights to use). Defaults to: "none" (no syntax
164 highlights). Possible values are as follows; they are case-insensitive:
165
166 None
167 Bash
168 C
169 C#
170 C++
171 CSS
172 HTML
173 HTML 5
174 Java
175 JavaScript
176 Lua
177 None
178 Objective C
179 Perl
180 PHP
181 Python
182 Rails
183 4CS
184 6502 ACME Cross Assembler
185 6502 Kick Assembler
186 6502 TASM/64TASS
187 ABAP
188 ActionScript
189 ActionScript 3
190 Ada
191 ALGOL 68
192 Apache Log
193 AppleScript
194 APT Sources
195 ARM
196 ASM (NASM)
197 ASP
198 Asymptote
199 autoconf
200 Autohotkey
201 AutoIt
202 Avisynth
203 Awk
204 BASCOM AVR
205 Bash
206 Basic4GL
207 BibTeX
208 Blitz Basic
209 BNF
210 BOO
211 BrainFuck
212 C
213 C for Macs
214 C Intermediate Language
215 C#
216 C++
217 C++ (with QT extensions)
218 C: Loadrunner
219 CAD DCL
220 CAD Lisp
221 CFDG
222 ChaiScript
223 Clojure
224 Clone C
225 Clone C++
226 CMake
227 COBOL
228 CoffeeScript
229 ColdFusion
230 CSS
231 Cuesheet
232 D
233 DCL
234 DCPU-16
235 DCS
236 Delphi
237 Delphi Prism (Oxygene)
238 Diff
239 DIV
240 DOS
241 DOT
242 E
243 ECMAScript
244 Eiffel
245 Email
246 EPC
247 Erlang
248 F#
249 Falcon
250 FO Language
251 Formula One
252 Fortran
253 FreeBasic
254 FreeSWITCH
255 GAMBAS
256 Game Maker
257 GDB
258 Genero
259 Genie
260 GetText
261 Go
262 Groovy
263 GwBasic
264 Haskell
265 Haxe
266 HicEst
267 HQ9 Plus
268 HTML
269 HTML 5
270 Icon
271 IDL
272 INI file
273 Inno Script
274 INTERCAL
275 IO
276 J
277 Java
278 Java 5
279 JavaScript
280 jQuery
281
282 "error"
283 $bin->paste( text => 'Some text to paste' )
284 or die $bin->error;
285
286 If an error occurs during pasting, the "->paste" method will return an
287 "undef" or an empty list, depending on the context, and the human-
288 readable error message will be available via the "->error" method.
289
290 "paste_uri"
291 $bin->paste( text => 'Some text to paste' )
292 or die $bin->error;
293
294 print "Your paste is at " . $bin->paste_uri . "\n";
295 print "Your paste is at $bin\n";
296
297 Takes no arguments. Will return the link to the newly-created paste,
298 after a successful call to "->paste". This method is overloaded for
299 string interpolation, meaning you can simply interpolate the
300 "WWW::Pastebin::PastebinCom::Create" object in a string to insert the
301 link to the paste.
302
304 At version 0.004, this module was taken out the back and shot in the
305 face, as the www.pastebin.com update completely broke it. As some code
306 still relied on it, it was resurrected and forced to work, but large
307 bits of module's API have changed. If for whatever reason you need the
308 old, non-working, implementation, you can still access it on backpan
309 and can install it using:
310
311 cpan http://backpan.perl.org/authors/id/Z/ZO/ZOFFIX/WWW-Pastebin-PastebinCom-Create-0.004.tar.gz
312
314 WWW::Pastebin::PastebinCom::API, App::Nopaste
315
317 Zoffix Znet, "<zoffix at cpan.org>"
318
320 Please report any bugs or feature requests to
321 "bug-www-pastebin-pastebincom-create at rt.cpan.org", or through the
322 web interface at
323 <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=WWW-Pastebin-PastebinCom-Create>.
324 I will be notified, and then you'll automatically be notified of
325 progress on your bug as I make changes.
326
328 You can find documentation for this module with the perldoc command.
329
330 perldoc WWW::Pastebin::PastebinCom::Create
331
332 You can also look for information at:
333
334 · RT: CPAN's request tracker (report bugs here)
335
336 <http://rt.cpan.org/NoAuth/Bugs.html?Dist=WWW-Pastebin-PastebinCom-Create>
337
338 · AnnoCPAN: Annotated CPAN documentation
339
340 <http://annocpan.org/dist/WWW-Pastebin-PastebinCom-Create>
341
342 · CPAN Ratings
343
344 <http://cpanratings.perl.org/d/WWW-Pastebin-PastebinCom-Create>
345
346 · Search CPAN
347
348 <http://search.cpan.org/dist/WWW-Pastebin-PastebinCom-Create/>
349
351 Copyright 2014 Zoffix Znet.
352
353 This program is free software; you can redistribute it and/or modify it
354 under the terms of the the Artistic License (2.0). You may obtain a
355 copy of the full license at:
356
357 <http://www.perlfoundation.org/artistic_license_2_0>
358
359 Any use, modification, and distribution of the Standard or Modified
360 Versions is governed by this Artistic License. By using, modifying or
361 distributing the Package, you accept this license. Do not use, modify,
362 or distribute the Package, if you do not accept this license.
363
364 If your Modified Version has been derived from a Modified Version made
365 by someone other than you, you are nevertheless required to ensure that
366 your Modified Version complies with the requirements of this license.
367
368 This license does not grant you the right to use any trademark, service
369 mark, tradename, or logo of the Copyright Holder.
370
371 This license includes the non-exclusive, worldwide, free-of-charge
372 patent license to make, have made, use, offer to sell, sell, import and
373 otherwise transfer the Package with respect to any patent claims
374 licensable by the Copyright Holder that are necessarily infringed by
375 the Package. If you institute patent litigation (including a cross-
376 claim or counterclaim) against any party alleging that the Package
377 constitutes direct or contributory patent infringement, then this
378 Artistic License to you shall terminate on the date that such
379 litigation is filed.
380
381 Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER
382 AND CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES.
383 THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
384 PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY
385 YOUR LOCAL LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR
386 CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR
387 CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE,
388 EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
389
390
391
392perl v5.30.1 2020-01-W3W0W::Pastebin::PastebinCom::Create(3)