Here are some curl friendly web services that you can use in your terminal:
curl wttr.inDisplays a nice weather report.
curl wttr.in | less -R
curl https://api.ipify.orgSimply shows your public ip.
curl ipinfo.ioPrints a formatted JSON that contains information about your ip.
curl -Ffirstname.lastname@example.org' https://0x0.stUploads specified file to 0x0.st and returns the url.
curl -F'shorten=http://example.com/some/long/url' https://0x0.stShortens the given URL.
curl --upload-file ./hello.txt https://transfer.sh/hello.txtUploads specified file to transfer.sh and returns the url.
curl http://cheat.sh/tarShows a simple cheatsheet for specified command (in this case
curl https://raw.githubusercontent.com/tldr-pages/tldr/master/pages/common/tar.mdSame thing with above but this uses tldr. But there are some problems:
The first bold part may be one of these:
linux. The second bold part is the command itself. If the command is linux-spesific, its under the
linux folder obviously and most of the other things goes to
common. You can create a small script that takes
command as input and checks the folders one by one and returns if it finds an existing page. This is left as an exercise for the reader. (or you may just simply install a client, visit tldr).
This is not really curl friendly but it works.
curl -s -A "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:56.0) Gecko/20100101 Firefox/56.0" "https://translate.google.com/m?sl=FROM&tl=TO&ie=UTF-8" --data-urlencode "q=WORD_OR_SENTENCE" | grep -Po '<div dir="ltr" class="t0">\K[^<]*'
FROMto source language code, for example
TOto destination language code, for example
WORD_OR_SENTENCEto anything you want. You can use spaces.
This example demonstrates how you can get the relevant information from an ordinary website. Always use the mobile versions if available because it is easier to parse them.
curl rate.sxShows the cryptocurrency rates.
curl rate.sx/:helpfor more information about usage.
curl qrenco.de/STRINGTurns given string/url into an ASCII art QR code.
If you are using a service that supports WebDAV, you can use these simple curl commands to download/upload files to your service. You can also do more sophisticated things with curl but if you need more than just downloading/uploading files then it’s better to use a client dedicated for that service.
curl -u LOGIN:PASSWORD https://WEBSITE.com/DAV_PATH/REMOTE_FILE --output FILE
curl -u LOGIN:PASSWORD -T FILE https://WEBSITE.com/DAV_PATH/REMOTE_FILE
It’s better not to write your password while using these commands. If you remove the password part it will just simply show you a password prompt when you execute these commands which better than exposing your password to bash history.
I’ll just leave a link here: docverter.com. You can convert nearly any format to any other one using this service. It has a nice and clear API. The website provides curl command examples.tags: