Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Shell 

Get the XKCD alt text from the cli / bash /terminal shell

How to pull the alt (actually the title tag), from xkcd with the command line


Code
[root@queerlikerice ~]# curl xkcd.com | grep -E -oh 'title=".* alt=' | grep 'title' | grep -E -oh '".*?"'
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 8375 100 8375 0 0 137k 0 --:--:-- --:--:-- --:--:-- 538k
"And if you labeled your axes, I could tell you exactly how MUCH better."


Bash cli:
Code
curl xkcd.com | grep -E -oh 'title=".* alt=' | grep 'title' | grep -E -oh '".*?"'
Always more OC on my blog:
BSDPunk's BLog
Code
"Wait, that second one is a woman?  ... wait, if that bothers me, then why doesn't ... man, this game is no fun anymore."

Thanks, and do you really think rice is queer?
[Image: ed8URKg.jpg]


Nah, My grandfather was really racist, so he got the whole stink on shit, white on rice colloquialism confused.... So he would say "like stink on rice". Anyway after enough continuous inside jokes I hostname(d) my server queer like rice. Nothing against those who desire the same sex. Just a weird inside joke.
Always more OC on my blog:
BSDPunk's BLog
(Mar 16, 2011 10:32 PM)bsdpunk Wrote:  Nah, My grandfather was really racist, so he got the whole stink on shit, white on rice colloquialism confused.... So he would say "like stink on rice". Anyway after enough continuous inside jokes I hostname(d) my server queer like rice. Nothing against those who desire the same sex. Just a weird inside joke.

Wow, that's pretty deep, thanks for sharing.
[Image: ed8URKg.jpg]


So I made this one:
Code
curl -skL xkcd.com/1444 |perl -ne'print"$1"if/le="(.*)" a/'

But my coworker beat me with this one(golf):
curl -skL xkcd.com/1444 | awk -F\" '/le=".*t=/ {print $4}'
Always more OC on my blog:
BSDPunk's BLog
Look how bsdpunk evolved over the last 4 years!
halp how do I use I opened up my cmd but it tell me it doesn't recognize why is that??
I typed rm -rf in my windows cmd and sumthin happened. What do?
--- Fuck you guys ---
My message is to short
Always more OC on my blog:
BSDPunk's BLog
Bsdpunk, don't do "My message is to short" in your posts, it is against the rules and you'll get exiled.
Jesus, someone older than me making posts in this section? Lol. Been ages since I've seen anyone identify with Malvager as well.
(Nov 28, 2014 06:47 AM)White Light Wrote:  Jesus, someone older than me making posts in this section? Lol. Been ages since I've seen anyone identify with Malvager as well.

Malvager will make its comeback. Still alive for over 7 years. ;)
(Dec 6, 2014 02:26 AM)Psycho Wrote:  Malvager will make its comeback. Still alive for over 7 years. ;)

Did you remember a guy named eXemist? I'm fairly sure he was part of Malvager for a while at least back in 2010.


Possibly Related Threads...
Thread / Author Replies Views Last Post
by HackersNov 11, 2025 09:42 AM 0 206 Nov 11, 2025 09:42 AM
Last Post: Hackers
by HackersDec 11, 2024 05:11 PM 21 535 Dec 11, 2024 05:11 PM
Last Post: padrino
by HackersDec 11, 2024 08:31 AM 23 695 Dec 11, 2024 08:31 AM
Last Post: Hackers