Skip to content

Instantly share code, notes, and snippets.

View wagurano's full-sized avatar
🍈

dallos wagurano

🍈
View GitHub Profile
@say8425
say8425 / get_pharmacy.rb
Last active May 23, 2017 04:56
Get Korean Pharmacy with OpenAPI
require 'json'
require 'rest-client'
url = 'http://openapi.e-gen.or.kr/openapi/service/rest/ErmctInsttInfoInqireService/getParmacyListInfoInqire'.freeze
key = 'Your Secret key'
params = {pageNo: 1, numOfRows: 100, ServiceKey: key}
data = RestClient.get(url, {params: params, accept: :json})
total_count = (JSON.parse(data.body)['response']['body']['totalCount'] / 100.to_f).ceil
total_data = []