Hyperpublic commonjs module for Titanium
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
Resources
.DS_Store
.gitignore
.project
CHANGELOG.txt
LICENSE
LICENSE.txt
README
README.textile
manifest
tiapp.xml

README.textile

Hyperpublic commonjs Titanium module

Using the Library

Include the lib/hyperpublic.js file in your application

var Hyperpublic = require('/lib/hyperpublic');

Creating the Hyperpublic Object

Create the Hyperpublic object by declaring it

var hyperpublic = new Hyperpublic.Client('YOUR CLIENT KEY', 'YOUR CLIENT SECRET');

Interacting with the Hyperpublic API

Now you can query against the Hyperpublic API. Each query takes two arguments. The first argument is the query itself while the second argument is the name of the callback function that you have specfied (if you’re not familiar with JSONP, start here).

client.places.find(your_query, your_callback);

Show a Place or Offer

A simple query for a person who has the id ‘4’ would look something like the call below. This call also triggers a function called ‘callback’.

hyperpublic.places.show({
	"id":4
}, 'callback');

Search for Places or Offers

It’s very easy to search the Hyperpublic by sending a series of paramaters to the API. If I wanted to find 2 pizza places in New York, NY 10014, I would issue a query like this:

hyperpublic.places.find({ 
	"location" : "New York, NY 10014", 
	"q":"pizza", 
	"limit": "2"
}, 'callback');

The Hyperpublic API would then return a JSON object which represtents the data available in the callback function.

For detailed documentation on the Hyperpublic API, visit the developer site.