2017 © Pedro Peláez
 

library php7-duckduckgo

Unofficial library using the DuckDuckGo API with php 7

image

emersonsm/php7-duckduckgo

Unofficial library using the DuckDuckGo API with php 7

  • Wednesday, August 23, 2017
  • by emersonsm
  • Repository
  • 1 Watchers
  • 0 Stars
  • 7 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

php-duckduckgo-api

Open-source library for integrating DuckDuckGo's Zero-click Info API with PHP., (*1)

Requirements

  • PHP 8.0 or higher
  • Composer

You can install this package using Composer:, (*2)

composer require emersonsm/php-duckduckgo-api

Usage

To use the DuckDuckGo API in your application, instantiate the Api class and call the zeroClickQuery method. The method returns an associative array, so you can access the response using array syntax., (*3)

<?php
require "vendor/autoload.php";

use DuckDuckGo\Api;

$api = new Api();
$response = $api->zeroClickQuery("What is the meaning of life?");

if (isset($response["AbstractText"])) {
    echo $response["AbstractText"];
} else {
    echo "No abstract text found.";
}

Response Example

The zeroClickQuery method will return a response similar to:, (*4)

The meaning of life, or the answer to the question "What is the meaning of life?", pertains to the significance of living or existence in general. Many other related questions include "Why are we here?", "What is life all about?", or "What is the purpose of existence?" There have been a large number of proposed answers to these questions from many different cultural and ideological backgrounds. The search for life's meaning has produced much philosophical, scientific, theological, and metaphysical speculation throughout history. Different people and cultures believe different things for the answer to this question., (*5)

Testing

To run tests, ensure PHPUnit is installed as a development dependency in composer.json. You can then execute the following command:, (*6)

composer test

This will run PHPUnit and execute tests., (*7)

Help?

For any questions or issues, please open an issue on the GitHub repository., (*8)

The Versions

23/08 2017

dev-master

9999999-dev

Unofficial library using the DuckDuckGo API with php 7

  Sources   Download

The Requires

 

api search duckduckgo

23/08 2017

0.0.1

0.0.1.0

Unofficial library using the DuckDuckGo API with php 7

  Sources   Download

The Requires

 

api search duckduckgo