PHP code example of silktide / wappalyzer-wrapper

1. Go to this page and download the library: Download silktide/wappalyzer-wrapper 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/ */

    

silktide / wappalyzer-wrapper example snippets


//Build Factory = new \Silktide\WappalyzerWrapper\Result\ResultFactory();
$technologyResultFactory = new \Silktide\WappalyzerWrapper\Result\TechnologyResultFactory();
$parser = new \Silktide\WappalyzerWrapper\Result\ResultProcessor($resultFactory, $technologyResultFactory);
$commandFactory = new \Silktide\WappalyzerWrapper\CommandFactory();
$jsonFileWriter = new \Silktide\WappalyzerWrapper\Request\JsonFileWriter();

// Create client
$client = new \Silktide\WappalyzerWrapper\Client($commandFactory, $parser, $jsonFileWriter);

// Get the analysis results for a site
$result = $client->analyse('https://silktide.com');

// Output all technologies found
foreach ($result->getTechnologyResults() as $technologyResult) {
    echo "\nFound ".$technologyResult->getName();
}

// Output just something from a specific category
foreach ($result->getTechnologyResultsByCategory('Analytics') as $technologyResult) {
    echo "\nFound ".$technologyResult->getName();
}


//Build actory = new \Silktide\WappalyzerWrapper\Result\ResultFactory();
$technologyResultFactory = new \Silktide\WappalyzerWrapper\Result\TechnologyResultFactory();
$parser = new \Silktide\WappalyzerWrapper\Result\ResultProcessor($resultFactory, $technologyResultFactory);
$commandFactory = new \Silktide\WappalyzerWrapper\CommandFactory();
$jsonFileWriter = new \Silktide\WappalyzerWrapper\Request\JsonFileWriter();

// Set up request from existing page data
$existingPageDataRequest = new \Silktide\WappalyzerWrapper\Request\ExistingPageDataRequest();

$existingPageDataRequest->setHostname('example.com');
$existingPageDataRequest->setUrl('https://example.com');
$existingPageDataRequest->addHeader('Content-Type', 'application/json');
$existingPageDataRequest->addWindowObjectKey('ga');
$existingPageDataRequest->setHtml('<html><head><meta name="generator" content="Amiro"></head><body></body></html>');

// Create client
$client = new \Silktide\WappalyzerWrapper\Client($commandFactory, $parser, $jsonFileWriter);

// Get the analysis results for a site
$result = $client->analyseFromExistingData($existingPageDataRequest);

// Output all technologies found
foreach ($result->getTechnologyResults() as $technologyResult) {
    echo "\nFound ".$technologyResult->getName();
}

// Output just something from a specific category
foreach ($result->getTechnologyResultsByCategory('Analytics') as $technologyResult) {
    echo "\nFound ".$technologyResult->getName();
}