Skip to content

Commit

Permalink
Update LinkPreviewOrigin class to
Browse files Browse the repository at this point in the history
LinkPreviewDetector
  • Loading branch information
brunoinds committed Nov 28, 2023
1 parent cf55e53 commit ecf5649
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ composer require brunoinds/link-preview-detector
```php
use Brunoinds\LinkPreviewDetector\LinkPreviewDetector;

$response = LinkPreviewOrigin::isForLinkPreview();
$response = LinkPreviewDetector::isForLinkPreview();
//returns a boolean (true/false). If it is true, it means the request is coming from a link preview crawler.
```
This method auto-capture the request origin and user-agent, and detects if is for link preview.
Expand All @@ -38,6 +38,6 @@ use Brunoinds\LinkPreviewDetector\LinkPreviewDetector;

$userAgent = $_SERVER['HTTP_USER_AGENT'];

$response = LinkPreviewOrigin::isForLinkPreviewUserAgent($userAgent);
$response = LinkPreviewDetector::isForLinkPreviewUserAgent($userAgent);
```
With this method you can pass an specific User-Agent and will return if is a link preview crawler.

0 comments on commit ecf5649

Please sign in to comment.