Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Feature Request] Detect command line user agents like curl, wget, PowerShell #924

Open
asheroto opened this issue Apr 24, 2023 · 3 comments

Comments

@asheroto
Copy link

I think a great feature to add to Mobile-Detect would be to detect if the user agent is command line based such as curl, wget, PowerShell, etc. That way you could use a command like isCommandLine() or isTextBased() or isCLI().

As an example to illustrate the purpose, the website https://qrenco.de shows up as a regular website in a browser, but if you issue the command curl qrenco.de/https://github.com in your CLI it responds with a QR code. I was thinking - did they use a library to detect that? I don't see the option in Mobile-Detect, so I thought I'd suggest it. 😊

Here is a list of 149 well known user agents that are command line based:
https://gist.github.com/asheroto/ef04c4f067be68bd770395a32967811d

@DrLightman
Copy link

I think that would go out fo the scope of the plugin. It's not meant to be a full rounded detection plugin.
The detection you wrote about can be done with a couple of lines of code of php

@asheroto
Copy link
Author

Ah, I see. Is that also why isBot() was removed from later releases?

@DrLightman
Copy link

it's possibile, but I'm not sure, I didn't even know :D

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants