The little things give you away... A collection of various small helper stuff
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

16 lines
531 B

  1. #!/bin/bash
  2. if [[ $# -ne 0 ]]; then for line; do echo "$line"; done; else cat; fi | \
  3. while read -r url
  4. do
  5. if [[ ! "${url}" =~ ^https?://www\.irccloud\.com/pastebin/[^/]+/$ ]]
  6. then
  7. echo "WARNING: Skipping malformed URL: ${url}" >&2
  8. continue
  9. fi
  10. code="${url%/}"
  11. code="${code##*/}"
  12. echo '!ao' "https://www.irccloud.com/pastebin/${code}/ --useragent firefox"
  13. echo '!ao' "https://www.irccloud.com/pastebin/json/${code} --useragent firefox"
  14. echo '!ao' "https://www.irccloud.com/pastebin/raw/${code} --useragent firefox"
  15. done