PageRenderTime 87ms CodeModel.GetById 27ms RepoModel.GetById 0ms app.codeStats 0ms

/wowengine/util/useragents.py

https://gitlab.com/kissarat/wowenginecmd
Python | 30 lines | 26 code | 3 blank | 1 comment | 0 complexity | 02207d1922b02f5daede7d6ffe9188ea MD5 | raw file
  1. import re
  2. # thanks to django-experiments
  3. ROBOTS_TAGS = """
  4. baidu gigabot googlebot yandexbot tversity yeti
  5. msnbot bingbot facebookexternalhit twitterbot twitmunin siteuptime twitterfeed zibb zyborg
  6. spider crawler bot slurp fetcher fetch proxy perl checker check checkup index indexer
  7. wordpress python mail.ru apple-pubsub java/1 wget httpclient bsalsa.com
  8. butterfly larbin w3c_validator ia_archiver bsalsa.com nutch
  9. screenshot-generator yandexblogs sitetruth.com yandexdirect crawler4j
  10. webagent.wise-guys.nl intraweb webmaster@livejournal.com linkdex.com
  11. linkpeek.com appengine-google hourlypress curl twitturls strawberryj.am
  12. vonchimpenfurlr short-url fetchd urlresolver url_builder http_request
  13. xmlrpc .php <?php xml-rpc PHP/5 pecl
  14. movabletype mechanize ruby libwww lynx w3m ostrovok lwp- metauri
  15. mailchimp.com openwave pagepeeker.com readability rss-harvester quicktime
  16. seostats scraping safarizator webcollage loadimpact.com
  17. publisher links webdav websitevila webcolars unrecognized voyager.exe dwnloadmnger
  18. .. watchmouse.com sniffer bodyground.ru anonymouse.org yandexmarket facebookplatform
  19. ichiro parser resolver pingadmin ping-admin nmap embedly yahooysmcm pipes heritrix
  20. duckduckgo.com typhoeus /etc rivva docomo enterprise_search kaz.kz ahrefsbot
  21. urlsearchhook search.bot google-site user-agent verification
  22. """
  23. ROBOTS_RE = re.compile('(?:%s)' % ('|'.join(re.escape(tag) for tag in ROBOTS_TAGS.split())))
  24. def is_robot(request):
  25. return ROBOTS_RE.search(request.user_agent.string.lower())