Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Show HN: embedcurl.com - Pretty curl commands for your web site or blog
32 points by johns on Dec 30, 2013 | hide | past | favorite | 5 comments
Hey all, As a CEO of a growing startup I don't get to code as often as I like and when I do, I try not to annoy my team with my terrible code :) So to scratch the itch, I've built some of side projects related to what our company does. The latest is embedcurl.com

I see a lot of API docs and blogs posting curl commands that are really hard to read and I figured I could make them easier to read and add some niceties like easier copy/paste, tooltips on flags, etc. They also gracefully degrade if javascript isn't enabled back to a <pre> element.

The parsing is done in Python with shlex and argparse (thanks to my co-founder Frank for helping with that part). We're running this on our production infrastructure so it should scale just fine.

My friends at loader.io have already integrated it with their API docs: http://docs.loader.io/api/v2/put/tests/:test_id/run.html

I'd really like your feedback, especially if you enter a command that doesn't parse correctly.

Thanks!



This is really cool. Would be neat if the whole experience could be embedded using an embeddable version of hurl.it, too.


Need to wrap the url in strings, having multiple query parameters (&) in the url will cause issues.


Can you post an example command to repro so I can look into it more closely? Thanks!


Not sure what you mean by repro but this is a simple command that would cause issues if you were to run it. Not issues with your tool, but BASH will background the command up to the ampersand and then set the variable other to 3

curl http://example.com/foo/123?stuff=1&other=3


Long flags are more readable in my opinion. I always use long flags in scripts, the shorter version is nice on the command line though. Do you plan to open source this? Github repo?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: