aboutsummaryrefslogtreecommitdiff
path: root/bin/xgo
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-09-04 21:03:48 +1200
committerTom Ryder <tom@sanctum.geek.nz>2016-09-04 21:03:48 +1200
commite18fbe575ab877a18f050a40231178c201965c02 (patch)
tree5ff7b55a368766f0aa9a7e5ae961135d471d7587 /bin/xgo
parentAdd bl(1df) (diff)
downloaddotfiles-e18fbe575ab877a18f050a40231178c201965c02.tar.gz
dotfiles-e18fbe575ab877a18f050a40231178c201965c02.zip
Add Pastebin ripper to xgo(1)
Diffstat (limited to 'bin/xgo')
-rwxr-xr-xbin/xgo5
1 files changed, 5 insertions, 0 deletions
diff --git a/bin/xgo b/bin/xgo
index 6cbcaedb..bf0a632e 100755
--- a/bin/xgo
+++ b/bin/xgo
@@ -17,6 +17,11 @@ for url ; do (
url=$(printf '%s\n' "$url" | sed 's_/blob/_/raw/_')
;;
+ # Dig out the plain text for pastebin.com links
+ *://pastebin.com/*)
+ url=$(printf '%s\n' "$url" | sed 's_/[A-Za-z0-9][A-Za-z0-9]*$_/raw&_')
+ ;;
+
# If it's a not-direct imgur link and not to an album, swap URL
# elements to get to the actual file (it may not actually be a JPEG;
# the MIME type will tell us)