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.

123456789101112131415161718192021222324252627282930313233
  1. #!/usr/bin/env bash
  2. # AUTHOR: shaggy
  3. # FILE: xkcd
  4. # ROLE: TODO (some explanation)
  5. # CREATED: 2014-12-21 18:17:01
  6. # MODIFIED: 2015-02-24 22:45:02
  7. img() {
  8. wget -qO- xkcd.com | grep -Po '(?<=")http://imgs[^/]+/comics/[^"]+\.\w{3}' > .xkcd.url && wget -i .xkcd.url -q -O ~/.xkcd.img
  9. }
  10. text() {
  11. wget -qO- xkcd.com|tee |grep -Po '(?<=(\w{3})" title=").*(?=" alt)' > ~/.xkcd.text
  12. }
  13. cleantext() {
  14. sed -i "s/&#39;/'/g" .xkcd.text
  15. }
  16. textshow() {
  17. cat ~/.xkcd.text
  18. }
  19. img
  20. text
  21. cleantext
  22. textshow && sleep 10s && imgt ~/.xkcd.img