vdaguenet / one-page-seo
Serve static content of a one-page website to crawlers (e.g. Facebook, Google or Twitter) using PhantomJS
Installs: 46
Dependents: 0
Suggesters: 0
Security: 0
Stars: 7
Watchers: 2
Forks: 1
Open Issues: 0
pkg:composer/vdaguenet/one-page-seo
Requires
- php: >=5.0.0
Requires (Dev)
- symfony/css-selector: ^2.7
- symfony/dom-crawler: ^2.7
This package is not auto-updated.
Last update: 2023-10-28 12:20:43 UTC
README
Serve static content of a one-page website to crawlers.
Installation
Via Composer
composer require vdaguenet/one-page-seo
Usage
Add the following line on top of your index.php
include_once __DIR__ . '/OnePage-SEO/BotDetector.php'; $detector = new BotDetector(); $detector->setServerOS($detector::LINUX); if($detector->isBot()) { $detector->displayStaticContent(); }
In your javascript, add the following line when you are sure your content is appended
if(typeof window.callPhantom === 'function') window.callPhantom();
What is included ?
PhantomJS:
- for mac in version 2.0.0
- for linux in version 1.9.8
You can download other build from official reposiory