Comments (3)
Would you like to submit a PR with the proposed changes?
Thanks
from crawler-detect.
Sorry but I'm still a novice PHP developer and yet to learn how to work with Git :-(
But, what I'm proposing here is changing the method getMatches();
inside "Jaybizzle\CrawlerDetect\CrawlerDetect" as below:
public function getMatches()
{
return isset($this->matches[0]) ? trim(preg_replace('/[^A-Za-z0-9\-\_\.]/', ' ', $this->matches[0])) : null;
}
It will filter out any unwanted special characters and white spaces.
Here I assume that any detected bot should really not require any type of special characters, except a - (minus sign) and an _ (underscore) .
from crawler-detect.
Sorry for the delayed response.
I see where you are coming from, but the getMatches()
method is not really used to return the exact bot that was detected, but more to return the exact portion of the user agent that caused the true response.
It would be nice to by able to have magic methods, such as isHubPages()
but this would require us keeping a more complex database of bots and the beauty of this library is it's simplicity.
Always open to PRs though.
Thanks
from crawler-detect.
Related Issues (20)
- Incorrect agent result: Frontman v1.9.3 linux amd64 HOT 2
- New user agent for Googlebot HOT 1
- The package is not detecting Ahrefs as a crawler HOT 1
- Incorrect agent result HOT 3
- "+http://www.google.com/bot.html" is not detected as crawler HOT 1
- Agent with '+http...' almost always a bot. HOT 1
- Empty user agent HOT 2
- Some Google bots are not identified HOT 5
- Incorrect agent result
- Incorrect agent result
- Unable to install package
- Incorrect agent result HOT 1
- Incorrect agent result
- Incorrect agent result HOT 3
- Probably google bot HOT 1
- Could we add lscache_runner as user agent? HOT 4
- Google Ads bot to add
- Bot to add: InternetMeasurement
- New Google Bot and Facebook bot Google I/O crawler - Build/MMB29P HOT 1
- Laravel Wrapper
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from crawler-detect.