Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Add Majestic MJ12 Bot a very common seo bot #596

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 10 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@ dist: trusty
language: php

php:
- 5.4
- 5.5
- 5.6
- 7.0
- 7.1
- 7.2
- 7.3
- 7.4
# - 8.0 (Release Date: November 26, 2020)

before_script:
- composer self-update
Expand All @@ -22,20 +20,20 @@ before_script:
# Set memory limit to 2 MB
- echo "memory_limit=2048M" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini

# Disable X-debug on all but PHP 5.6
- if [ "$TRAVIS_PHP_VERSION" != "5.6" ]; then phpenv config-rm xdebug.ini; fi
# Disable X-debug on all but PHP 7.0
- if [ "$TRAVIS_PHP_VERSION" != "7.0" ]; then phpenv config-rm xdebug.ini; fi

script:
- vendor/bin/phpcs --standard=PSR1,PSR2 -n src

# Run tests (all except PHP 5.6)
- if [ "$TRAVIS_PHP_VERSION" != "5.6" ]; then php bin/runner.php --show check; fi
- if [ "$TRAVIS_PHP_VERSION" != "5.6" ]; then vendor/bin/phpunit; fi
# Run tests (all except PHP 7.0)
- if [ "$TRAVIS_PHP_VERSION" != "7.0" ]; then php bin/runner.php --show check; fi
- if [ "$TRAVIS_PHP_VERSION" != "7.0" ]; then vendor/bin/phpunit; fi

# Run tests with coverage enabled (only PHP 5.6)
- if [ "$TRAVIS_PHP_VERSION" = "5.6" ]; then php bin/runner.php --coverage --show check; fi
- if [ "$TRAVIS_PHP_VERSION" = "5.6" ]; then vendor/bin/phpunit --coverage-clover phpunit.xml; fi
# Run tests with coverage enabled (only PHP 7.0)
- if [ "$TRAVIS_PHP_VERSION" = "7.0" ]; then php bin/runner.php --coverage --show check; fi
- if [ "$TRAVIS_PHP_VERSION" = "7.0" ]; then vendor/bin/phpunit --coverage-clover phpunit.xml; fi

after_script:
# Upload coverage to Coveralls.io
- if [ "$TRAVIS_PHP_VERSION" = "5.6" ]; then travis_retry php vendor/bin/coveralls -v; fi
- if [ "$TRAVIS_PHP_VERSION" = "7.0" ]; then travis_retry php vendor/bin/coveralls -v; fi
1 change: 1 addition & 0 deletions data/applications-bots.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@
[ 'name' => 'Livedoor', 'id' => 'livedoor', 'regexp' => '/livedoor/u' ],
[ 'name' => 'LTX71', 'id' => 'ltx71', 'regexp' => '/ltx71/u' ],
[ 'name' => 'Magpie RSS', 'id' => 'magpie', 'regexp' => '/MagpieRSS\/([0-9.]*)/u' ],
[ 'name' => 'Majestic MJ12 Bot', 'id' => 'majestic', 'regexp' => '/MJ12bot\/v([0-9.]*)/u' ],
[ 'name' => 'Mapian News Bot', 'id' => 'mapion', 'regexp' => '/mapion-news-bot\/([0-9.]*)/u' ],
[ 'name' => 'Mail.ru Bot', 'id' => 'mail\.ru', 'regexp' => '/Mail\.RU_Bot\/Img\/([0-9.]*)/i' ],
[ 'name' => 'Mail.ru Bot', 'id' => 'mail\.ru', 'regexp' => '/Mail\.RU_Bot\/([0-9.]*)/i' ],
Expand Down
2 changes: 1 addition & 1 deletion data/regexes/applications-bots.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

namespace WhichBrowser\Data;

