
Terminal - Commands tagged curl - 163 results
curl --silent "FEED ADDRESS" |sed -e 's/<\/[^>]*>/\n/g' -e 's/<[^>]*>//g
This is sample output - yours may be different.
% curl --silent "http://feeds.bbci.co.uk/news/rss.xml" |sed -e 's/<\/[^>]*>/\n/g' -e 's/<[^>]*>//g'
UK retail banks 'need protecting'
UK banks' retail operations should be "ring-fenced" from their investment banking arms, the Independent Commission on Banking recommends.
http://www.bbc.co.uk/go/rss/int/news/-/news/business-13032403
http://www.bbc.co.uk/news/business-13032403
Mon, 11 Apr 2011 13:20:19 GMT
Royal couple on pre-wedding visit
Prince William and Kate Middleton visit Lancashire in their final public engagement before their wedding.
http://www.bbc.co.uk/go/rss/int/news/-/news/uk-england-lancashire-13033244
http://www.bbc.co.uk/news/uk-england-lancashire-13033244
Mon, 11 Apr 2011 12:52:24 GMT
runs an rss feed through sed replacing the closing tags with newlines and the opening tags with white space making it readable.
This is sample output - yours may be different.
HTTP/1.1 302 Found
Location: http://www.google.cn/webhp?source=g_cn
Cache-Control: private
Content-Type: text/html; charset=UTF-8
Date: Mon, 28 Mar 2011 08:29:59 GMT
Server: gws
Content-Length: 235
X-XSS-Protection: 1; mode=block
curl -s http://whatthecommit.com/index.txt | cowsay
This is sample output - yours may be different.
function ds { echo -n "search : "; read ST; EST=`php -r "echo rawurlencode('$ST');"`; B64=`echo -n $ST| openssl enc -base64`; curl -s "http://www.commandlinefu.com/commands/matching/$EST/$B64/plaintext" | less -p "$ST"; } ; bind '"\C-k"':"\"ds\C-m\""
This is sample output - yours may be different.
This is a simple bash function and a key binding that uses commandlinefu's simple and easy search API. It prompts for a search term, then it uses curl to search commandline fu, and highlights the search results with less.
Command in description (Your command is too long - please keep it to less than 255 characters)
This is sample output - yours may be different.
yt2mp3(){ for j in `seq 1 301`;do i=`curl -s gdata.youtube.com/feeds/api/users/$1/uploads\?start-index=$j\&max-results=1|grep -o "watch[^&]*"`;ffmpeg -i `wget youtube.com/$i -qO-|grep -o 'url_map"[^,]*'|sed -n '1{s_.*|__;s_\\\__g;p}'` -vn -ab 128k "`youtube-dl -e ${i#*=}`.mp3";done;}
squeezed the monster (and nifty ☺) command from 7776 from 531 characters to 284 characters, but I don't see a way to get it down to 255. This is definitely a kludge!
curl http://www.discogs.com/search?q=724349691704 2> /dev/null | grep \/release\/ | head -2 | tail -1 | sed -e 's/^<div>.*>\(.*\)<\/a><\/div>/\1/'
This is sample output - yours may be different.
Changed wget to curl and it doesn't create a file anymore.
This is sample output - yours may be different.
qrurl() { curl -sS "http://chart.apis.google.com/chart?chs=200x200&cht=qr&chld=H|0&chl=$1" -o - | display -filter point -resize 600x600 png:-; }
This is sample output - yours may be different.
like 7300, but doesn't clutter your working directory with old qr.*.png files. This will get the QR barcode, and send it right into ImageMagick's 'display' tool. Usage is the same as 7300; just call this function followed by the URL:
qrurl http://xkcd.com
atomtitles () { curl --silent $1 | xmlstarlet sel -N atom="http://www.w3.org/2005/Atom" -t -m /atom:feed/atom:entry -v atom:title -n}
This is sample output - yours may be different.
> atomtitles http://rss.slashdot.org/Slashdot/slashdotatom
Atomic Weight Not So Constant
20 Years of Commander Keen
Amazon Taking Down Erotica, Removing From Kindles
Humble Bundle 2 Is Live
Air Force Blocks NY Times, WaPo, Other Media
FBI Alleged To Have Backdoored OpenBSD's IPSEC Stack
Fourth Amendment Protects Hosted E-mail
McDonald's Hacked and Customer Data Stolen
MS Hypes Win7 Tablets For CES &mdash; Again
Hidden Backdoor Discovered On HP MSA2000 Arrays
Julian Assange's Online Dating Profile Leaked
Why Special Effects No Longer Impress
Why Anonymous Can't Take Down Amazon.com
Watch 200 Years of Global Growth In 4 Minutes
Google Patents Browser Highlight All Button
this simply curls the feed and runs a xpath query on it ...
curl -s -O http://s3.amazonaws.com/alexa-static/top-1m.csv.zip ; unzip -q -o top-1m.csv.zip top-1m.csv ; head -1000 top-1m.csv | cut -d, -f2 | cut -d/ -f1 > topsites.txt
This is sample output - yours may be different.
this will dump a list of domains one per line into a text file
wget -O xkcd_$(date +%y-%m-%d).png `lynx --dump http://xkcd.com/|grep png`; eog xkcd_$(date +%y-%m-%d).png
This is sample output - yours may be different.
Just added view with the eog viewer.
for file in `cat urls.txt`; do echo -n "$file " >> log.txt; curl --head $file >> log.txt ; done
This is sample output - yours may be different.
==log.txt:==
/downloads HTTP/1.1 301 Moved Permanently
/downloads/ HTTP/1.1 404 Not Found
/downloads/downloads/press/logos.zip HTTP/1.1 200 OK
urls.txt should have a fully qualified url on each line
prefix with
rm log.txt;
to clear the log
change curl command to
curl --head $file | head -1 >> log.txt
to just get the http status
findlocation() {place=`echo $@`; lynx -dump "http://maps.google.com/maps/geo?output=json&oe=utf-8&q=$place" | egrep "address|coordinates" | sed -e 's/^ *//' -e 's/"//g' -e 's/address/Full Address/';}
This is sample output - yours may be different.
$ : distance 1600 Pennsylvania Avenue, Washington D.C
Full Address: 1600 Pennsylvania Ave NW, Washington D.C., DC 20500, USA,
coordinates: [ -77.0365191, 38.8976964 ]
Just a few minor changes.
First the usage of lynx instead of curl so no sed is needed to revert the spaces. Then the usages of egrep instead of grep -e to save a few characters and last the removal of the extra 0.
findlocation() { place=`echo $* | sed 's/ /%20/g'` ; curl -s "http://maps.google.com/maps/geo?output=json&oe=utf-8&q=$place" | grep -e "address" -e "coordinates" | sed -e 's/^ *//' -e 's/"//g' -e 's/address/Full Address/';}
This is sample output - yours may be different.
$ findlocation Google Headquarters
Full Address: Google European Headquarters, Gordon House, Barrow St, Dublin, Co. Dublin City, Ireland,
coordinates: [ -6.2363000, 53.3407000, 0 ]
findlocation() { place=`echo $1 | sed 's/ /%20/g'` ; curl -s "http://maps.google.com/maps/geo?output=json&oe=utf-8&q=$place" | grep -e "address" -e "coordinates" | sed -e 's/^ *//' -e 's/"//g' -e 's/address/Full Address/';}
This is sample output - yours may be different.
shadyabhi@ArchLinux ~ $ findlocation DA-IICT
Full Address: Dhirubhai Ambani Institute of Information and Communication Technology, Gandhinagar, Gujarat, India,
coordinates: [ 72.6276828, 23.1891000, 0 ]
shadyabhi@ArchLinux ~ $ findlocation "DA-IICT Gandhinagar"
Full Address: Dhirubhai Ambani Institute of Information and Communication Technology, Gandhinagar, Gujarat, India,
coordinates: [ 72.6276828, 23.1891000, 0 ]
shadyabhi@ArchLinux ~ $
Just add this to your .bashrc file.
Use quotes when query has multiple word length.
for url in `cat urls `; do title=`curl $url 2>&1 | grep -i '<title>.*</title>'` && curl $url > /tmp/u && mail -s "$title" your-private-instapaper-address@instapaper.com < /tmp/u ; done
This is sample output - yours may be different.
Note, you need to replace the email address with your private Instapaper email address.
There are a bunch of possible improvements such as,
- Not writing a temp file
- Doesnt strip tags (tho Instapaper does thankfully)
- Shouldnt require 2 curls
This is sample output - yours may be different.
Check the Description below.
This is sample output - yours may be different.
The command was too long for the command box, so here it is:
echo $(( `wget -qO - http://i18n.counter.li.org/ | grep 'users registered' | sed 's/.*\<font size=7\>//g' | tr '\>' ' ' | sed 's/<br.*//g' | tr ' ' '\0'` + `curl --silent http://www.dudalibre.com/gnulinuxcounter?lang=en | grep users | head -2 | tail -1 | sed 's/.*<strong>//g' | sed 's/<\/strong>.*//g'` ))
This took me about an hour to do. It uses wget and curl because, dudalibre.com blocks wget, and wget worked nicely for me.
shout() { curl -s "http://shoutkey.com/new?url=${1}" | sed -n "/<h1>/s/.*href=\"\([^\"]*\)\".*/\1/p" ;}
This is sample output - yours may be different.
http://shoutkey.com/multiple
shout () { curl -s "http://shoutkey.com/new?url=$1" | sed -n 's/\<h1\>/\&/p' | sed 's/<[^>]*>//g;/</N;//b' ;}
This is sample output - yours may be different.
$ shout http://www.commandlinefu.com
remind
Just add this function to your .zshrc / .bashrc, and by typing "shout *URL*" you get a randomly chosen English word that ShoutKey.com uses to short your URL. You may now go to shoutkey.com/*output_word* and get redirected. The URL will be valid for 5 minutes.
(I've never used sed before, so I'll be quite glad if someone could straighten up the sed commands and combine them (perhaps also removing the whitespace). If so, I'll update it right away ;) )
curl -n --ssl-reqd --mail-from "<user@gmail.com>" --mail-rcpt "<user@server.tld>" --url smtps://smtp.gmail.com:465 -T file.txt
This is sample output - yours may be different.
Required curl version >=7.21; using .netrc for authorization
googl () { curl -s -d "url=${1}" http://goo.gl/api/url | sed -n "s/.*:\"\([^\"]*\).*/\1\n/p" ;}
This is sample output - yours may be different.
Shorter and made into a function.
curl -s -d'&url=URL' http://goo.gl/api/url | sed -e 's/{"short_url":"//' -e 's/","added_to_history":false}/\n/'
This is sample output - yours may be different.
curl -s -d'&url=www.google.com' http://goo.gl/api/url | sed -e 's/{"short_url":"//' -e 's/","added_to_history":false}/\n/'
http://goo.gl/fbsS
Use curl and sed to shorten an URL using goo.gl without any other api
imageshack() { for files in *; do curl -H Expect: -F fileupload="@$files" -F xml=yes -# "http://www.imageshack.us/index.php" | grep image_link | sed -e 's/<image_link>/[IMG]/g' -e 's/<\/image_link>/[\/IMG]/g'; done; }
This is sample output - yours may be different.
[user@host ~]$ imageshack
######################################################################## 100.0%
[IMG]http://img541.imageshack.us/img541/5382/wifidock01.png[/IMG]
######################################################################## 100.0%
[IMG]http://img716.imageshack.us/img716/54/wifidock02.png[/IMG]
######################################################################## 100.0%
[IMG]http://img825.imageshack.us/img825/6664/wifidock03.jpg[/IMG]
Each file in the current folder is uploaded to imageshack.us
If the folder contains other filetypes
change:
for files in *
to:
for files in *.jpg
(to upload ONLY .jpg files)
Additionally you can try (results may vary):
for files in *.jpg *.png
The output URL is encased with BB image tags for use in a forum.
check(){ curl -sI $1 | sed -n 's/Location: *//p';}
This is sample output - yours may be different.