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

aylien_text_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_text_api

  • 1.0.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

AYLIEN Text API (Ruby)

Gem Version

This is the Ruby client library for AYLIEN's APIs. If you haven't already done so, you will need to sign up.

Installation

gem install aylien_text_api

See the Developers Guide for additional documentation.

Configuration

Aylien Text API needs app_id and app_key which you can get it from Text API website.

You can pass configuration options as a block to AylienTextApi.configure.

require 'aylien_text_api'

AylienTextApi.configure do |config|
  config.app_id        =    "YOUR_APP_ID"
  config.app_key       =    "YOUR_APP_KEY"
end
client = AylienTextApi::Client.new

or pass them as parameters to AylienTextApi::Client class.

require 'aylien_text_api'

client = AylienTextApi::Client.new(app_id: "YOUR APP ID", app_key: "YOUR APP KEY")

Examples

After configuring a client, you can do the following things:

client.extract url: "http://techcrunch.com/2014/02/27/aylien-launches-text-analysis-api-to-help-developers-extract-meaning-from-documents/"

# => {
#  :title=>"Aylien Launches Text-Analysis API To Help Developers...",
#  :article=>"Working with text is often a messy business for...",
#  :image=>"", :author=>"Frederic Lardinois", :videos=>[],
#  :feeds=>["http://techcrunch.com/2014/02/27/aylien-...
#  }

If any errors happen during the call, nil will be returned. If destructive methods are used, an exception corresponding to the error will be returned.

client.classify! url: "http://www.bbc.com/sport/0/football/25912393"
# => {:text=>"Lionel Messi: Forward is not for sale, says...,
# :language=>"en",
# :categories=>[{:label=>"sport - soccer", :code=>"15054000", :confidence=>1.0}]
# }

Third Party Libraries and Dependencies

For development you will also need the following libraries:

  • rake
  • minitest
  • vcr
  • webmock

To install the dependencies, make sure you have bundle installed, then run bundle install --path=vendor/bundle. Then, run bundle exec rake test to run tests.

FAQs

Package last updated on 03 Apr 2019

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