The wonders of pastebin
These last days, i’ ve been using pastebin intensively, for things like diffs reviews, code snippets to discuss, etc.
And i got sick of the web interface.
So i took a couple of hours to write this nice python script which allows to upload seamlessly any content to pastebin.ca, and maybe it will be useful for other people than me, so i publish it here.
Very simple to use here is the usage():
$ pastebin [OPTIONS] [FILE]
Print the pastebin.ca URL of the input file
If FILE is omitted content is read from standard input
OPTIONS:
-h, --help Print this help notice.
-r, --raw Retreive raw text URL (default=off).
-d, --description The description of the content (default=empty).
-m, --message Same as description
-n, --name Your name (default=your unix username).
-t, --type The type of the content (default="raw")
Type can be one of:
raw, asterisk, c, cpp, php, perl, java, vb, csharp,
ruby, python, pascal, mirc, pli, xml, sql, scheme,
ascript, ada, apache, nasm, asp, bash, css, delphi, html, js,
lisp, lua, asm, objc, vbnet
If type is not specified, an attempt to auto-detect type is made,
based on file data/extension. Detection is more reliable when giving FILE
argument than piping directly. This needs modules gnomevfs and gtksourceview
If you have module gtk, the pastebin url will be placed in your clipboard,
you can then paste it with ctrl-v as usual.
That means you can cat important-patch.diff|pastebin -m 'look!' then Ctrl-v in xchat or wherever the output URL.
August 31st, 2005 at 0:00
For pastebin.com-like sites I have created a script just like it (it’s even python) a few months ago - http://www.ubuntulinux.nl/files/pastebin
August 31st, 2005 at 9:09
Cool stuff!
Ikke
August 31st, 2005 at 10:10
Using it! Thanks a log
August 31st, 2005 at 10:10
Err, lot. Not log
August 31st, 2005 at 14:14
Very nice! But the automatic inclusion in the clipboard of the generated pastebin-URL doesn’t work for me. Or do I misunderstand this here:
“… you can cat important-patch.diff|pastebin -m ‘look!’ then Ctrl-v in xchat…”
I still have to mark the outputted URL from the pastebin-script explicitly in order to get in in the clipboard.
Thanks anyway for this nice python-gem!
Best regards…
MacSlow
August 31st, 2005 at 22:22
Wed
I’ve noted a few links about an individual dev. on the gimp who is wreaking havoc for them. Talk about a crank!
I’ve found the best way to deal with issues like this is offlist. However, if this kind of thing persists (which I haven’t had to deal…
November 10th, 2005 at 14:14
nice
December 12th, 2005 at 22:22
Tha author wrote:
maybe it will be useful for other people than me
“Maybe” ??
This is pure shell genious.
At first it died on me, funky error message, probably did something illegal, but now it works like a charm.
Now, the question is, would it be possible to use the setting over at pastebin.ca that forces the paste to expire after X time? In the default state, i think the paste stays there forever and i think thats unnecessary.
December 12th, 2005 at 23:23
It’s easily done, just modify the
# Default Values
[...]
expiry = “”
to
# Default Values
[...]
expiry = “5 minutes”
or any other string found in the EXPIRATIONS array on top of the file
January 12th, 2006 at 15:15
kikidonk: thank you! fantastic!
May 6th, 2006 at 7:07
[...] While browsing the archives of Raphael Slinckx’ blog, among other very interesting things, I came across a post about a Python script of his, which uploads a text file on the on-line pastebin pastebin.ca. A neat script like this proves to be extremely useful sometimes. [...]
August 11th, 2006 at 23:23
Nice, thank you
November 5th, 2006 at 9:09
Buon luogo, congratulazioni, il mio amico!
April 13th, 2007 at 18:18
hi nice site.
November 6th, 2008 at 11:11
На на шем сайте вы можете совершенно бесплатно скачать порно-видео ролики и полнометражное порно совершенно бесплатно, без СМС и без регистрации. В нашей коллекции порно только лучшие порно-ролики с подростками, школьницами, лизбиянками, студентами, фотомоделями, а также групповушки.
Не платте деньги за то что сейчас можно [b]скачать бесплатно[/b], также наш сайт регулярно обновляется поэтому вам не станет с нами скучно.
http://pornushka.blogspot.com/