PHP code example of deny-hf / php-goose
1. Go to this page and download the library: Download deny-hf/php-goose library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
deny-hf / php-goose example snippets
bash
curl -sS https://getcomposer.org/installer | php
bash
php composer.phar install
php
php
use \Goose\Client as GooseClient;
$goose = new GooseClient();
$article = $goose->extractContent('http://url.to/article');
$title = $article->getTitle();
$metaDescription = $article->getMetaDescription();
$metaKeywords = $article->getMetaKeywords();
$canonicalLink = $article->getCanonicalLink();
$domain = $article->getDomain();
$tags = $article->getTags();
$links = $article->getLinks();
$videos = $article->getVideos();
$articleText = $article->getCleanedArticleText();
$entities = $article->getPopularWords();
$image = $article->getTopImage();
$allImages = $article->getAllImages();