8000 GitHub - michaelcho/urbanesia: Wrapper to access the Urbanesia API
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

michaelcho/urbanesia

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

urbanesia

urbanesia is a wrapper to access the Urbanesia API.

Urbanesia is an Indonesian directory site with API docs available online.

To use this gem, you will need to apply for a consumer key and secret.

This gem is a port of the PHP wrapper. The PHP wrapper has some methods relating to a user key and user secret (as well as the consumer key/secret) but I did not have to use these at all so did not include them in this gem.

Installation

gem "urbanesia", "~> 0.0.1.7"

Create a initializers/urbanesia.rb file:

Urbanesia.consumer_key = "your-key-here"
Urbanesia.consumer_secret = "your-secret-here"

That's it!

Usage

You can use the Urbanesia module in any controller.

I use it in a rake task, and include "require 'urbanesia'", ie

require 'urbanesia'
response = Urbanesia.request "get/super_search", "", "what=culinary&where=jakarta"

# response can now be treated as a normal string, eg
parsed_json = JSON.parse CGI.unescapeHTML(response)
unless parsed_json.blank? || parsed_json["biz_profile"].blank?
  restaurants = parsed_json["biz_profile"]
end

About

Wrapper to access the Urbanesia API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0