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

etrieve_content_api

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

etrieve_content_api

  • 0.2.2
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

EtrieveContentApi

Ruby wrapper for accessing the Etrieve Content API. Document metadata and content retrieval is currently supported. Document writes may be supported in a future version.

Installation

Add this line to your application's Gemfile:

gem 'etrieve_content_api'

And then execute:

$ bundle

Or install it yourself as:

$ gem install etrieve_content_api

Configuration

Configuration can be passed as a hash.

{
  auth_url: 'https://example.com/auth', # default: ''
  base_url: 'https://example.com/api', # default: ''
  password: password, # default: ''
  username: username, # default: '' - might be a client_id as opposed to a user login
  timeout: 1, # default: 30 seconds
  verify_ssl: false # default: true
}

Configuration can be read from a YAML file by passing the file path. The file should contain a hash structure and ERB content is evaluated:

  ---
  auth_url: 'https://example.com/auth',
  base_url: 'https://example.com/api',
  password: password,
  username: username,
  timeout: 1,
  verify_ssl: false

Usage

Basic Request

See Handler class for prebuilt requests for things like document metadata and content.

require 'etrieve_content_api'
handler = EtrieveContentApi::Handler.new(config_hash_or_path_to_config_yaml)
handler.document_metadata({:q => 'Sue'})

Using EtrieveContentApi::Connection

Connection#execute can be used to wrap a group of calls with a single authentication request.

conn = EtrieveContentApi::Connection.new(config_hash_or_path_to_config_yaml)
conn.execute() {
  @custom1 = conn.get_custom_connection([conn.base_url, 'custom_path1'].join('/'), conn.headers)
  @custom2 = conn.get_custom_connection([conn.base_url, 'custom_path2'].join('/'), conn.headers)
}

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/reed_college/etrieve_content_api.

License

The gem is available as open source under the terms of the BSD-3-Clause License.

FAQs

Package last updated on 02 Mar 2020

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