public function testEndpointUrl() { $c = new Client(); $this->assertEquals($c->endpoint_url(), sprintf("%s%s", Client::BASE_URL, Client::SEARCH_PATH)); }
<?php require 'vendor/autoload.php'; use Twingly\Client; $client = new Client(); $query = $client->query(); $query->pattern = '"hello world"'; $query->start_time = (new \DateTime('now', new \DateTimeZone('UTC')))->sub(new \DateInterval('P1D')); $results = $query->execute(); foreach ($results->posts as $post) { echo $post->url . "\n"; }