crawler_detector 0.0.2 copy "crawler_detector: ^0.0.2" to clipboard
crawler_detector: ^0.0.2 copied to clipboard

Functions for detecting user agents that are web crawlers, such as search engines, ad systems, and more, which can help optimizing the app for better crawlability.

Helps Flutter and Dart apps detect when they are being crawled by a web crawler.

Features #

This package pattern-matches the user agent string against a list of known patterns to detect a crawler.

The implementation can detect crawlers in all Dart web targets, including Flutter Web apps, and DOM-based Dart apps (e.g. those using Jaspr or AngularDart).

Dart VM targets are not web targets, and therefore you can never detect a crawler from within the Dart VM (e.g. command-line Dart apps, Flutter mobile or desktop apps).

Usage #

Add a dependency to pubspec.yaml:

dependencies:
  crawler_detector: any

Import the package and use it:

import 'package:crawler_detector/crawler_detector.dart';

void main() {
  final bool isCrawlerUserAgent = detectCrawler();
  print('The current user agent is${isCrawlerUserAgent ? '' : ' not'} a crawler.');
}
0
likes
150
pub points
1%
popularity

Publisher

unverified uploader

Functions for detecting user agents that are web crawlers, such as search engines, ad systems, and more, which can help optimizing the app for better crawlability.

Repository (GitHub)
View/report issues

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

web

More

Packages that depend on crawler_detector