示例#1
0
    if ($seostats->setUrl($url)) {
        /**
         *  Print HTML code for the 'search engine traffic'-graph.
         */
        echo SEMrush::getDomainGraph(1);
        /**
         *  Print HTML code for the 'search engine traffic price'-graph.
         */
        echo SEMrush::getDomainGraph(2);
        /**
         *  Print HTML code for the 'number of adwords ads'-graph,
         *  using explicitly SEMRush's data for google.de (german index).
         */
        echo SEMrush::getDomainGraph(3, false, 'de');
        /**
         *  Print HTML code for the 'adwords traffic'-graph, using
         *  explicitly SEMRush's data for google.de (german index)
         *  and specific graph dimensions of 320*240 px.
         */
        echo SEMrush::getDomainGraph(4, false, 'de', 320, 240);
        /**
         *  Print HTML code for the 'adwords traffic price'-graph,
         *  using explicitly SEMRush's data for google.de (german index),
         *  specific graph dimensions of 320*240 px and specific
         *  graph colors (black lines and red dots for data points).
         */
        echo SEMrush::getDomainGraph(5, false, 'de', 320, 240, '000000', 'ff0000');
    }
} catch (\Exception $e) {
    echo 'Caught SEOstatsException: ' . $e->getMessage();
}
示例#2
0
//
// For further reference see: https://github.com/eyecatchup/SEOstats/issues/49
// Bootstrap the library / register autoloader
#require_once realpath(__DIR__ . '/SEOstats/bootstrap.php');
require_once realpath(__DIR__ . '/vendor/autoload.php');
use SEOstats\Services\SEMRush as SEMrush;
try {
    $url = 'http://www.nahklick.de/';
    // Create a new SEOstats instance.
    $seostats = new \SEOstats\SEOstats();
    // Bind the URL to the current SEOstats instance.
    if ($seostats->setUrl($url)) {
        /**
         *  Get the current SEMrush DomainRank metrics for the given URL.
         */
        print_r(SEMrush::getDomainRank());
        /**
         *  Get historical SEMrush DomainRank metrics for the given URL.
         */
        //print_r(SEMrush::getDomainRankHistory());
        /**
         *  Get competing domains for the given URL
         *  and their basic SEMrush DomainRank metrics.
         */
        //print_r(SEMrush::getCompetitors());
        /**
         *  Get organic search engine traffic data for the given URL.
         */
        //print_r(SEMrush::getOrganicKeywords());
        /**
         *  Get organic search engine traffic metrics for the given URL,