Commands tagged comic (17)

  • A simple script for download all the MegaTokyo strips from the first to the last one

    for i in $(seq 1 `curl 2>/dev/null|grep current|cut -f6 -d\"`);do wget`curl${i} 2>/dev/null|grep src=\"strips\/|cut -f4 -d\"`;done
    akira88 · 2012-03-04 22:52:36 0
  • Random Cyanide and Happiness comics from I use this command and update it for --edit : modification for *.jpeg files + guest authors

    cyanide(){ display "$(wget -q -O - | grep -Po '*/[^"]+(png|jpg|jpeg)')"; }
    barbuk · 2011-02-14 15:12:13 0
  • Just added view with the eog viewer.

    wget -O xkcd_$(date +%y-%m-%d).png `lynx --dump|grep png`; eog xkcd_$(date +%y-%m-%d).png
    theanalyst · 2010-10-27 13:42:55 0

  • 6
    eog `curl -s | sed -n 's/<h3>Image URL.*: \(.*\)<\/h3>/\1/p'`
    bluesman · 2010-08-31 13:23:21 0
  • KISS To get a random xkcd comic: xdg-open

    unixmonkey8024 · 2010-08-25 19:14:11 0
  • This function displays the latest comic from One of the best things about xkcd is the title text when you hover over the comic, so this function also displays that after you close the comic. To get a random xkcd comic use the following: xkcdrandom() { wget -qO- | sed -n 's#^<img src="\(http://imgs.[^"]\+\)"\s\+title="\(.\+\?\)"\salt.\+$#eog "\1"\necho '"'\2'#p" | bash; } These are just a bit shorter than the ones eigthmillion wrote, however his version didn't work as expected on my laptop for some reason (I got the title-tag first), so these build a command which is executed by bash.

    xkcd() { wget -qO- | sed -n 's#^<img src="\(http://imgs.[^"]\+\)"\s\+title="\(.\+\?\)"\salt.\+$#eog "\1"\necho '"'\2'#p" | bash ; }
    John_W · 2010-08-25 15:44:31 3
  • Shorter version with curl and awk

    eog `curl '' | awk -F "ng): |</h" '/embedding/{print $2}'`
    dog · 2010-08-25 14:04:30 0
  • Output the html from xkcd's index.html, filter out the html tags, and then view it in gwenview. Show Sample Output

    gwenview `wget -O - | grep 'png' | grep '<img src="' | sed s/title=\".*//g | sed 's/.png\"/.png/g' | sed 's/<img src=\"//g'`
    hunterm · 2010-08-24 22:21:51 1
  • Will create a graph of the results for "x bottles of beer on the wall". Requires Gnuplot. Inspired by an xkcd comic: For sample output see: Show Sample Output

    (echo "plot '-' with lines"; for x in $(seq 1 100); do curl -s "$(echo $x bottles of beer on the wall|sed 's/ /%20/g')"|sed 's/.*"estimatedResultCount":"\([^"]*\)".*/\1\n/';done)|gnuplot -persist
    matthewbauer · 2010-03-17 21:04:36 1
  • Add an alias to your .bashrc that allows you to issue the command xkcd to view (with gwenview) the newest xkcd comic... I know there are thousands of them out there but this one is at least replete with installer and also uses a more concise syntax... plus, gwenview shows you the downloading progress as it downloads the comic and gives you a more full featured viewing experience.

    echo alias xkcd="gwenview `w3m -dump|grep png | awk '{print $5}'` 2> /dev/null" >> .bashrc
    GinoMan2440 · 2010-01-30 20:38:16 0
  • Only need to install Image Magick package. Display a xkcd comic with its title and save it in /tmp directory If you prefer to view the newest xkcd, use this command: wget -q -O-| sed -n '/<img src="http:\/\/\/comics/{s/.*\(http:.*\)" t.*/\1/;p}' | awk '{system ("wget -q " $1 " -O- | display -title $(basename " $1") -write /tmp/$(basename " $1")");}'

    wget -q -O-| sed -n '/<img src="http:\/\/\/comics/{s/.*\(http:.*\)" t.*/\1/;p}' | awk '{system ("wget -q " $1 " -O- | display -title $(basename " $1") -write /tmp/$(basename " $1")");}'
    laugg · 2009-12-09 13:41:25 1
  • Bulk downloads the comic strip JPG files for the adult cartoon Savitabhabhi, storing each set in it's own folder. Requires manual removal of "non-image" files that maybe created because each series may differ in length. The command can be easily adapted for UNIX flavours. You need to have cURL in your path.

    for /L %%x in (1,1,16) do mkdir %%x & curl -R -e -o %%x/#1.jpg[001-070].jpg
    MyTechieself · 2009-12-08 15:01:16 0
  • Requires display. Corrected version thanks to sputnick and eightmillion user.

    display$(curl -s|grep -Po '"\K/dyn/str_strip(/0+){4}/.*strip.[^\.]*\.gif')
    wizel · 2009-12-05 19:35:27 9

  • 1
    wget `lynx --dump|grep png`
    metalx1000 · 2009-12-03 23:10:22 0
  • I wasn't sure how to display the image, so I thought I'd try xml for a different twist. Show Sample Output

    curl -s '' | awk -F\" '/^<img/{printf("<?xml version=\"1.0\"?>\n<xkcd>\n<item>\n <title>%s</title>\n <comment>%s</comment>\n <image>%s</image>\n</item>\n</xkcd>\n", $6, $4, $2)}'
    putnamhill · 2009-12-03 19:49:37 0
  • Same thing just a different way to get there. You will need lynx

    lynx --dump --source | grep `lynx --dump | egrep '(png|jpg)'` | grep title | cut -d = -f2,3 | cut -d '"' -f2,4 | sed -e 's/"/|/g' | awk -F"|" ' { system("display " $1);system("echo "$2); } '
    solarislackware · 2009-12-03 18:53:57 0
  • This function displays the latest comic from One of the best things about xkcd is the title text when you hover over the comic, so this function also displays that after you close the comic. To get a random xkcd comic, I also use the following: xkcdrandom(){ wget -qO-|tee >(feh $(grep -Po '(?<=")http://imgs[^/]+/comics/[^"]+\.\w{3}'))|grep -Po '(?<=(\w{3})" title=").*(?=" alt)';}

    xkcd(){ wget -qO-|tee >(feh $(grep -Po '(?<=")http://imgs[^/]+/comics/[^"]+\.\w{3}'))|grep -Po '(?<=(\w{3})" title=").*(?=" alt)';}
    eightmillion · 2009-11-27 09:11:47 11

What's this? is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands

Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.


Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: