Skip to content

kobayang/gurunavi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gurunavi

Ruby wrapper for the gurunavi API.

Installation

gem install gurunavi

Usage

Instantiate a client

client = Gurunavi::Client.new(keyid: 'your_keyid')

Examples

Note: The key and format options are automatically granted.

get infomation of restaurants from RestSearchAPI

rests = client.rest_search
with options
rests = client.rest_search(id: "ga13300")
rests = client.rest_search(areacode_l: "AREAL2802", category_l: "RSFST05000")
get the whole restaurants name example
index = 1
while true
  begin
    rests = client.rest_search(areacode_l: "AREAL2802", category_l: "RSFST05000", offset_page: index)
    rests.each do |rest|
      puts rest.name
    end
    index += 1
  rescue Gurunavi::NoShop => e
    break
  end
end

See more available options from manual.

get master of area large code (areacode_l) from GAreaLargeSearchAPI

areacode_l_master = client.g_area_large_search

Correspondence

See the All API lists

RestSearchAPI

rests = client.rest_search(options)

ForeignRestSearchAPI

rests = client.foreign_rest_search(options)

PhotoSearchAPI

photos = client.photo_search(options)

AreaSearchAPI

areamaster = client.area_search

PrefSearchAPI

prefmaster = client.pref_search

GAreaLargeSearchAPI

areacode_l_master = client.g_area_large_search

GAreaMiddleSearchAPI

areacode_m_master = client.g_area_middle_search

GAreaSmallSearchAPI

areacode_s_master = client.g_area_small_search

CategoryLargeSearchAPI

category_l_master = client.category_large_search

CategorySmallSearchAPI

category_s_master = client.category_small_search

Errors

Gurunavi returns the following error for incorrect response.

status code api errors
429 Gurunavi::TooManyAccess
600 Gurunavi::NoShop
601 Gurunavi::InvalidAccess
602 Gurunavi::InvalidShopNumber
603 Gurunavi::InvalidType
604 Gurunavi::InternalServerError
* Gurunavi::APIError

Contributing to gurunavi

  • Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
  • Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
  • Fork the project.
  • Start a feature/bugfix branch.
  • Commit and push until you are happy with your contribution.
  • Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
  • Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.

Copyright

Copyright (c) 2017 kobayang. See LICENSE.txt for further details.

About

Ruby wrapper for Gurunavi API

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages