Merge lp:~kirkland/pastebinit/fix-pbput-pbget into lp:pastebinit

Proposed by Dustin Kirkland 
Status: Merged
Merged at revision: 217
Proposed branch: lp:~kirkland/pastebinit/fix-pbput-pbget
Merge into: lp:pastebinit
Diff against target: 23 lines (+3/-3)
1 file modified
utils/pbput (+3/-3)
To merge this branch: bzr merge lp:~kirkland/pastebinit/fix-pbput-pbget
Reviewer Review Type Date Requested Status
Pastebinit Developers Pending
Review via email: mp+267263@code.launchpad.net

Description of the change

This fixes pbput/pbget, makes it work again.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'utils/pbput'
2--- utils/pbput 2012-02-12 23:48:08 +0000
3+++ utils/pbput 2015-08-06 21:17:21 +0000
4@@ -20,7 +20,7 @@
5 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
6
7 PROG=$(basename $0)
8-URL="http://pastebin.com"
9+URL="http://paste.ubuntu.com"
10 TEMPLATE="$PROG.XXXXXXXXXX"
11 [ -d "$TMPDIR" ] && TEMPLATE="$TMPDIR/$TEMPLATE" || TEMPLATE="/tmp/$TEMPLATE"
12
13@@ -31,8 +31,8 @@
14
15 case "$PROG" in
16 pbget)
17- url=$(echo "$1" | sed -e "s:.com/:.com/download.php?i=:")
18- wget -q -O- "$url" | base64 -d | lzma -d > "$TEMP"
19+ url=$(echo "$1")
20+ wget -q -O- "$url" | grep -A 999999999 '<div class="paste"><pre>' | grep -B 999999999 "^</pre>" | sed -e "s/.*<pre>//" -e "s/^<\/pre>.*//" | base64 -d | lzma -d > "$TEMP"
21 # Support secure uploads
22 if gpg -d "$TEMP" >"$TEMP2" 2>/dev/null; then
23 # Upload was encrypted

Subscribers

People subscribed via source and target branches