Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

aylien_news_api

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aylien_news_api

  • 5.2.3
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

aylien_news_api

AylienNewsApi - the Ruby gem for the AYLIEN News API

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.

This SDK is automatically generated by the OpenAPI Generator project:

  • API version: 5.2.3
  • Package version: 5.2.3
  • Build package: org.openapitools.codegen.languages.RubyClientCodegen For more information, please visit https://newsapi.aylien.com/

Installation

Build a gem

To build the Ruby code into a gem:

gem build aylien_news_api.gemspec

Then either install the gem locally:

gem install ./aylien_news_api-5.2.3.gem

(for development, run gem install --dev ./aylien_news_api-5.2.3.gem to install the development dependencies)

or publish the gem to a gem hosting service, e.g. RubyGems.

Finally add this to the Gemfile:

gem 'aylien_news_api', '~> 5.2.3'

Install from Git

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:

gem 'aylien_news_api', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'

Include the Ruby code directly

Include the Ruby code directly using -I as follows:

ruby -Ilib script.rb

Getting Started

Please follow the installation procedure and then run the following code:

# Load the gem
require 'aylien_news_api'

# Setup authorization
AylienNewsApi.configure do |config|
  # Configure API key authorization: app_id
  config.api_key['X-AYLIEN-NewsAPI-Application-ID'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['X-AYLIEN-NewsAPI-Application-ID'] = 'Bearer'

  # Configure API key authorization: app_key
  config.api_key['X-AYLIEN-NewsAPI-Application-Key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['X-AYLIEN-NewsAPI-Application-Key'] = 'Bearer'
end

api_instance = AylienNewsApi::DefaultApi.new
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. 
opts = {
  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). 
  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). 
  _return: ['_return_example'], # Array<String> | This parameter is used for specifying return fields.
  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). 
  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). 
  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). 
  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) 
}

begin
  #List Stories
  result = api_instance.advanced_list_stories(unknown_base_type, opts)
  p result
rescue AylienNewsApi::ApiError => e
  puts "Exception when calling DefaultApi->advanced_list_stories: #{e}"
end

Documentation for API Endpoints

All URIs are relative to https://api.aylien.com/news

ClassMethodHTTP requestDescription
AylienNewsApi::DefaultApiadvanced_list_storiesPOST /storiesList Stories
AylienNewsApi::DefaultApilist_autocompletesGET /autocompletesList autocompletes
AylienNewsApi::DefaultApilist_clustersGET /clustersList Clusters
AylienNewsApi::DefaultApilist_histogramsGET /histogramsList histograms
AylienNewsApi::DefaultApilist_related_stories_getGET /related_stories
AylienNewsApi::DefaultApilist_related_stories_postPOST /related_stories
AylienNewsApi::DefaultApilist_storiesGET /storiesList Stories
AylienNewsApi::DefaultApilist_time_seriesGET /time_seriesList time series
AylienNewsApi::DefaultApilist_trendsGET /trendsList trends

Documentation for Models

Documentation for Authorization

app_id

  • Type: API key
  • API key parameter name: X-AYLIEN-NewsAPI-Application-ID
  • Location: HTTP header

app_key

  • Type: API key
  • API key parameter name: X-AYLIEN-NewsAPI-Application-Key
  • Location: HTTP header

FAQs

Package last updated on 17 Aug 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc