verhovsky | 2 years ago | on: Show HN: OpenAPI DevTools – Chrome extension that generates an API spec
verhovsky's comments
verhovsky | 2 years ago | on: I gave commit rights to someone I didn't know (2016)
verhovsky | 3 years ago | on: Curl 8.0.1
> The reason there isn't a "Copy as wget" option, I think, is the level of control that curl allows so the request can be tailored to exactly mimic the browser.
That's not true. You can read the code that generates the curl command, it's pretty straightforward:
https://github.com/ChromeDevTools/devtools-frontend/blob/c9a...
The arguments it uses are --url, --data-raw, -X/--request, -H/--header, --compressed and --insecure, all of which Wget has an analog of. I think the reason is that they don't care to do it and/or they don't want to make that "Copy" dropdown too long.
verhovsky | 3 years ago | on: Twenty-five years of curl
verhovsky | 3 years ago | on: Ask HN: What companies are embracing “HTML over the wire”?
Someone wanted to buy the site so we added client-side analytics in August to December 2022
https://plausible.io/curlconverter.com?period=custom&from=20...
We also moved the site from GitHub Pages to Cloudflare Pages just for August 2022, to run server-side analytics to count the people that block ads and that said 116k "visits", compared to 67k "unique visitors" and 112k "total pageviews" from client-side analytics for the same time period (August 31st is missing because Cloudflare only lets you see 30 days). 116k and 112k are really close, which makes me suspect that I misunderstood and Cloudflare is actually also doing client-side analytics, but if that's not the case then it's 120,000-150,000 monthly visits.
Back in September 2021 the site used to have Google Analytics and that said 25k users with 60k sessions from Sept 17 to Oct 17 2021.
They offered us 15K for the site so we didn't sell it and they cloned it, since it's all open source. We removed the analytics again in January 2023 for the same reason we removed them before, curl commands copied from the browser might contain cookies or auth tokens and it's easier to not worry about the possibility of them accidentally getting logged by the analytics and also because it's kind of expensive and I got laid off in November. Knowing people are using your code is nice though.
> I couldn't imagine any web developer need such kind of tool [knowing curl by heart]
There might be some edge cases in Bash syntax or curl's option parsing you might miss that the tool won't (or vice versa), but you're right, rewriting a curl command in another language by hand is straightforward. But if you're doing it a lot it gets tedious and some people are writing web scrapers and bots full-time. You usually start with a curl command from the browser or some API's documentation, and if you want to do something with the returned data, you rarely want to do it in Bash. You could call the curl command and read the output in Python but you'll have better error handling and less code if you use an HTTP library. A better solution would be adding "Copy as Python", "Copy as R" etc. to Chrome directly and I opened a PR for Python but I haven't polished it enough for them to just merge it
https://chromium-review.googlesource.com/c/devtools/devtools...
curl is kind of complex and expects you to understand HTTP. It's better if developers that don't want/need to learn it can bypass it.
verhovsky | 3 years ago | on: Ask HN: What companies are embracing “HTML over the wire”?
https://github.com/curlconverter/curlconverter.github.io/pul...
verhovsky | 3 years ago | on: Ask HN: What are some keywords you track everyday?
verhovsky | 3 years ago | on: Ask HN: What are some keywords you track everyday?
verhovsky | 3 years ago | on: Ask HN: Have you created programs for only your personal use?
https://verhovs.ky/unicode-debugger/
https://github.com/verhovsky/unicode-debugger
It's probably not completely correct and there's probably issues stemming from the fact that text in web browsers is UTF-16 not UTF-8, but I've used it to quickly figure out that someone's input wasn't being parsed correctly because the spaces were actually non-breaking spaces for example. It can be used for noticing when some text has a letter that looks the same but is actually a different letter than you think (homoglyph attack) or to see what makes up an emoji.
verhovsky | 4 years ago | on: It’s Like GPT-3 but for Code – Fun, Fast, and Full of Flaws
I was writing a parser for URL query strings (?these=things&key=value) and at one point Copilot suggested
return [decodeURIComponent(key), decodeURIComponent(value)];
and until I saw that I didn't even know that percent encoded text in URLs is something I needed to be thinking about.verhovsky | 4 years ago | on: Convert curl commands to code in several languages
verhovsky | 4 years ago | on: Convert curl commands to code in several languages
verhovsky | 4 years ago | on: Convert curl commands to code in several languages
verhovsky | 4 years ago | on: Convert curl commands to code in several languages
import subprocess
import json
result = subprocess.run(['curlconverter', '--language', 'json', 'example.com'], capture_output=True, text=True)
command = json.loads(result.stdout)
print(command)verhovsky | 4 years ago | on: Convert curl commands to code in several languages
libcurl does stuff like open files for reading, so you would have to at least modify the code to just pass the file name, you also have to modify the struct.
libcurl parses an array of strings, but curlconverter gets a Bash AST (or a list of strings if you use it from the command line). When there's a bash variable in the command, we want to generate code that gets that environment variable at runtime, e.g. `os.environ['MY_VARIABLE']` in Python so the struct needs to store pointers to AST nodes instead of strings/booleans/ints. Though to be fair curlconverter doesn't work this way either (yet), we convert AST nodes to strings/booleans/ints after command parsing and store that, then when we're generating the code if we see a $ in a string we assume that was a variable in the input AST.
verhovsky | 4 years ago | on: Convert curl commands to code in several languages
verhovsky | 7 years ago | on: Nearly 1,000 Paintings and Drawings by Vincent van Gogh Digitized and Put Online
https://artsandculture.google.com/theme/igKSKBBnEBSGKg
https://artsandculture.google.com/search/streetview?project=...
https://artsandculture.google.com/partner/van-gogh-museum
https://artsandculture.google.com/partner/palace-of-versaill... look at the https://en.wikipedia.org/wiki/Hall_of_Mirrors
There's a Daydream app for looking at paintings scanned by Google https://play.google.com/store/apps/details?id=com.google.vr..... You'll need the $100 headset and a Pixel or some other compatible phone.
Google's collection is large but nowhere near exhaustive. I think some paintings are over 100,000 pixels across. In my opinion virtual reality doesn't add much. It's blurry. If you have a good monitor the website is better
https://artsandculture.google.com/favorite/group/fAKyrWQ7SlX...
Wikimedia Commons has hundreds of scans for some artists
https://commons.wikimedia.org/wiki/Category:Paintings_by_art...
https://github.com/curlconverter/curlconverter/issues/64#iss...