verhovsky's comments

verhovsky | 3 years ago | on: Curl 8.0.1

You can paste that curl command into https://curlconverter.com/wget/ to turn it into a Wget command.

> 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: Ask HN: What companies are embracing “HTML over the wire”?

70,000-90,000 unique monthly visitors, according to client-side analytics.

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: Have you created programs for only your personal use?

I made a text box that shows the unicode code points that make up the input text.

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've had Copilot teach/tell me about things I didn't know I needed to be considering.

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

Sorry, it's too late to delete my comment but I realize now that you were asking about generating C code, not which language the project should be implemented in. "Curl already has argument parsing code, why can't we just call it?" is something I've thought a lot so I assumed someone would also suggest it here.

verhovsky | 4 years ago | on: Convert curl commands to code in several languages

The JSON output just dumps curlconverter's internal representation of a parsed curl command. You could use it if you want to use curlconverter to parse curl commands and then do stuff with that parsing yourself in a language other than JavaScript. You would install the command line tool then use your language's command-running library. For example, from Python:

    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

Re-using curl's C code and compiling to WASM is the dream.

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 | 7 years ago | on: Nearly 1,000 Paintings and Drawings by Vincent van Gogh Digitized and Put Online

Street View has 2,362 museums (including this one) which you can look at with a vive, oculus or daydream. Or do you want 3D scans?

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

page 1