Skip to content

Commit

Permalink
Remove Pastebin shell script
Browse files Browse the repository at this point in the history
Added Pastebinit script

Thanks to: Stéphane Graber

Homepage: http://www.stgraber.org/

Supported pastebins:
- cxg.de
- fpaste.org
- p.defau.lt
- paste.debian.net
- paste.drizzle.org
- paste.kde.org
- paste.openstack.org
- paste.pocoo.org
- paste.pound-python.org
- paste.ubuntu.com
- paste.ubuntu.org.cn
- paste2.org
- pastebin.com
- pastie.org
- pb.daviey.com
- slexy.org
- sprunge.us
- yourpaste.net
  • Loading branch information
eloaders committed Feb 13, 2012
1 parent 406d359 commit e9db81f
Show file tree
Hide file tree
Showing 70 changed files with 5,553 additions and 186 deletions.
2 changes: 1 addition & 1 deletion debian/install
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ src/i-nex/i-nex.gambas usr/bin
src/i-nex/logo/i-nex.0.4.x.png usr/share/pixmaps
debian/i-nex.desktop usr/share/applications
debian/check_kernel usr/bin
debian/pastebin usr/share/i-nex
debian/pastebinit usr/share/i-nex
69 changes: 0 additions & 69 deletions debian/pastebin

This file was deleted.

1 change: 1 addition & 0 deletions debian/pastebinit/.bzrignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
po/mo
340 changes: 340 additions & 0 deletions debian/pastebinit/COPYING

Large diffs are not rendered by default.

124 changes: 124 additions & 0 deletions debian/pastebinit/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@

USING PASTEBIN.D FILES

To enable support for private pastebins, first you will need to know the fields
that are in use by the pastebin when posting data.

Add a file in the ~/pastebin.d or /etc/pastebin.d/ directory with the following
format:

[pastebin]
basename = domain.name
regexp = "http://(.*)\.?domain.name/"

[format]
reserved_keyword = pastebin_site_field
custom_keyword = pastebin_site_field

[defaults]
custom_keyword = value


THE PASTEBIN SECTION

Under "[pastebin]", you will want to keep the very basic information to
identify the pastebin. Only two fields are used in that section:

basename - the generic domain name for the pastebin.
this domain name should not contain
possible sub-domains in use.

regexp - a regular expression that matches the
basename, as well as any sub-domains that
may be in use.


THE FORMAT SECTION

Under "[format]", identify the various fields in use in the pastebin you want
to setup. Identify any fields used to publish data on the pastebin, and add
them to the configuration file.

The "[format]" section expects reserved and custom keywords matched to the real
name for the field for the pastebin you are setting up. In other words, the
data that a reserved or custom keyword (the left-hand side) refers to will be
put in the named field assigned to it (the right-hand side).

A number of reserved keywords can be used, but are optional:

user - contains the username for the user
calling the pastebinit utility.

content - contains the data that will be posted.

title - contains the title if set at the command
line.

version - contains the version as set at the
command line.

format - contains the format setting:
usually used for syntax highlighting.

parentpid - contains the parent post ID for
pastebins that use it.

permatag - contains permatag as set at the command
line.

username - contains the pastebin username if
required.

password - contains the pastebin user's password
if required.

jabberid - contains the jabberid for the poster
as set at the command line.

Two additional special parameters are available for use:

page - used to specify a page from which to
post data. It is the actual URL of
the pastebin's form.

regexp - used to specify a regexp to execute
on the resulting page after posting.
This is useful to deal with special
pastebins that don't redirect you
to the new post's URL.

Add any other fields in use for the specific pastebin you are setting up may be
added to the "[format]" section using the same syntax.

An easy way to deal with special parameters that need to be passed to the
pastebin, such as expiry time for a post, is to assign the pastebin's field
name to a variable, and set the correct value for that variable under the
"[defaults]" section later, as such:

[format]
expire = expiry

[defaults]
expire = 365

Where 'expire' can then be reused as the keyword to retrieve a static value in
the '[defaults]' section. See below for an example.


THE DEFAULTS SECTION

The '[defaults]' section is used to set static values for custom fields.

Some pastebins require setting fields such as expiry time for posts, or
whether to use cookies. Such values are set using a custom field, followed by
the value to give it.

To reuse the example above, statically set a post to be expire after 365 days:

[defaults]
expire = 365

