b-g / temboo-proxy

a simple proxy helper to call and cache temboo choreos locally

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Temboo-Proxy

a simple proxy helper to call and cache temboo choreos locally.

Special thanks to Stefan Landsbek @47nrd for node.js tips and tricks!

Installation

Install node.js for your OS.

Install Temboo-Proxy:

download, unzip or (git clone https://github.com/b-g/temboo-proxy.git) ... and then in terminal:

cd temboo-proxy
npm install

Configuration

Now specify your temboo credentials in the config.js file:

  • copy config-sample.js
  • rename the file to config.js
  • fill in your temboo app credentials e.g. config.temboo.user_name = 'b-g';

Setup your Choreos

  • go to https://temboo.com/library/ and click together in wizzard the choreos you want to use
  • use the provided example code (at the end of the online wizzard) to define your choreos in tembooChoreos.js. There are already a few pre-defined, use them as a template for new ones. It is usally just tweaking one or two lines of the temboo example code.

twittersearch choreo setup

Start/Use Temboo-Proxy

node server.js

Now you can call your choreos locally:

localhost/choreoFunctionName?q=Query
e.g. http://localhost:3000/twittersearch?q=Stuttgart

NB. Every new call is cached exaclty once in the database ...

Example Choreo Calls

note: #stuttgart becomes %23stuttgart http://meyerweb.com/eric/tools/dencoder/

Twitter

Flickr

NY Times

Hints

You can get rid of the database by deleting the contents in the db folder or via calling http://localhost:3000/db/reset.

If you don't want to cache any recieved content from temboo, then just comment out the caching of the choreo in tembooChoreos.js

// cache.set(cacheKey, results.get_Response());

And last (for devs) you might want to install a utility like nodemon that will monitor for any changes in your source and automatically restart your server. Very handy.

About

a simple proxy helper to call and cache temboo choreos locally

License:MIT License


Languages

Language:JavaScript 100.0%