Applications::$BOTS_REGEX = '/(008|360|a6|abound|muncher|adaxas|addthis|admantx|ahrefsbot|archiver|altavista|curious|cloudfront|amorank|archive|jeeves|astra|backlink|baidu|bazqux|bingbot|msnbot|msmobot|bing|blogbridge|bloglines|bloglovin|blogpulse|blogram|blogtrot|blogshares|boardreader|browsershots|bubing|buck|butterfly|bytespider|heritrix|cliqz|cloudflare|comodo|commafeed|cbot|watchdog|datasearch|daumoa|digg|domaincrawl|discord|domain|exabot|exactseek|ezooms|facebook|fast|flamingo|fastladder|feed|wrangler|validator|fever|florienzh|friendica|robot|genieo|fetchor|google|gomez|ichiro|gooblog|goorss|grammarly|grub|hatena|capture|heureka|htdig|httpmon|hubpages|spider|crawler|kakao|kouio|larbin|linkedin|linkdex|livedoor|ltx71|magpie|mapion|mail\.ru|socialstreams|mixi|mnogo|monitor|dotbot|rogerbot|yeti|netcraft|netvibes|newsblur|newsgator|nimbostratus|orange|pages|psbot|pingdom|pinterest|pocket|postrank|comment|rssbar|hunter|quora|safesearch|scrapy|semrush|seznam|shopwiki|reader|simplepie|site24|slack|sogou|sophora|soso|spdycheck|spinn|detector|summify|telegram|twisted|twitter|tiny|tlsprober|typhoeus|vagabondo|voat|voila|vocus|mcrawler|w3bot|jigsaw|w3c|wayback|webindexer|wordpress|mechanize|xerka|sitemap|yacy|yandex|yahoo|y\!j|slurp|yelp|httpclient|nutch|synapse|indy|wget|curl|package|java|simple|libwww|lwp|urllib|requests|php|pear|zend|ruby)/i';
Applications::$BOTS_REGEX = '/(008|360|a6|abound|muncher|adaxas|addthis|admantx|ahrefsbot|archiver|altavista|curious|cloudfront|amorank|amphtml|archive|jeeves|astra|backlink|baidu|bazqux|bingbot|msnbot|msmobot|bing|blogbridge|bloglines|bloglovin|blogpulse|blogram|blogtrot|blogshares|boardreader|browsershots|bubing|buck|butterfly|bytespider|heritrix|cliqz|cloudflare|comodo|commafeed|cbot|watchdog|datasearch|daumoa|digg|domaincrawl|discord|domain|exabot|exactseek|ezooms|facebook|fast|flamingo|fastladder|feed|wrangler|validator|fever|florienzh|friendica|robot|genieo|fetchor|gomez|ichiro|gooblog|goorss|gsa|lighthouse|feedburner|grammarly|grub|hatena|capture|heureka|htdig|httpmon|hubpages|spider|crawler|kakao|kouio|larbin|linkedin|linkdex|livedoor|ltx71|magpie|majestic|mapion|mail\.ru|socialstreams|mixi|mnogo|monitor|dotbot|rogerbot|yeti|netcraft|netvibes|newsblur|newsgator|nimbostratus|orange|pages|psbot|pingdom|pinterest|pocket|postrank|comment|rssbar|hunter|quora|safesearch|scrapy|semrush|seznam|shopwiki|reader|simplepie|site24|slack|sogou|sophora|soso|spdycheck|spinn|detector|summify|telegram|twisted|twitter|tiny|tlsprober|typhoeus|vagabondo|voat|voila|vocus|mcrawler|w3bot|jigsaw|w3c|wayback|webindexer|wordpress|mechanize|xerka|sitemap|yacy|yandex|yahoo|y\!j|slurp|yelp|httpclient|nutch|synapse|indy|wget|curl|package|java|simple|libwww|lwp|urllib|requests|php|pear|zend|ruby)/i';
2 changes: 1 addition & 1 deletion data/regexes/applications-browsers.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

namespace WhichBrowser\Data;

