winteruni / google-doc-scraper
Free Google Doc scraper PHP Package
1.0.1
2019-05-07 16:52 UTC
Requires
- php: ^7.1.3
- symfony/css-selector: 4.2.*
- symfony/dom-crawler: 4.2.*
Requires (Dev)
- phpunit/phpunit: 7.3.3
This package is auto-updated.
Last update: 2025-05-08 06:42:43 UTC
README
Provides scraping data from saved google documents for easier content management on PHP based web sites.
Basic usage example
// If you are using it in custom project with composer autoload, you need to require autoloaded classes
require_once './../vendor/autoload.php';
use WinterUni\GoogleDoc\Document;
use WinterUni\GoogleDoc\Scraper\Html as HtmlScraper;
use WinterUni\GoogleDoc\Validator\Html as HtmlValidator;
use WinterUni\GoogleDoc\Filter\Body as BodyFilter;
// This content can be obtained when saving google docs file
$content = file_get_contents('./docs/1/10.html');
$document = new Document($content, new HtmlScraper(new HtmlValidator(), new BodyFilter()));
$title = $document->getTitle();
$body = $document->getBody();
$customStyle = $document->getCustomStyle();
echo $title;
echo $body;
echo $customStyle;