Skip to content

Commit

Permalink
Merge branch from Matt Trudel, replace tabs by spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
stgraber committed Dec 26, 2009
2 parents 8675c3d + 1cb0fc2 commit 38e3532
Show file tree
Hide file tree
Showing 14 changed files with 372 additions and 93 deletions.
123 changes: 123 additions & 0 deletions README
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@

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 /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".

17 changes: 17 additions & 0 deletions pastebin.d/fpaste.org.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Another website that doesn't work due to unusual changes.
# this is the Fedora Pastebin, sadly.

[pastebin]
basename = fpaste.org
regexp = "http://fpaste.org"

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

[defaults]
submit = "paste it!"
expire_options = 3600
13 changes: 13 additions & 0 deletions pastebin.d/gist.github.com.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[pastebin]
basename = gist.github.com
regexp = "http://gist.github.com"

[format]
page = page
user = poster
format = file_ext[gistfile1]
content = file_contents[gistfile1]
title = file_name[gistfile1]

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

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

[defaults]
lang = -1
remember = 0
expire = 259200
10 changes: 10 additions & 0 deletions 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]
14 changes: 14 additions & 0 deletions 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
17 changes: 17 additions & 0 deletions pastebin.d/pastebin.ca.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[pastebin]
basename = pastebin.ca
regexp = "http://((([a-zA-Z0-9\-_\.]*)(pastebin\.ca)))"

[format]
user = name
content = content
type = type
save = save
submit = submit
regexp = regexp

[defaults]
type = 1
save = 0
submit = s
regexp = '">http://.*pastebin.ca/(.*)</a></p><p>'
19 changes: 19 additions & 0 deletions pastebin.d/pastebin.com.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[pastebin]
basename = pastebin.com
regexp = "http://((([a-zA-Z0-9\-_\.]*)(pastebin\.com)))"
#FIXME: not website == "http://www.pastebin.com") or website == "http://pastebin.mozilla.org":

[format]
user = poster
content = code2
version = version
parentpid = parent_pid
format = format
submit = paste
remember = remember
expiry = expiry

[defaults]
remember = f
expiry = 1
paste = Send
18 changes: 18 additions & 0 deletions pastebin.d/pastey.net.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[pastebin]
basename = pastey.net
regexp = "http://((([a-zA-Z0-9\-_\.]*)(pastey\.net)))"

[format]
user = author
title = subject
parentpid = parent
content = text
format = language
paste = paste
page = page
regexp = regexp

[defaults]
paste = "Paste"
page = '/submit.php'
regexp = '">http://(?:(?:[a-zA-Z0-9\-_\.]*)(?:pastey\.net))/(.*)</a>'
15 changes: 15 additions & 0 deletions pastebin.d/rafb.net.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[pastebin]
basename = rafb.net
regexp = "http://rafb.net"

[format]
user = nick
content = text
page = page
lang = lang
cvt_tabs = cvt_tabs

[defaults]
page = "/paste/paste.php"
lang = "Plain Text"
cvt_tabs = "No"
24 changes: 24 additions & 0 deletions pastebin.d/slexy.org.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[pastebin]
basename = slexy.org
regexp = "http://slexy.org"

[format]
user = author
content = raw_paste
title = desc
page = page
language = language
permissions = permissions
linenumbers = linenumbers
comment = comment
submit = submit
expire = expire

[defaults]
submit = "Submit Paste"
page = "/index.php/submit"
language = "text"
permissions = 0
comment = ""
linenumbers = 0
expire = 0
18 changes: 18 additions & 0 deletions pastebin.d/stikked.com.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[pastebin]
basename = stikked.com
regexp = "http://stikked.com"

[format]
user = name
content = code
title = title
email = email
lang = lang
website = website
submit = submit

[defaults]
email = ""
lang = "text"
website = ""
submit = "submit"
21 changes: 21 additions & 0 deletions pastebin.d/yourpaste.net.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[pastebin]
basename = yourpaste.net
regexp = "http://yourpaste.net"

[format]
format = syntax
user = name
title = desc
expire = expire
content = code
private = private
remember = remember
page = page
regexp = regexp

[defaults]
expire = 0
private = 0
remember = 0
page = '/paste'
regexp = '">http://yourpaste.net(.*)</a>'

0 comments on commit 38e3532

Please sign in to comment.