Cool! You should probably add http support and not only https. Writing `curl ec2.shop` is easier than `curl https://ec2.shop`
Show HN: Curl https://ec2.shop
21–30 of 84 posts
Re: Show HN: Curl https://ec2.shop
#22Re: Show HN: Curl https://ec2.shop
#23I personally try looking into implementing a curl "interface" to one of my projects, realised that it actually need to check the user-agent (of curl and a plethora of curl alternatives) which I find kind of weird...
Re: Show HN: Curl https://ec2.shop
#24Cool! You should probably add http support and not only https. Writing `curl ec2.shop` is easier than `curl https://ec2.shop`
These days curl should probably default to https. Or at least give you an environmental variable where you can define the default protocol (libcurl does offer something similar: https://curl.haxx.se/libcurl/c/CURLOPT_DEFAULT_PROTOCOL.html )
alias curl='curl --proto-default https'Re: Show HN: Curl https://ec2.shop
#25Color output seems to be tuned for dark terminal backgrounds. Memory, vCPUs, and Storage are nearly unreadable on a white background.
I've moaned about this with other CLI tools as well. I wish trend of using RGB values in ANSI escape codes would die because as ugly as the 16*3 colour fields¹ are, they are at least customisable so people can use palettes that suite their terminal and eyesight. You don't get any such opportunity if the developers hard code the colour values in (and it's worse with a tool like this because you can't even set an envir…
You said you can't even set an env variable to change them so I assume that there is an even better way?
Re: Show HN: Curl https://ec2.shop
#26Very hand. Can you add sorting?
Re: Show HN: Curl https://ec2.shop
#27Very hand. Can you add sorting?
Re: Show HN: Curl https://ec2.shop
#28Could you update the `...&filter...` example to wrap the URL in quotes so that the `&` isn't interpretted by the shell as sending the process to the background?
Re: Show HN: Curl https://ec2.shop
#29From time to time, I want a quick tool to help me compare EC2 instances price. https://ec2instances.info/ works great but it's somewhat slow and didn't have a way to just `curl` from terminal. So I develop this small tool which you can do thing like curl https://ec2.shop curl https://ec2.shop?region=us-west-2&filter=t2,m4
Are you manually detecting Curl specifically? If I use anything other than Curl, e.g. HTTPie or wget, I get the HTML page, even if I provide an `Accept: text/plain` request header. If I use one of those tools and spoof the Curl user agent string, I get the text/plain response. You should probably just look at the Accept request header, it’s there specifically so clients can tell you what kind of response they want.
Re: Show HN: Curl https://ec2.shop
#30Is this open sourced? I personally try looking into implementing a curl "interface" to one of my projects, realised that it actually need to check the user-agent (of curl and a plethora of curl alternatives) which I find kind of weird...
Like someone suggested for the featured page as well, I recommend you make use of the accept header.
For example, assuming your interface is outputting freeform text (since the goal was to have something readable in terminal), you could use something like this:
Accept: text/vnd.myproject.tui+plain; version=1.0
(Substitute “myproject” with the actual name of your project.)