Socket
Book a DemoInstallSign in
Socket

yandex-api

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

yandex-api

0.1.0
bundlerRubygems
Version published
Maintainers
1
Created
Source

Yandex::API

Gem Version

Allow you work with any Yandex.APIs

Modules:

Installation

Add this line to your application's Gemfile:

gem 'yandex-api'

And then execute:

$ bundle

Or install it yourself as:

$ gem install yandex-api

Direct

в Ruby:

Create configuration file yandex_direct.yml

token: token
login: login
locale: ru
verbose: true
sandbox: true

в Ruby On Rails:

Create configuration file yandex_direct.yml

development:
    token: token
    login: login
    locale: ru
    verbose: true
    sandbox: true

Create yandex_direct.rb in config/initializers

Yandex::API::Direct.load File.join(Rails.root,"config","yandex_direct.yml"), Rails.env

Simple example:

require 'yandex-api'
Yandex::API::Direct.load "yandex_direct.yml"

campaign = Yandex::API::Direct::CampaignInfo.list.first
puts campaign.inspect
puts campaign.banners.first.inspect

Translate

в Ruby:

Create configuration file yandex_translate.yml

token: "token"
ui: true
verbose: true

в Ruby On Rails:

Create configuration file yandex_translate.yml

development:
    token: "token"
    ui: "ru"
    verbose: true
    

Create yandex_translate.rb in config/initializers

Yandex::API::Translate.load File.join(Rails.root,"config","yandex_translate.yml"), Rails.env

Simple example

require 'yandex-api'
Yandex::API::Translate.load "yandex.yml", "production"

puts Yandex::API::Translate.languages.inspect
puts Yandex::API::Translate.detect('test').inspect
puts Yandex::API::Translate.do('Hello GitHub', 'ru').inspect

Contributing

  • Fork it ( https://github.com/jpascal/yandex-api/fork )
  • Create your feature branch (git checkout -b my-new-feature)
  • Commit your changes (git commit -am 'Add some feature')
  • Push to the branch (git push origin my-new-feature)
  • Create a new Pull Request

FAQs

Package last updated on 10 Mar 2015

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.