Live data from Hacker News

Show HN: Curl https://ec2.shop

ec2.shop

41–50 of 84 posts

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

#41
Can I be sure that the prices from this endpoint are accurate (i.e. if Amzn changes the prices, this endpoint will reflect that change)? Off-topic: if I request a spot instance, is there any way (API/cli) to know how much Amzn charges me every hour for that instance?

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

#43
post #41

Can I be sure that the prices from this endpoint are accurate (i.e. if Amzn changes the prices, this endpoint will reflect that change)? Off-topic: if I request a spot instance, is there any way (API/cli) to know how much Amzn charges me every hour for that instance?

I've built something like this in the past (I was running a beefy server for my friends, and wanted them to know how much it was costing us at an hourly rate, before they ran it for 3 weeks straight).

It's definitely possible and not very challenging, but the API Documentation for prices was pretty weak when I built it (a year or two ago, written in Go if it makes a difference). The google cloud prices API was similarly gross. It was kinda fun, but I wouldn't enjoy maintaining that code. In reality, it turns out that $/hour isn't a super straightforward metric (there are many dimensions that go into it), so it's not super straightforward to query.

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

#44
Very neat. Anyone know why

    curl -s https://ec2.shop | grep 't2'
would work, but

    curl -s https://ec2.shop | grep 'm4'
does not? Both commands work if I write the curl result to a file, but when I pipe from curl, the pattern `m4` matches all instances of the number 4.

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

#45
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...

Hey, yes it's 100% open source.

https://github.com/yeo/ec2.shop

The reason it check `curl` agent is because it share the same endpoint (root url) for both of `curl` page and browser version(the one with dropdown, grid etc)

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

#48
post #41

Can I be sure that the prices from this endpoint are accurate (i.e. if Amzn changes the prices, this endpoint will reflect that change)? Off-topic: if I request a spot instance, is there any way (API/cli) to know how much Amzn charges me every hour for that instance?

I think the price is accurate. It's fetched directly from this Amazon endpoint. https://github.com/yeo/ec2.shop/blob/master/download.sh#L9

I'm going to add spot instance. Will just need to figure out what URL AWS is fetching

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

#50
post #44

Very neat. Anyone know why curl -s https://ec2.shop | grep 't2' would work, but curl -s https://ec2.shop | grep 'm4' does not? Both commands work if I write the curl result to a file, but when I pipe from curl, the pattern `m4` matches all instances of the number 4.

It’s not matching every number 4, just the ones at the start of a column. The m is coming from “ESC[31m”, the escape code used to set the color of the text in the column.
Post reply on HN