Live data from Hacker News

Show HN: Curl https://ec2.shop

ec2.shop

21–30 of 84 posts

Re: Show HN: Curl https://ec2.shop

#21
post #5

Cool! 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)

Re: Show HN: Curl https://ec2.shop

#23
Is 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...

Re: Show HN: Curl https://ec2.shop

#24
post #21
post #5

Cool! 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

#25
post #19
post #12

Color 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…

Can you link me to a way to use colours that change with the terminal colour preset? I haven't come across anything like that or maybe didn't pay attention. It would be really helpful

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

#29

From 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.

There should be a new mime type for this: text/x-ansi

Re: Show HN: Curl https://ec2.shop

#30
post #23

Is 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...

> realised that it actually need to check the user-agent

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.)
Post reply on HN