crawler-user-agents 1.0.95 → 1.0.96
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -32,7 +32,7 @@ console.log(crawlers);
|
|
|
32
32
|
Each `pattern` is a regular expression. It should work out-of-the-box wih your favorite regex library:
|
|
33
33
|
|
|
34
34
|
* JavaScript: `if (RegExp(entry.pattern).test(req.headers['user-agent']) { ... }`
|
|
35
|
-
* PHP: add a slash before and after the pattern:
|
|
35
|
+
* PHP: add a slash before and after the pattern: `if (preg_match('/'.$entry['pattern'].'/', $_SERVER['HTTP_USER_AGENT'])): ...`
|
|
36
36
|
* Python: `if re.search(entry['pattern'], ua): ...`
|
|
37
37
|
|
|
38
38
|
## Contributing
|