Applications::$BROWSERS_REGEX = '/(115|126|2345|37abc|qihu|1stbrowser|7star|abrowse|acorn|acoo|amigo|aol|america|apus|arachne|arora|aweb|avant|asw|avg|aviator|avira|flyflow|bdbrowser|bdspark|basilisk|beamrise|beonex|blackwren|blackhawk|bolt|blackbird|brave|brisk|browsex|browzar|byffox|camino|canure|ccleaner|cent|charon|chedot|cheshire|chimlac|chimera|chromeplus|colibri|columbus|cometbird|comodo|dragon|conkeror|coc|coolnovo|corom|crazy|crusta|cunaguaro|cyberdog|cyberfox|daedalus|degan|demeter|deskbrowse|diigo|dillo|doczilla|rhodonit|dplus|elements|eudoraweb|falkon|flamesky|flock|framafox|freeu|galeon|globalmojo|epiphany|greenbrowser|hola|hydra|ibrowse|icab|iceape|icecat|icedove|iceweasel|irider|iridium|iron|kapiko|kazehakase|kchrome|kinza|kkman|klondike|kylo|meleon|lbrowser|lbbrowser|light|lobo|lolifox|lovense|lunascape|naenara|netcaptor|madfox|mxbrowser|min|mini|mixshark|mlbrowser|mypal|multixp|netpositive|nichrome|origyn|owb|live|juzi|orca|oregano|otter|palemoon|patriott|perk|polarity|privacy|qiyu|qtweb|quicklook|qupzilla|qute|rekonq|ryouko|sylera|saayaa|salam|shiira|sielo|sitekiosk|sleipnir|slimjet|metasr|sparrow|stainless|station|sunchrome|sundance|sundial|superbird|swiftweasel|swiftfox|swing|to-browser|tencent|tenfourfox|theworld|tulip|tungsten|ultrab|usejump|vimprobable|vivaldi|airwatch|vonkeror|voyager|waterfox|whale|winwap|xvast|yabrowser|zvu|zipzap|1password|3g explorer|4g explorer|aloha|atomiclite|au|awakening|baidu|bdmobile|bidu|baiduboxapp|browser|blazer|acheetahi|cornowser|coolmarket|cute|digia|doris|doroty|www browser|epic|eui|go\.web|helium|heytap|huohoubrowser|surfboard|isurf|jig browser|jumanji|tnsbrowser|kiosk|kiwi|lebrowser|liebao|macross|mammoth|mcent|mint|mib|cmcs|motorola|multizilla|netfrontlife|onebrowser|oneplus|plink|polaris|pure|openwave|up|km|oppo|quark|realme|semc|stnc|sogou|symphony|tenta|ucpro|vivo|weblite|wk|yaani|alti|aplix|awox|browserserver|isis|netbox|spyglass|oregan|viera|zetakey|bunjalloo|nwf|nuanti|wib|prince|demobrowser|dooble|dwb|evm|fireweb|hive|intermec|phantom|qt|roccat|raven|rockmelt|scope|slim|smbrowser|snowshoe|sputnik|surf|tao|taz|uzbl|villanova|vimb|wada|wavelink|webrender|webster|wyzo|yelang|yrcweb|linemode|lynx|links|w3m|nimbus|Webwasher|sankore|adapi|brightsign|coship)/i';
Applications::$BROWSERS_REGEX = '/(115|126|2345|37abc|qihu|1stbrowser|7star|abrowse|acorn|acoo|amigo|aol|america|apus|arachne|arora|aweb|avant|asw|avg|aviator|avira|flyflow|bdbrowser|bdspark|basilisk|beamrise|beonex|blackwren|blackhawk|bolt|blackbird|brave|brisk|browsex|browzar|byffox|camino|canure|ccleaner|cent|charon|chedot|cheshire|chimlac|chimera|chromeplus|colibri|columbus|cometbird|comodo|dragon|conkeror|coc|coolnovo|corom|crazy|crusta|cunaguaro|cyberdog|cyberfox|daedalus|degan|demeter|deskbrowse|diigo|dillo|doczilla|rhodonit|dplus|elements|eudoraweb|falkon|flamesky|flock|framafox|freeu|galeon|globalmojo|epiphany|greenbrowser|hola|hydra|ibrowse|icab|iceape|icecat|icedove|iceweasel|irider|iridium|iron|kapiko|kazehakase|kchrome|kinza|kkman|klondike|kylo|meleon|lbrowser|lbbrowser|light|lobo|lolifox|lovense|lunascape|naenara|netcaptor|madfox|mxbrowser|min|mini|mixshark|mlbrowser|mypal|multixp|netpositive|nichrome|origyn|owb|live|juzi|orca|oregano|otter|palemoon|patriott|perk|polarity|privacy|qiyu|qtweb|quicklook|qupzilla|qute|rekonq|ryouko|sylera|saayaa|salam|shiira|sielo|sitekiosk|sleipnir|slimjet|metasr|sparrow|stainless|station|sunchrome|sundance|sundial|superbird|swiftweasel|swiftfox|swing|to-browser|tencent|tenfourfox|theworld|tulip|tungsten|ultrab|usejump|vimprobable|vivaldi|airwatch|vonkeror|voyager|waterfox|whale|winwap|xvast|yabrowser|zvu|zipzap|1password|3g explorer|4g explorer|aloha|atomiclite|au|awakening|baidu|bdmobile|bidu|baiduboxapp|browser|blazer|acheetahi|cornowser|coolmarket|cute|digia|doris|doroty|ecosia|www browser|epic|eui|go\.web|helium|heytap|huohoubrowser|surfboard|isurf|jig browser|jumanji|tnsbrowser|kiosk|kiwi|lebrowser|liebao|macross|mammoth|mcent|mint|mobicip|mib|cmcs|motorola|multizilla|netfrontlife|onebrowser|oneplus|plink|polaris|pure|openwave|up|km|oppo|quark|realme|semc|stnc|sogou|symphony|tenta|ucpro|vivo|weblite|wk|yaani|alti|aplix|awox|browserserver|isis|netbox|spyglass|oregan|viera|zetakey|bunjalloo|nwf|nuanti|wib|prince|demobrowser|dooble|dwb|evm|fireweb|hive|intermec|phantom|qt|roccat|raven|rockmelt|scope|slim|smbrowser|snowshoe|sputnik|surf|tao|taz|uzbl|villanova|vimb|wada|wavelink|webrender|webster|wyzo|yelang|yrcweb|linemode|lynx|links|w3m|nimbus|Webwasher|sankore|adapi|brightsign|coship)/i';
2 changes: 1 addition & 1 deletion data/regexes/applications-others.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

