Skip to content

Commit

Permalink
Closing LP#193352
Browse files Browse the repository at this point in the history
  • Loading branch information
dpaleino committed Feb 19, 2008
1 parent b77e562 commit 1923650
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 4 deletions.
8 changes: 8 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
pastebinit (0.9-0ubuntu2) hardy; urgency=low

* LP #193352 - http://yourpaste.net now supported
* debian/control: using Homepage field, not pseudo-one.
* pastebinit: better handling of command-line passed pastebins

-- David Paleino <d.paleino@gmail.com> Tue, 19 Feb 2008 20:59:38 +0100

pastebinit (0.9-0ubuntu1) hardy; urgency=low

* New upstream release (0.9)
Expand Down
23 changes: 19 additions & 4 deletions pastebinit
Original file line number Diff line number Diff line change
Expand Up @@ -46,27 +46,37 @@ try:
params['paste'] = "Send"
params['remember'] = "0" #Do you want a cookie ?
params['expiry'] = "f" #The expiration, f = forever
elif website == "http://pastebin.ca":
elif re.search("http://pastebin.ca/?", website):
params['name'] = user
params['content'] = content
params['type'] = "1" #The expiration, 1 = raw
params['save'] = "0" #Do you want a cookie ?
params['s'] = "Submit Post"
params['regexp'] = '">http://pastebin.ca/(.*)</a></p><p>'
elif website == "http://pastebin.archlinux.org":
elif re.search("http://pastebin.archlinux.org/?", website):
params['poster']=user
params['code2']=content
params['format']="text" #The format, for syntax hilighting
params['homosapien']="1"
params['paste']="Send"
params['remember']="0" #Do you want a cookie ?
params['expiry']="f" #The expiration, f = forever
elif website == "http://rafb.net/paste" or website == "http://rafb.net/paste/":
elif re.search("http://rafb.net/paste/?", website):
params['page']="paste.php"
params['nick']=user
params['text']=content
params['lang']="Plain Text" #The format, for syntax hilighting
params['cvt_tabs']="No"
elif re.search("http://yourpaste\.net/?", website):
params['syntax'] = format
params['name'] = user
params['desc'] = title
params['expire'] = "600" # Forever
params['code'] = content
params['private'] = "0" # It's not a private post
params['remember'] = "0" # Cookies? ;)
params['page'] = "/paste"
params['regexp'] = '">http://yourpaste.net(.*)</a>'
else:
sys.exit(_("Unknown website, please post a bugreport to request this pastebin to be added (%s)") % website)
return params
Expand Down Expand Up @@ -223,10 +233,14 @@ try:
sys.exit(_("Unable to read from: %s") % filename)

params = getParameters(website, content, user, jabberid, version, format, parentpid, permatag, title, username, password) #Get the parameters array
website+="/"

if not re.search(".*/", website):
website += "/"

reLink=None
if params.__contains__("page"):
website+=params['page']
tmp_page=params['page']
params.__delitem__("page")
if params.__contains__("regexp"):
reLink=params['regexp']
Expand All @@ -238,6 +252,7 @@ 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
else:
print page.url #Get the final page and show the ur
Expand Down

0 comments on commit 1923650

Please sign in to comment.