Here, the value 365 will be assigned to the expire keyword. In the "[format]"
section, the value in the expire keyword is applied to the field called
"expiry".

14 changes: 14 additions & 0 deletions debian/pastebinit/pastebin.d/cxg.de.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[pastebin]
basename = cxg.de
regexp = "http://cxg.de"

[format]
user = desc
content = pastetext
format = lang
page = page
regexp = regexp

[defaults]
page = "/paste.php"
regexp = 'href="http://cxg.de/(.*)"'
14 changes: 14 additions & 0 deletions debian/pastebinit/pastebin.d/fpaste.org.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[pastebin]
basename = fpaste.org
regexp = "http://fpaste.org"

[format]
user = author
content = content
format = lexer
submit = submit
expire_options = expire_options

[defaults]
submit = "paste it!"
expire_options = 86400
10 changes: 10 additions & 0 deletions debian/pastebinit/pastebin.d/p.defau.lt.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[pastebin]
basename = p.defau.lt
regexp = "http://p.defau.lt"

[format]
content = code
page = page

[defaults]
page = '/submit.php'
15 changes: 15 additions & 0 deletions debian/pastebinit/pastebin.d/paste.debian.net.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[pastebin]
basename = paste.debian.net
regexp = "http://paste.debian.net"

[format]
user = poster
content = code
format = lang
remember = remember
expire = expire

[defaults]
lang = -1
remember = 0
expire = 604800
18 changes: 18 additions & 0 deletions debian/pastebinit/pastebin.d/paste.drizzle.org.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[pastebin]
basename = paste.drizzle.org
regexp = "http://paste.drizzle.org"

[format]
lang = language
page = page
content = code
post_format = post_format
regexp = regexp
target_url = target_url

[defaults]
page = "/json/?method=pastes.newPaste"
post_format = "json"
lang = ""
regexp = "\"data\": \"([^"]*)"
target_url = "http://paste.drizzle.org/show/"
22 changes: 22 additions & 0 deletions debian/pastebinit/pastebin.d/paste.kde.org.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[pastebin]
basename = paste.kde.org
regexp = "http://paste.kde.org"

[format]
user = paste_user
format = paste_lang
content = paste_data
password = paste_password
expire = paste_expire
private = paste_private
api = api_submit
mode = mode
regexp = regexp

[defaults]
private = 0
format = "text"
expire = 86400
api = 1
mode = xml
regexp = "<id>(.*)</id>"
18 changes: 18 additions & 0 deletions debian/pastebinit/pastebin.d/paste.openstack.org.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[pastebin]
basename = paste.openstack.org
regexp = "http://paste.openstack.org"

[format]
lang = language
page = page
content = code
post_format = post_format
regexp = regexp
target_url = target_url

[defaults]
page = "/json/?method=pastes.newPaste"
post_format = "json"
lang = ""
regexp = "\"data\": \"([^"]*)"
target_url = "http://paste.openstack.org/show/"
9 changes: 9 additions & 0 deletions debian/pastebinit/pastebin.d/paste.pocoo.org.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[pastebin]
basename = paste.pocoo.org
regexp = "http://paste.pocoo.org"

[format]
content = code
format = language

[defaults]
11 changes: 11 additions & 0 deletions debian/pastebinit/pastebin.d/paste.pound-python.org.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[pastebin]
basename = paste.pound-python.org
regexp = "http://paste.pound-python.org"

[format]
content = code
format = language
private = private

[defaults]
private = 0
10 changes: 10 additions & 0 deletions debian/pastebinit/pastebin.d/paste.ubuntu.com.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[pastebin]
basename = paste.ubuntu.com
regexp = "http://paste.ubuntu.com"

[format]
user = poster
content = content
format = syntax

[defaults]
12 changes: 12 additions & 0 deletions debian/pastebinit/pastebin.d/paste.ubuntu.org.cn.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[pastebin]
basename = paste.ubuntu.org.cn
regexp = "http://paste.ubuntu.org.cn"

[format]
user = poster
content = code2
format = class
paste = paste

[defaults]
paste = "发送"
14 changes: 14 additions & 0 deletions debian/pastebinit/pastebin.d/paste2.org.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[pastebin]
basename = paste2.org
regexp = "http://paste2.org"

[format]
title = description
content = code
format = lang
page = page
parent = parent

[defaults]
page = 'new-paste'
parent = 0

0 comments on commit e9db81f

Please sign in to comment.