PHP code example of twingly / twingly-search

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

    

twingly / twingly-search example snippets


use Twingly\Client;

$client = new Client();

$query = $client->query();
$query->search_query = 'github page-size:10 lang:sv';
$result = $query->execute();

foreach($result->posts as $post) {
    echo $post->url . "\n";
}