aylien_news_api 4.3.0 → 4.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +100 -31
- data/docs/DefaultApi.md +357 -189
- data/docs/DeprecatedEntities.md +19 -0
- data/docs/DeprecatedEntity.md +33 -0
- data/docs/DeprecatedEntitySurfaceForm.md +21 -0
- data/docs/DeprecatedRelatedStories.md +27 -0
- data/docs/DeprecatedStories.md +25 -0
- data/docs/DeprecatedStory.md +61 -0
- data/docs/Entity.md +12 -10
- data/docs/EntityInText.md +19 -0
- data/docs/EntityMention.md +19 -0
- data/docs/EntityMentionIndex.md +19 -0
- data/docs/EntitySurfaceForm.md +4 -2
- data/docs/Story.md +1 -1
- data/lib/aylien_news_api/api/default_api.rb +452 -200
- data/lib/aylien_news_api/models/deprecated_entities.rb +221 -0
- data/lib/aylien_news_api/models/deprecated_entity.rb +314 -0
- data/lib/aylien_news_api/models/deprecated_entity_surface_form.rb +244 -0
- data/lib/aylien_news_api/models/deprecated_related_stories.rb +260 -0
- data/lib/aylien_news_api/models/deprecated_stories.rb +252 -0
- data/lib/aylien_news_api/models/deprecated_story.rb +429 -0
- data/lib/aylien_news_api/models/entity.rb +90 -44
- data/lib/aylien_news_api/models/entity_in_text.rb +217 -0
- data/lib/aylien_news_api/models/entity_mention.rb +215 -0
- data/lib/aylien_news_api/models/entity_mention_index.rb +265 -0
- data/lib/aylien_news_api/models/entity_surface_form.rb +34 -9
- data/lib/aylien_news_api/models/related_stories.rb +1 -0
- data/lib/aylien_news_api/models/stories.rb +1 -0
- data/lib/aylien_news_api/models/story.rb +5 -2
- data/lib/aylien_news_api/version.rb +1 -1
- data/lib/aylien_news_api.rb +9 -1
- data/spec/api/default_api_spec.rb +208 -4
- data/spec/models/deprecated_entities_spec.rb +47 -0
- data/spec/models/deprecated_entity_spec.rb +89 -0
- data/spec/models/deprecated_entity_surface_form_spec.rb +53 -0
- data/spec/models/deprecated_related_stories_spec.rb +71 -0
- data/spec/models/deprecated_stories_spec.rb +65 -0
- data/spec/models/deprecated_story_spec.rb +173 -0
- data/spec/models/entity_in_text_spec.rb +47 -0
- data/spec/models/entity_links_spec.rb +6 -0
- data/spec/models/entity_mention_index_spec.rb +47 -0
- data/spec/models/entity_mention_spec.rb +47 -0
- data/spec/models/entity_spec.rb +23 -5
- data/spec/models/entity_surface_form_spec.rb +7 -1
- data/spec/models/nested_entity_spec.rb +19 -1
- data/spec/models/story_spec.rb +6 -0
- data/spec/models/time_series_spec.rb +6 -0
- data/spec/models/trend_spec.rb +6 -0
- metadata +38 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e176f5b1e738c3030926956cb506f764011dec94ef941f919dc8a3e9d4867548
|
|
4
|
+
data.tar.gz: adc5ecf9f8e8f0830c61ac641cffd833852726a977e45845aa78361716f66571
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d5c7cd99b6bdeae64f2bc452ea6d28297a39a0370b60d4956a0e2624f1655fae77e85bf5aae9cdefda19373eb6fc7b359a69f5b2aa55f3ecbaea1eabd0cb5073
|
|
7
|
+
data.tar.gz: 83323addc9aa798e9ae1375246daad57e5df13f4f5465fe17be0a6f8030bf84ead2d9dd05eee08cea01f69c7f0bf677f15192fb3d20aa96c4da01d1726053e2a
|
data/README.md
CHANGED
|
@@ -1,22 +1,46 @@
|
|
|
1
|
-
#
|
|
1
|
+
# aylien_news_api
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
AylienNewsApi - the Ruby gem for the AYLIEN News API
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
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.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
|
|
8
|
+
This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
|
|
9
|
+
|
|
10
|
+
- API version: 3.0
|
|
11
|
+
- Package version: 4.5.0
|
|
12
|
+
- Build package: org.openapitools.codegen.languages.RubyClientCodegen
|
|
13
|
+
For more information, please visit [https://newsapi.aylien.com/](https://newsapi.aylien.com/)
|
|
8
14
|
|
|
9
15
|
## Installation
|
|
10
16
|
|
|
11
|
-
|
|
17
|
+
### Build a gem
|
|
18
|
+
|
|
19
|
+
To build the Ruby code into a gem:
|
|
20
|
+
|
|
21
|
+
```shell
|
|
22
|
+
gem build aylien_news_api.gemspec
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Then either install the gem locally:
|
|
12
26
|
|
|
13
|
-
|
|
27
|
+
```shell
|
|
28
|
+
gem install ./aylien_news_api-4.5.0.gem
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
(for development, run `gem install --dev ./aylien_news_api-4.5.0.gem` to install the development dependencies)
|
|
32
|
+
|
|
33
|
+
or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
|
|
34
|
+
|
|
35
|
+
Finally add this to the Gemfile:
|
|
36
|
+
|
|
37
|
+
gem 'aylien_news_api', '~> 4.5.0'
|
|
14
38
|
|
|
15
39
|
### Install from Git
|
|
16
40
|
|
|
17
|
-
If the Ruby gem is hosted at a git repository: https://github.com/
|
|
41
|
+
If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile:
|
|
18
42
|
|
|
19
|
-
gem 'aylien_news_api', :git => 'https://github.com/
|
|
43
|
+
gem 'aylien_news_api', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'
|
|
20
44
|
|
|
21
45
|
### Include the Ruby code directly
|
|
22
46
|
|
|
@@ -29,39 +53,44 @@ ruby -Ilib script.rb
|
|
|
29
53
|
## Getting Started
|
|
30
54
|
|
|
31
55
|
Please follow the [installation](#installation) procedure and then run the following code:
|
|
56
|
+
|
|
32
57
|
```ruby
|
|
33
58
|
# Load the gem
|
|
34
59
|
require 'aylien_news_api'
|
|
35
60
|
|
|
36
61
|
# Setup authorization
|
|
37
62
|
AylienNewsApi.configure do |config|
|
|
38
|
-
|
|
39
|
-
config.api_key['X-AYLIEN-NewsAPI-Application-
|
|
63
|
+
# Configure API key authorization: app_id
|
|
64
|
+
config.api_key['X-AYLIEN-NewsAPI-Application-ID'] = 'YOUR API KEY'
|
|
65
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
66
|
+
#config.api_key_prefix['X-AYLIEN-NewsAPI-Application-ID'] = 'Bearer'
|
|
67
|
+
|
|
68
|
+
# Configure API key authorization: app_key
|
|
69
|
+
config.api_key['X-AYLIEN-NewsAPI-Application-Key'] = 'YOUR API KEY'
|
|
70
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
71
|
+
#config.api_key_prefix['X-AYLIEN-NewsAPI-Application-Key'] = 'Bearer'
|
|
40
72
|
end
|
|
41
73
|
|
|
42
74
|
api_instance = AylienNewsApi::DefaultApi.new
|
|
43
|
-
|
|
75
|
+
unknown_base_type = {"$and":[{"$or":[{"body":{"$text":"Tim Cook"}},{"social.shares.count.reddit.max":{"$gte":5000,"$boost":5}}]},{"entity":{"$and":[{"name":{"$text":"Apple","$boost":2}},{"$not":[{"type":{"$eq":"Fruit"}}]}]}}]} # UNKNOWN_BASE_TYPE | /stories body schema to perform an advanced search with logical operators and nested objects.
|
|
44
76
|
opts = {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
]
|
|
51
|
-
|
|
52
|
-
sort_by: 'social_shares_count.facebook'
|
|
77
|
+
published_at_start: 'published_at_start_example', # String | This parameter is used for finding stories whose published at time is greater than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates).
|
|
78
|
+
published_at_end: 'published_at_end_example', # String | This parameter is used for finding stories whose published at time is less than the specified value. [Here](https://newsapi.aylien.com/docs/working-with-dates) you can find more information about how [to work with dates](https://newsapi.aylien.com/docs/working-with-dates).
|
|
79
|
+
_return: ['_return_example'], # Array<String> | This parameter is used for specifying return fields.
|
|
80
|
+
sort_by: 'published_at', # String | This parameter is used for changing the order column of the results. You can read about sorting results [here](https://newsapi.aylien.com/docs/sorting-results).
|
|
81
|
+
sort_direction: 'desc', # String | This parameter is used for changing the order direction of the result. You can read about sorting results [here](https://newsapi.aylien.com/docs/sorting-results).
|
|
82
|
+
cursor: '*', # String | This parameter is used for finding a specific page. You can read more about pagination of results [here](https://newsapi.aylien.com/docs/pagination-of-results).
|
|
83
|
+
per_page: 10 # Integer | This parameter is used for specifying number of items in each page You can read more about pagination of results [here](https://newsapi.aylien.com/docs/pagination-of-results)
|
|
53
84
|
}
|
|
54
85
|
|
|
55
|
-
|
|
56
86
|
begin
|
|
57
|
-
|
|
58
|
-
result.
|
|
59
|
-
|
|
60
|
-
end
|
|
87
|
+
#List Stories
|
|
88
|
+
result = api_instance.advanced_list_stories(unknown_base_type, opts)
|
|
89
|
+
p result
|
|
61
90
|
rescue AylienNewsApi::ApiError => e
|
|
62
|
-
puts "Exception when calling DefaultApi->
|
|
63
|
-
puts e.response_body
|
|
91
|
+
puts "Exception when calling DefaultApi->advanced_list_stories: #{e}"
|
|
64
92
|
end
|
|
93
|
+
|
|
65
94
|
```
|
|
66
95
|
|
|
67
96
|
## Documentation for API Endpoints
|
|
@@ -70,11 +99,12 @@ All URIs are relative to *https://api.aylien.com/news*
|
|
|
70
99
|
|
|
71
100
|
Class | Method | HTTP request | Description
|
|
72
101
|
------------ | ------------- | ------------- | -------------
|
|
102
|
+
*AylienNewsApi::DefaultApi* | [**advanced_list_stories**](docs/DefaultApi.md#advanced_list_stories) | **POST** /stories | List Stories
|
|
73
103
|
*AylienNewsApi::DefaultApi* | [**list_autocompletes**](docs/DefaultApi.md#list_autocompletes) | **GET** /autocompletes | List autocompletes
|
|
74
104
|
*AylienNewsApi::DefaultApi* | [**list_clusters**](docs/DefaultApi.md#list_clusters) | **GET** /clusters | List Clusters
|
|
75
|
-
*AylienNewsApi::DefaultApi* | [**list_coverages**](docs/DefaultApi.md#list_coverages) | **GET** /coverages | List coverages
|
|
76
105
|
*AylienNewsApi::DefaultApi* | [**list_histograms**](docs/DefaultApi.md#list_histograms) | **GET** /histograms | List histograms
|
|
77
|
-
*AylienNewsApi::DefaultApi* | [**
|
|
106
|
+
*AylienNewsApi::DefaultApi* | [**list_related_stories_get**](docs/DefaultApi.md#list_related_stories_get) | **GET** /related_stories |
|
|
107
|
+
*AylienNewsApi::DefaultApi* | [**list_related_stories_post**](docs/DefaultApi.md#list_related_stories_post) | **POST** /related_stories |
|
|
78
108
|
*AylienNewsApi::DefaultApi* | [**list_stories**](docs/DefaultApi.md#list_stories) | **GET** /stories | List Stories
|
|
79
109
|
*AylienNewsApi::DefaultApi* | [**list_time_series**](docs/DefaultApi.md#list_time_series) | **GET** /time_series | List time series
|
|
80
110
|
*AylienNewsApi::DefaultApi* | [**list_trends**](docs/DefaultApi.md#list_trends) | **GET** /trends | List trends
|
|
@@ -82,30 +112,49 @@ Class | Method | HTTP request | Description
|
|
|
82
112
|
|
|
83
113
|
## Documentation for Models
|
|
84
114
|
|
|
115
|
+
- [AylienNewsApi::AggregatedSentiment](docs/AggregatedSentiment.md)
|
|
85
116
|
- [AylienNewsApi::Author](docs/Author.md)
|
|
86
117
|
- [AylienNewsApi::Autocomplete](docs/Autocomplete.md)
|
|
87
118
|
- [AylienNewsApi::Autocompletes](docs/Autocompletes.md)
|
|
88
119
|
- [AylienNewsApi::Category](docs/Category.md)
|
|
89
120
|
- [AylienNewsApi::CategoryLinks](docs/CategoryLinks.md)
|
|
121
|
+
- [AylienNewsApi::CategoryTaxonomy](docs/CategoryTaxonomy.md)
|
|
90
122
|
- [AylienNewsApi::Cluster](docs/Cluster.md)
|
|
91
123
|
- [AylienNewsApi::Clusters](docs/Clusters.md)
|
|
92
|
-
- [AylienNewsApi::
|
|
93
|
-
- [AylienNewsApi::
|
|
124
|
+
- [AylienNewsApi::DeprecatedEntities](docs/DeprecatedEntities.md)
|
|
125
|
+
- [AylienNewsApi::DeprecatedEntity](docs/DeprecatedEntity.md)
|
|
126
|
+
- [AylienNewsApi::DeprecatedEntitySurfaceForm](docs/DeprecatedEntitySurfaceForm.md)
|
|
127
|
+
- [AylienNewsApi::DeprecatedRelatedStories](docs/DeprecatedRelatedStories.md)
|
|
128
|
+
- [AylienNewsApi::DeprecatedStories](docs/DeprecatedStories.md)
|
|
129
|
+
- [AylienNewsApi::DeprecatedStory](docs/DeprecatedStory.md)
|
|
94
130
|
- [AylienNewsApi::Entity](docs/Entity.md)
|
|
131
|
+
- [AylienNewsApi::EntityInText](docs/EntityInText.md)
|
|
95
132
|
- [AylienNewsApi::EntityLinks](docs/EntityLinks.md)
|
|
133
|
+
- [AylienNewsApi::EntityMention](docs/EntityMention.md)
|
|
134
|
+
- [AylienNewsApi::EntityMentionIndex](docs/EntityMentionIndex.md)
|
|
135
|
+
- [AylienNewsApi::EntitySentiment](docs/EntitySentiment.md)
|
|
136
|
+
- [AylienNewsApi::EntitySurfaceForm](docs/EntitySurfaceForm.md)
|
|
96
137
|
- [AylienNewsApi::Error](docs/Error.md)
|
|
97
138
|
- [AylienNewsApi::ErrorLinks](docs/ErrorLinks.md)
|
|
98
139
|
- [AylienNewsApi::Errors](docs/Errors.md)
|
|
99
140
|
- [AylienNewsApi::HistogramInterval](docs/HistogramInterval.md)
|
|
100
141
|
- [AylienNewsApi::Histograms](docs/Histograms.md)
|
|
101
142
|
- [AylienNewsApi::Location](docs/Location.md)
|
|
143
|
+
- [AylienNewsApi::Logicals](docs/Logicals.md)
|
|
102
144
|
- [AylienNewsApi::Media](docs/Media.md)
|
|
145
|
+
- [AylienNewsApi::MediaFormat](docs/MediaFormat.md)
|
|
146
|
+
- [AylienNewsApi::MediaType](docs/MediaType.md)
|
|
147
|
+
- [AylienNewsApi::NestedEntity](docs/NestedEntity.md)
|
|
148
|
+
- [AylienNewsApi::Parameter](docs/Parameter.md)
|
|
149
|
+
- [AylienNewsApi::Query](docs/Query.md)
|
|
103
150
|
- [AylienNewsApi::Rank](docs/Rank.md)
|
|
104
151
|
- [AylienNewsApi::Rankings](docs/Rankings.md)
|
|
105
152
|
- [AylienNewsApi::RelatedStories](docs/RelatedStories.md)
|
|
106
153
|
- [AylienNewsApi::RepresentativeStory](docs/RepresentativeStory.md)
|
|
107
154
|
- [AylienNewsApi::Scope](docs/Scope.md)
|
|
155
|
+
- [AylienNewsApi::ScopeLevel](docs/ScopeLevel.md)
|
|
108
156
|
- [AylienNewsApi::Sentiment](docs/Sentiment.md)
|
|
157
|
+
- [AylienNewsApi::SentimentPolarity](docs/SentimentPolarity.md)
|
|
109
158
|
- [AylienNewsApi::Sentiments](docs/Sentiments.md)
|
|
110
159
|
- [AylienNewsApi::ShareCount](docs/ShareCount.md)
|
|
111
160
|
- [AylienNewsApi::ShareCounts](docs/ShareCounts.md)
|
|
@@ -114,10 +163,30 @@ Class | Method | HTTP request | Description
|
|
|
114
163
|
- [AylienNewsApi::Story](docs/Story.md)
|
|
115
164
|
- [AylienNewsApi::StoryCluster](docs/StoryCluster.md)
|
|
116
165
|
- [AylienNewsApi::StoryLinks](docs/StoryLinks.md)
|
|
166
|
+
- [AylienNewsApi::StoryTranslation](docs/StoryTranslation.md)
|
|
117
167
|
- [AylienNewsApi::StoryTranslations](docs/StoryTranslations.md)
|
|
118
|
-
- [AylienNewsApi::StoryTranslationsEn](docs/StoryTranslationsEn.md)
|
|
119
168
|
- [AylienNewsApi::Summary](docs/Summary.md)
|
|
120
169
|
- [AylienNewsApi::TimeSeries](docs/TimeSeries.md)
|
|
121
170
|
- [AylienNewsApi::TimeSeriesList](docs/TimeSeriesList.md)
|
|
122
171
|
- [AylienNewsApi::Trend](docs/Trend.md)
|
|
123
172
|
- [AylienNewsApi::Trends](docs/Trends.md)
|
|
173
|
+
- [AylienNewsApi::Warning](docs/Warning.md)
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
## Documentation for Authorization
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
### app_id
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
- **Type**: API key
|
|
183
|
+
- **API key parameter name**: X-AYLIEN-NewsAPI-Application-ID
|
|
184
|
+
- **Location**: HTTP header
|
|
185
|
+
|
|
186
|
+
### app_key
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
- **Type**: API key
|
|
190
|
+
- **API key parameter name**: X-AYLIEN-NewsAPI-Application-Key
|
|
191
|
+
- **Location**: HTTP header
|
|
192
|
+
|