
Terminal - Commands tagged curl - 163 results
curl -s http://urlxray.com/display.php?url=http://tinyurl.com/demo-xray | grep -o '<title>.*</title>' | sed 's/<title>.*--> \(.*\)<\/title>/\1/g'
This is sample output - yours may be different.
http://urlxray.com/sex-so-hot-it-will-blow-your-mind.php
(Note: this result is totally SFW)
We can put this inside a function:
fxray() { curl -s http://urlxray.com/display.php?url="$1" | grep -o '<title>.*</title>' | sed 's/<title>.*--> \(.*\)<\/title>/\1/g'; };
fxray http://tinyurl.com/demo-xray
eog `curl -s http://xkcd.com/ | sed -n 's/<h3>Image URL.*: \(.*\)<\/h3>/\1/p'`
This is sample output - yours may be different.
xdg-open http://xkcd.com/
This is sample output - yours may be different.
KISS
To get a random xkcd comic:
xdg-open http://dynamic.xkcd.com/random/comic/
xkcd() { wget -qO- http://xkcd.com/ | sed -n 's#^<img src="\(http://imgs.[^"]\+\)"\s\+title="\(.\+\?\)"\salt.\+$#eog "\1"\necho '"'\2'#p" | bash ; }
This is sample output - yours may be different.
This function displays the latest comic from xkcd.com. 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- http://dynamic.xkcd.com/comic/random | 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.
eog `curl 'http://xkcd.com/' | awk -F "ng): |</h" '/embedding/{print $2}'`
This is sample output - yours may be different.
Shorter version with curl and awk
gwenview `wget -O - http://xkcd.com/ | grep 'png' | grep '<img src="http://imgs.xkcd.com/comics/' | sed s/title=\".*//g | sed 's/.png\"/.png/g' | sed 's/<img src=\"//g'`
This is sample output - yours may be different.
[hunterm@saturn ~ )> gwenview `wget -O - http://xkcd.com/ | grep 'png' | grep '<img src="http://imgs.xkcd.com/comics/' | sed s/title=\".*//g | sed 's/.png\"/.png/g' | sed 's/<img src=\"//g'`
--2010-08-24 18:20:34-- http://xkcd.com/
Resolving xkcd.com... 72.26.203.99
Connecting to xkcd.com|72.26.203.99|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 7654 (7.5K) [text/html]
Saving to: ?STDOUT?
100%[=======================================================================================================================>] 7,654 --.-K/s in 0.08s
2010-08-24 18:20:34 (99.0 KB/s) - written to stdout [7654/7654]
Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)
gwenview(13369)/kdeui (kdelibs): Attempt to use QAction "edit_redo" with KXMLGUIFactory!
gwenview(13369)/kdeui (kdelibs): Attempt to use QAction "edit_undo" with KXMLGUIFactory!
gwenview(13369)/kio (KIOJob) KIO::TransferJob::slotMimetype: mimetype() emitted again, or after sending first data!; job URL = KUrl("http://imgs.xkcd.com/comics/i_dont_want_directions.png")
gwenview(13369)/kdecore (services) KMimeTypeFactory::parseMagic: Now parsing "/usr/share/mime/magic"
gwenview(13369)/kdecore (services) KMimeTypeFactory::parseMagic: Now parsing "/home/hunterm/.local/share/mime/magic"
gwenview(13369)/kdecore (KConfigSkeleton) KCoreConfigSkeleton::writeConfig:
Output the html from xkcd's index.html, filter out the html tags, and then view it in gwenview.
curl -sL 'www.commandlinefu.com/commands/random' | awk -F'</?[^>]+>' '/"command"/{print $2}'
This is sample output - yours may be different.
Splitting on tags in awk is a handy way to parse html.
curl -L -s `curl -s [http://podcast.com/show.rss]` | xmlstarlet sel -t -m "//enclosure[1]" -v "@url" -n | head -n 1` | ssh -t [user]@[host] "mpg123 -"
This is sample output - yours may be different.
Gets the latest podcast show from from your favorite Podcast. Uses curl and xmlstarlet.
Make sure you change out the items between brackets.
curl -L -s `curl -s http://www.2600.com/oth-broadband.xml` | xmlstarlet sel -t -m "//enclosure[1]" -v "@url" -n | head -n 1` | ssh -t [user]@[host] "mpg123 -"
This is sample output - yours may be different.
High Preformance MPEG 1.0/2.0/2.5 Audio Player for Layer 1, 2 and 3.
Version 0.59s-mh4 (2000/Oct/27). Written and copyrights by Michael Hipp.
Uses code from various people. See 'README' for more!
THIS SOFTWARE COMES WITH ABSOLUTELY NO WARRANTY! USE AT YOUR OWN RISK!
Playing MPEG stream from standard input ...
Found new ID3 Header
MPEG 2.0 layer III, 64 kbit/s, 22050 Hz joint-stereo
Ever wanted to stream your favorite podcast across the network, well now you can.
This command will parse the iTunes enabled podcast and stream the latest episode across the network through ssh encryption.
FOR /f %%g in ('echo %1 ^| iconv -f gbk -t utf-8') DO curl -x proxy:port -u user:pass -d status=%%g -d source="cURL" http://twitter.com/statuses/update.xml
This is sample output - yours may be different.
Aside from curl one will need iconv windows binary since windows lacks a native utf-8 cli interface. In my case I need a proxy in China and iconv to convert gbk status string into utf-8. GnuWin32 is a good choice with loads of coreutils natively ported to Windows
"FOR /f" is the solution to pass iconv output to curl.
curl -s "http://www.socrata.com/api/views/vedg-c5sb/rows.json?search=Axelrod" | grep "data\" :" | awk '{ print $17 }'
This is sample output - yours may be different.
Query the Socrata Open Data API being used by the White House to find any employee's salary using curl, grep and awk.
Change the value of the search parameter (example uses Axelrod) to the name of any White House staffer to see their annual salary.
This is sample output - yours may be different.
Curl is not installed by default on many common distros anymore. wget always is :)
wget -qO- ifconfig.me/ip
lynx --dump icanhazip.com
This is sample output - yours may be different.
If curl isn't available, use lynx.
This is sample output - yours may be different.
With a lolcat favicon if you access it from your browser
curl -s "http://ajax.googleapis.com/ajax/services/language/translate?langpair=|en&v=1.0&q=`xsel`" |cut -d \" -f 6
This is sample output - yours may be different.
IFS=`echo -en "\n\b"`; for i in $(curl http://feeds.digg.com/digg/container/technology/popular.rss | grep '<title>' | sed -e 's#<[^>]*>##g' | tail -n10); do echo $i; echo $i | sed 's/^/Did you hear about /g' | say; sleep 30; done
This is sample output - yours may be different.
Instead of having someone else read you the Digg headlines, Have OSX do it. Requires Curl+Sed+Say. This could probably be easily modified to use espeak for Linux.
curl http://github.com/api/v1/yaml/search/vim
This is sample output - yours may be different.
---
repositories:
- name: vim-rails
size: 3260
followers: 428
language: VimL
fork: false
username: tpope
id: repo-61032
type: repo
pushed: "2010-05-10T01:40:46Z"
description: "rails.vim: Ruby on Rails power tools"
forks: 25
score: 4.38047
created: "2008-10-09T03:16:22Z"
- name: snipmate.vim
size: 5052
followers: 372
language: VimL
fork: false
username: msanders
id: repo-130092
type: repo
pushed: "2010-04-08T05:02:12Z"
description: "snipMate.vim aims to be a concise vim script that implements some of TextMate's snippets features in Vim. "
forks: 64
score: 4.387217
created: "2009-02-16T15:24:55Z"
- name: nerdtree
...
In this example we search for 'vim' but vim doesn't have a project on github right now. That's ok, this command still searches for every project that has 'vim' in their description (forks, plugins, etc). To get XML or JSON output just replace 'yaml' in the url with 'xml' or 'json'.
curl http://github.com/api/v1/yaml/git
This is sample output - yours may be different.
---
user:
name: Git Mirror
repositories:
- :description: Git Source Code Mirror
:has_downloads: true
:url: http://github.com/git/git
:forks: 58
:homepage: http://git-scm.com
:has_wiki: true
:fork: false
:private: false
:open_issues: 1
:name: git
:owner: git
:has_issues: true
:watchers: 383
- :description: "Hello world in every programming language "
:has_downloads: true
:url: http://github.com/git/hello-world
:forks: 8
:homepage: http://github.com/leachim6/hello-world/wikis
:has_wiki: true
:fork: true
:private: false
:open_issues: 1
:name: hello-world
:owner: git
:has_issues: true
:watchers: 23
blog: http://git-scm.com
login: git
email: git@logicalawesome.com
fbemailscraper YourFBEmail Password
This is sample output - yours may be different.
echo "Keyword?";read keyword;query="http://www.shoutcast.com/sbin/newxml.phtml?search="$keyword"";curl -s $query |awk -F '"' 'NR <= 4 {next}NR>15{exit}{sub(/SHOUTcast.com/,"http://yp.shoutcast.com/sbin/tunein-station.pls?id="$6)}{print i++" )"$2}'
This is sample output - yours may be different.
0 )friskyRadio feelin frisky? [Dance, Trance, House and Techno] - [http://yp.shoutcast.com/sbin/tunein-station.pls?id=1745]
1 )Chillout Dreams - D I G I T A L L Y - I M P O R T E D - relax to the sounds of dream and ibiza style - [http://yp.shoutcast.com/sbin/tunein-station.pls?id=7307]
2 )1.FM - The Chillout Lounge - [http://yp.shoutcast.com/sbin/tunein-station.pls?id=5513]
3 )#MUSIK.LOUNGE - WWW.RAUTEMUSIK.FM - 24H CHILLOUT AMBIENT SMOOTH JAZZ DOWNTEMPO LATIN SOUL AND MORE! - [http://yp.shoutcast.com/sbin/tunein-station.pls?id=2477]
4 )PsyChill - D I G I T A L L Y - I M P O R T E D - downtempo psychedelic dub grooves, goa ambient, and - [http://yp.shoutcast.com/sbin/tunein-station.pls?id=9621]
5 )4CLUBBERS - [http://yp.shoutcast.com/sbin/tunein-station.pls?id=94142]
6 )Chilltrax - The World's Chillout Channel - [http://yp.shoutcast.com/sbin/tunein-station.pls?id=8734]
7 )Ambient - D I G I T A L L Y - I M P O R T E D - a blend of ambient, downtempo, and chillout - [http://yp.shoutcast.com/sbin/tunein-station.pls?id=46573]
8 )ZenRadio.FM: Zen Radio (tm) - Relaxation Meditation Concentration Peace Yoga Relaxare Chillout Loung - [http://yp.shoutcast.com/sbin/tunein-station.pls?id=2979]
9 )Mountain Chill - The Planet's Destination for Chill - [http://yp.shoutcast.com/sbin/tunein-station.pls?id=4324]
10 )_-_ P S Y C H E D E L I K . C O M -_- 192KBITS Ambient Psychedelic Chillout - Psychedelik.com - - [http://yp.shoutcast.com/sbin/tunein-station.pls?id=2835]
Searches for web radio by submitted keyword and returns the station name and the link for listing .
May be enhanced to read user's selection and submit it to mplayer.
url="[Youtube URL]"; echo $(curl ${url%&*} 2>&1 | grep -iA2 '<title>' | grep '-') | sed 's/^- //'
This is sample output - yours may be different.
There's another version on here that uses GET but some people don't have lwp-request, so here's an alternative. It's also a little shorter and should work with most youtube URLs since it truncates at the first &
curl ifconfig.me/all/json
This is sample output - yours may be different.
Request all information about my IP address in json format
This is sample output - yours may be different.
Request all information about my IP address in xml format
This is sample output - yours may be different.
curl ifconfig.me/ip -> IP Adress
curl ifconfig.me/host -> Remote Host
curl ifconfig.me/ua ->User Agent
curl ifconfig.me/port -> Port
thonks to http://ifconfig.me/
curl -s http://api.wunderground.com/auto/wui/geo/ForecastXML/index.xml?query=${@:-<YOURZIPORLOCATION>}|xmlstarlet sel -E utf-8 -t -m //forecast/txt_forecast/forecastday -v fcttext -n
This is sample output - yours may be different.
you can use xmlstarlet to parse output instead of perl