This repository has been archived by the owner on Jul 1, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from AYLIEN/clusters-machine-translation-release
feat: 3.0.0 introduce clustering and machine translation
- Loading branch information
Showing
132 changed files
with
18,758 additions
and
10,406 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,146 @@ | ||
# AYLIEN News API | ||
# AYLIEN News API - PHP SDK | ||
|
||
AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content. | ||
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. | ||
|
||
Sign up at [https://newsapi.aylien.com/](https://newsapi.aylien.com/). | ||
|
||
For more documentation see [https://newsapi.aylien.com/docs/](https://newsapi.aylien.com/docs/). | ||
|
||
## Bug Reports | ||
If you've got a bug report, please contact us at [email protected]. | ||
## Requirements | ||
|
||
PHP 5.5 and later | ||
|
||
## Installation & Usage | ||
|
||
### Composer | ||
|
||
To install the bindings via [Composer](http://getcomposer.org/), add the following to `composer.json`: | ||
|
||
```json | ||
{ | ||
"require": { | ||
"aylien/newsapi": "~3.0.0" | ||
} | ||
} | ||
``` | ||
|
||
Then run `composer install` | ||
|
||
### Manual Installation | ||
|
||
Download the files and include `autoload.php`: | ||
|
||
```php | ||
require_once('/path/to/aylien/newsapi/vendor/autoload.php'); | ||
``` | ||
|
||
## Tests | ||
|
||
To run the unit tests: | ||
|
||
```bash | ||
composer install | ||
./vendor/bin/phpunit | ||
``` | ||
|
||
## Getting Started | ||
|
||
Please follow the [installation procedure](#installation--usage) and then run the following: | ||
|
||
```php | ||
<?php | ||
require_once(__DIR__ . '/vendor/autoload.php'); | ||
|
||
// Configure API key authorization: app_id | ||
$config = Aylien\NewsApi\Configuration::getDefaultConfiguration()->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 < sizeof($result->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* | ||
|
||
Class | Method | HTTP request | Description | ||
------------ | ------------- | ------------- | ------------- | ||
*DefaultApi* | [**listAutocompletes**](docs/Api/DefaultApi.md#listautocompletes) | **GET** /autocompletes | List autocompletes | ||
*DefaultApi* | [**listClusters**](docs/Api/DefaultApi.md#listclusters) | **GET** /clusters | List Clusters | ||
*DefaultApi* | [**listCoverages**](docs/Api/DefaultApi.md#listcoverages) | **GET** /coverages | List coverages | ||
*DefaultApi* | [**listHistograms**](docs/Api/DefaultApi.md#listhistograms) | **GET** /histograms | List histograms | ||
*DefaultApi* | [**listRelatedStories**](docs/Api/DefaultApi.md#listrelatedstories) | **GET** /related_stories | List related stories | ||
*DefaultApi* | [**listStories**](docs/Api/DefaultApi.md#liststories) | **GET** /stories | List Stories | ||
*DefaultApi* | [**listTimeSeries**](docs/Api/DefaultApi.md#listtimeseries) | **GET** /time_series | List time series | ||
*DefaultApi* | [**listTrends**](docs/Api/DefaultApi.md#listtrends) | **GET** /trends | List trends | ||
|
||
|
||
## Documentation For Models | ||
|
||
- [Author](docs/Model/Author.md) | ||
- [Autocomplete](docs/Model/Autocomplete.md) | ||
- [Autocompletes](docs/Model/Autocompletes.md) | ||
- [Category](docs/Model/Category.md) | ||
- [CategoryLinks](docs/Model/CategoryLinks.md) | ||
- [Cluster](docs/Model/Cluster.md) | ||
- [Clusters](docs/Model/Clusters.md) | ||
- [Coverages](docs/Model/Coverages.md) | ||
- [Entities](docs/Model/Entities.md) | ||
- [Entity](docs/Model/Entity.md) | ||
- [EntityLinks](docs/Model/EntityLinks.md) | ||
- [Error](docs/Model/Error.md) | ||
- [ErrorLinks](docs/Model/ErrorLinks.md) | ||
- [Errors](docs/Model/Errors.md) | ||
- [HistogramInterval](docs/Model/HistogramInterval.md) | ||
- [Histograms](docs/Model/Histograms.md) | ||
- [Location](docs/Model/Location.md) | ||
- [Media](docs/Model/Media.md) | ||
- [Rank](docs/Model/Rank.md) | ||
- [Rankings](docs/Model/Rankings.md) | ||
- [RelatedStories](docs/Model/RelatedStories.md) | ||
- [RepresentativeStory](docs/Model/RepresentativeStory.md) | ||
- [Scope](docs/Model/Scope.md) | ||
- [Sentiment](docs/Model/Sentiment.md) | ||
- [Sentiments](docs/Model/Sentiments.md) | ||
- [ShareCount](docs/Model/ShareCount.md) | ||
- [ShareCounts](docs/Model/ShareCounts.md) | ||
- [Source](docs/Model/Source.md) | ||
- [Stories](docs/Model/Stories.md) | ||
- [Story](docs/Model/Story.md) | ||
- [StoryCluster](docs/Model/StoryCluster.md) | ||
- [StoryLinks](docs/Model/StoryLinks.md) | ||
- [StoryTranslations](docs/Model/StoryTranslations.md) | ||
- [StoryTranslationsEn](docs/Model/StoryTranslationsEn.md) | ||
- [Summary](docs/Model/Summary.md) | ||
- [TimeSeries](docs/Model/TimeSeries.md) | ||
- [TimeSeriesList](docs/Model/TimeSeriesList.md) | ||
- [Trend](docs/Model/Trend.md) | ||
- [Trends](docs/Model/Trends.md) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,35 @@ | ||
{ | ||
"name": "aylien/newsapi", | ||
"version": "1.0.0", | ||
"description": "AYLIEN News API is the most powerful way of sourcing, searching and syndicating analyzed and enriched news content.", | ||
"name": "GIT_USER_ID/GIT_REPO_ID", | ||
"version": "3.0.0", | ||
"description": "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.", | ||
"keywords": [ | ||
"aylien", | ||
"news api", | ||
"news", | ||
"openapitools", | ||
"openapi-generator", | ||
"openapi", | ||
"php", | ||
"sdk", | ||
"rest", | ||
"api" | ||
], | ||
"homepage": "https://newsapi.aylien.com/", | ||
"license": "Apache-2.0", | ||
"homepage": "https://openapi-generator.tech", | ||
"license": "unlicense", | ||
"authors": [ | ||
{ | ||
"name": "Hamed Ramezanian Nik", | ||
"homepage": "http://hamedrnik.com/", | ||
"email": "[email protected]" | ||
"name": "OpenAPI-Generator contributors", | ||
"homepage": "https://openapi-generator.tech" | ||
} | ||
], | ||
"require": { | ||
"php": ">=5.4", | ||
"php": ">=7.1", | ||
"ext-curl": "*", | ||
"ext-json": "*", | ||
"ext-mbstring": "*" | ||
"ext-mbstring": "*", | ||
"guzzlehttp/guzzle": "^6.2" | ||
}, | ||
"require-dev": { | ||
"phpunit/phpunit": "~4.8", | ||
"satooshi/php-coveralls": "~1.0", | ||
"phpunit/phpunit": "^7.4", | ||
"squizlabs/php_codesniffer": "~2.6", | ||
"friendsofphp/php-cs-fixer": "~1.12" | ||
"friendsofphp/php-cs-fixer": "~2.12" | ||
}, | ||
"autoload": { | ||
"psr-4": { "Aylien\\NewsApi\\" : "lib/" } | ||
|
Oops, something went wrong.