Class: Naver::Search

Inherits:
Client show all
Defined in:
lib/naver/search.rb

Overview

Naver Search API

Class Method Summary collapse

Methods inherited from Client

#connection, connection, connection=, parse

Class Method Details

.adult(params = {}) ⇒ Object

Search > Adult (검색 > 성인 검색어 판별)

Parameters:

  • params (Hash) (defaults to: {})

    Params for the search


25
26
27
28
29
30
31
32
33
# File 'lib/naver/search.rb', line 25

def adult(params = {})
  result = JSON.parse(connection.get("/v1/search/adult", params).body)
  if result["adult"] == "1"
    result["adult"] = true
  elsif result["adult"] == "0"
    result["adult"] = false
  end
  parse(result)
end

.blog(params = {}) ⇒ Object

Search > Blog (검색 > 블로그)

Parameters:

  • params (Hash) (defaults to: {})

    Params for the search


7
8
9
# File 'lib/naver/search.rb', line 7

def blog(params = {})
  parse(JSON.parse(connection.get("/v1/search/blog", params).body))
end

.book(params = {}) ⇒ Object

Search > Book (검색 > 책)

Parameters:

  • params (Hash) (defaults to: {})

    Params for the search


19
20
21
# File 'lib/naver/search.rb', line 19

def book(params = {})
  parse(JSON.parse(connection.get("/v1/search/book", params).body))
end

.cafearticle(params = {}) ⇒ Object

Search > Cafearticle (검색 > 카페글)

Parameters:

  • params (Hash) (defaults to: {})

    Params for the search


49
50
51
# File 'lib/naver/search.rb', line 49

def cafearticle(params = {})
  parse(JSON.parse(connection.get("/v1/search/cafearticle", params).body))
end

.doc(params = {}) ⇒ Object

Search > Doc (검색 > 전문자료)

Parameters:

  • params (Hash) (defaults to: {})

    Params for the search


93
94
95
# File 'lib/naver/search.rb', line 93

def doc(params = {})
  parse(JSON.parse(connection.get("/v1/search/doc", params).body))
end

.encyc(params = {}) ⇒ Object

Search > Encyc (검색 > 백과 사전)

Parameters:

  • params (Hash) (defaults to: {})

    Params for the search


37
38
39
# File 'lib/naver/search.rb', line 37

def encyc(params = {})
  parse(JSON.parse(connection.get("/v1/search/encyc", params).body))
end

.errata(params = {}) ⇒ Object

Search > Errata (검색 > 오타변환)

Parameters:

  • params (Hash) (defaults to: {})

    Params for the search


67
68
69
70
71
# File 'lib/naver/search.rb', line 67

def errata(params = {})
  result = JSON.parse(connection.get("/v1/search/errata", params).body)
  result["errata"] = nil if result["errata"] == ""
  parse(result)
end

.image(params = {}) ⇒ Object

Search > Image (검색 > 이미지)

Parameters:

  • params (Hash) (defaults to: {})

    Params for the search


81
82
83
# File 'lib/naver/search.rb', line 81

def image(params = {})
  parse(JSON.parse(connection.get("/v1/search/image", params).body))
end

.kin(params = {}) ⇒ Object

Search > Kin (검색 > 지식 iN)

Parameters:

  • params (Hash) (defaults to: {})

    Params for the search


55
56
57
# File 'lib/naver/search.rb', line 55

def kin(params = {})
  parse(JSON.parse(connection.get("/v1/search/kin", params).body))
end

.local(params = {}) ⇒ Object

Search > Local (검색 > 지역)

Parameters:

  • params (Hash) (defaults to: {})

    Params for the search


61
62
63
# File 'lib/naver/search.rb', line 61

def local(params = {})
  parse(JSON.parse(connection.get("/v1/search/local", params).body))
end

.movie(params = {}) ⇒ Object

Search > Movie (검색 > 영화)

Parameters:

  • params (Hash) (defaults to: {})

    Params for the search


43
44
45
# File 'lib/naver/search.rb', line 43

def movie(params = {})
  parse(JSON.parse(connection.get("/v1/search/movie", params).body))
end

.news(params = {}) ⇒ Object

Search > News (검색 > 뉴스)

Parameters:

  • params (Hash) (defaults to: {})

    Params for the search


13
14
15
# File 'lib/naver/search.rb', line 13

def news(params = {})
 parse(JSON.parse(connection.get("/v1/search/news", params).body))
end

.shop(params = {}) ⇒ Object

Search > Shop (검색 > 쇼핑)

Parameters:

  • params (Hash) (defaults to: {})

    Params for the search


87
88
89
# File 'lib/naver/search.rb', line 87

def shop(params = {})
  parse(JSON.parse(connection.get("/v1/search/shop", params).body))
end

.webkr(params = {}) ⇒ Object

Search > Webkr (검색 > 웹문서)

Parameters:

  • params (Hash) (defaults to: {})

    Params for the search


75
76
77
# File 'lib/naver/search.rb', line 75

def webkr(params = {})
  parse(JSON.parse(connection.get("/v1/search/webkr", params).body))
end