Skip to content

Commit

Permalink
Fix pastebin.com api
Browse files Browse the repository at this point in the history
  • Loading branch information
stgraber committed Apr 11, 2010
1 parent d02515c commit 38801d9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
22 changes: 12 additions & 10 deletions pastebin.d/pastebin.com.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,23 @@ basename = pastebin.com
regexp = "http://((([a-zA-Z0-9\-_\.]*)(pastebin\.com)))"

[format]
submit = submit
parentpid = paste_parent_key
subdomain = paste_subdomain
content = paste_code
paste_format = paste_format
expiry = paste_expire_date
user = paste_name
subdomain = paste_subdomain
private = paste_private
remember = paste_remember
expiry = paste_expire_date
paste_format = paste_format
email = paste_email
page = page
submit = submit
regexp = regexp

[defaults]
paste_format = 1
submit = submit
paste_format = text
private = 0
remember = 1
expiry = N
submit = submit
subdomain = ""
page = "/post.php"
email = ""
page = "/api_public.php"
regexp = "(.*)"
5 changes: 4 additions & 1 deletion pastebinit
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,10 @@ try:
try:
if reLink: #Check if we have to apply a regexp
website = website.replace(tmp_page, "")
print website + "/" + re.split(reLink, page.read())[1] #Print the result of the Regexp
if reLink == '(.*)':
print page.read().strip()
else:
print website + "/" + re.split(reLink, page.read())[1] #Print the result of the Regexp
else:
print page.url #Get the final page and show the ur
except KeyboardInterrupt:
Expand Down

0 comments on commit 38801d9

Please sign in to comment.