Sha256: 4e0d6f9f1e2c45e5b0a6bb3b0045b120cbc750383c7dbcb00d98a7eb3a583a68

Contents?: true

Size: 1.18 KB

Versions: 1

Compression:

Stored size: 1.18 KB

Contents

require 'rubygems'
require 'iknow'

Iknow::Config.init do |conf|
  conf.api_key               = ''
  conf.oauth_consumer_key    = ''
  conf.oauth_consumer_secret = ''
end

please_get_api_key =<<EOS
This example needs your own iKnow! API key.
(for only Iknow::Item.extract example)

You can get iKnow! API key at iKnow! Developers.
iKnow! Developers (http://developer.iknow.co.jp/)

Thanks!
EOS

if Iknow::Config.api_key == ''# or
  # Iknow::Config.oauth_consumer_key == '' or
  # Iknow::Config.oauth_consumer_secret == ''
  raise ArgumentError.new(please_get_api_key)
end

## User API
@user = Iknow::User.find('matake')
@user.items
@user.lists
@user.friends
@user.study.results
@matchied_users = Iknow::User.matching('matake')

# ## List API
@recent_lists = Iknow::List.recent
@matchied_lists = Iknow::List.matching("遺伝的アルゴリズム")
@matchied_lists.first.items
@matchied_lists.first.sentences

# ## Item API
@recent_items = Iknow::Item.recent
@matchied_items = Iknow::Item.matching('record')
@items = Iknow::Item.extract("sometimes, often, electrical")
@items.first.sentences

## Sentence API
@recent_sentences = Iknow::Sentence.recent
@matchied_sentences = Iknow::Sentence.matching('record')

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
nov-iknow-0.0.3 examples/pure_ruby.rb