|
|
|
Ask HN: Do you set the user-agent on your scripts?
|
|
3 points
by kfdm
1849 days ago
|
|
Typically I try to remember to set the user-agent on tools/scripts I make, to avoid default agents like `Go-http-client/version` or `python-request/version` but it seems like a lot of projects do not always set it. Sometimes I will submit patches to projects to fix this, though sometimes I wonder if I'm in the minority of developers who prefer to properly set user-agent. (I am fully aware and agree that the user-agent for most web browsers is terribly complicated and almost useless at this point. My focus is more on bots/scrapers/etc) |
|
When scripting things that probably shouldn’t be scripted but I care about them (like covid stuff), I’ll take the time to find a good browser user agent. I would be worried about bot-prevention measures catching a non-standard user agent and taking it down. Or even worse, someone else made a terrible script posting dos-level traffic and mine gets banned along with it...
The next level is using a custom but specific-to-the-script user agent. I do this whenever I also own the backend, to make tracking down logs way easier.
For everything else, I use the default! In this case, taking the extra time to think of an appropriate user agent isn’t helpful to the project. Sometimes, I might still send up Star Wars references for fun.