namespace WhichBrowser\Data;

Applications::$OTHERS_REGEX = '/(itunes|qt|bluefish|nightingale|songbird|stagefright|substream|vlc|windows-media|coreplayer|flycast|boxee|kodi|xbmc|lightning|thunderbird|outlook|lotus|postbox|bat|yahoo|daum|flipboard|akregator|blogos|cococ|feed|liferea|news|jetbrains|rss|reeder|reedkit|rome|ziepod|messenger|kakao|kik|line|slack|viber|whatsapp|wire|yammer|fbios|fb4a|googleplus|instagram|pinterest|weibo|tumblr|twitter|wp-android|yelp|office|bingweb|hao123|gsa|naver|sogousearch|yandex|atom|golive|brackets|iweb|frontpage|amaya|websphere|download|tansodl|origin|secondlife|valve|raptr|alipay|cooliris|google|leechcraft|expeditor)/i';
Applications::$OTHERS_REGEX = '/(itunes|qt|bluefish|nightingale|songbird|stagefright|substream|vlc|windows-media|coreplayer|flycast|boxee|kodi|xbmc|lightning|thunderbird|outlook|lotus|postbox|bat|yahoo|daum|flipboard|akregator|blogos|cococ|feed|liferea|news|jetbrains|rss|reeder|reedkit|rome|ziepod|messenger|kakao|kik|line|slack|viber|whatsapp|wire|yammer|zalo|fbios|fb4a|googleplus|instagram|pinterest|weibo|tumblr|twitter|wp-android|yelp|office|bingweb|hao123|gsa|naver|sogousearch|yandex|atom|golive|brackets|iweb|frontpage|amaya|websphere|download|tansodl|origin|secondlife|valve|raptr|alipay|cooliris|google|leechcraft|expeditor)/i';
4 changes: 4 additions & 0 deletions tests/data/bots/generic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -586,3 +586,7 @@
headers: 'User-Agent: PocketParser/2.0 (+https://getpocket.com/pocketparser_ua)'
readable: 'Pocket 2.0'
result: { browser: { name: Pocket, version: '2.0' }, device: { type: bot } }
-
headers: 'User-Agent: Mozilla/5.0 (compatible; MJ12bot/v1.4.8; http://mj12bot.com/)'
readable: 'Majestic MJ12 Bot 1.4.8'
result: { browser: { name: 'Majestic MJ12 Bot', version: '1.4.8' }, device: { type: bot } }