2017 © Pedro Peláez
 

library newsapi

AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content.

image

aylien/newsapi

AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content.

  • Friday, February 24, 2017
  • by aylien
  • Repository
  • 12 Watchers
  • 2 Stars
  • 347 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 6 % Grown

The README.md

AYLIEN News API - PHP SDK

The AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. It is accessed by sending HTTP requests to our server, which returns information to your client., (*1)

Sign up at https://newsapi.aylien.com/., (*2)

For more documentation see https://newsapi.aylien.com/docs/., (*3)

Requirements

PHP 5.5 and later, (*4)

Installation & Usage

Composer

To install the bindings via Composer, add the following to composer.json:, (*5)

{
  "require": {
    "aylien/newsapi": "~3.0.0"
  }
}

Then run composer install, (*6)

Manual Installation

Download the files and include autoload.php:, (*7)

    require_once('/path/to/aylien/newsapi/vendor/autoload.php');

Tests

To run the unit tests:, (*8)

composer install
./vendor/bin/phpunit

Getting Started

Please follow the installation procedure and then run the following:, (*9)

setApiKey('X-AYLIEN-NewsAPI-Application-ID', $_SERVER['NEWSAPI_APP_ID']);

// Configure API key authorization: app_key
$config = Aylien\NewsApi\Configuration::getDefaultConfiguration()->setApiKey('X-AYLIEN-NewsAPI-Application-Key', $_SERVER['NEWSAPI_APP_KEY']);

$apiInstance = new Aylien\NewsApi\Api\DefaultApi(
    new GuzzleHttp\Client(),
    $config
);

$opts = array(
  'title' => 'trump',
  'publishedAtStart' => 'NOW-7DAYS',
  'publishedAtEnd' => 'NOW',
  'entitiesBodyLinksDbpedia' => [
    'http://dbpedia.org/resource/Donald_Trump',
    'http://dbpedia.org/resource/Hillary_Rodham_Clinton'
  ],
  'notLanguage' => ['en'],
  'sortBy' => 'social_shares_count.facebook'
);

try {
    $result = $apiInstance->listStories($opts);
    for($i = 0; $i getStories()); $i++){
      print_r($result->getStories()[$i]->getTitle() . " / " .
        $result->getStories()[$i]->getSource()->getName() . "\n");
    }
} catch (Exception $e) {
    print_r($e->getResponseObject()->getErrors());
    echo 'Exception when calling DefaultApi->listStories: ', $e->getMessage(), "\n";
}
?>

Documentation for API Endpoints

All URIs are relative to https://api.aylien.com/news, (*10)

Class Method HTTP request Description
DefaultApi listAutocompletes GET /autocompletes List autocompletes
DefaultApi listClusters GET /clusters List Clusters
DefaultApi listCoverages GET /coverages List coverages
DefaultApi listHistograms GET /histograms List histograms
DefaultApi listRelatedStories GET /related_stories List related stories
DefaultApi listStories GET /stories List Stories
DefaultApi listTimeSeries GET /time_series List time series
DefaultApi listTrends GET /trends List trends

Documentation For Models

The Versions

24/02 2017

dev-master

9999999-dev https://newsapi.aylien.com/

AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content.

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4
  • ext-curl *
  • ext-json *
  • ext-mbstring *

 

The Development Requires

api php sdk news aylien news api

24/02 2017

1.0.0

1.0.0.0 https://newsapi.aylien.com/

AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content.

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4
  • ext-curl *
  • ext-json *
  • ext-mbstring *

 

The Development Requires

api php sdk news aylien news api

03/11 2016

0.3.0

0.3.0.0 https://newsapi.aylien.com/

AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content.

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4
  • ext-curl *
  • ext-json *
  • ext-mbstring *

 

The Development Requires

api php sdk news aylien news api

24/08 2016

0.2.0

0.2.0.0 https://github.com/AYLIEN/aylien_newsapi_php

AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content.

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4
  • ext-curl *
  • ext-json *
  • ext-mbstring *

 

The Development Requires

api php sdk news aylien news api

12/07 2016

0.1.0

0.1.0.0 https://github.com/AYLIEN/aylien_newsapi_php

AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content.

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4
  • ext-curl *
  • ext-json *
  • ext-mbstring *

 

The Development Requires

api php sdk news aylien news api

22/04 2016

0.0.1

0.0.1.0 https://github.com/AYLIEN/aylien_newsapi_php

AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content.

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4
  • ext-curl *
  • ext-json *
  • ext-mbstring *

 

The Development Requires

api php sdk news aylien news api