Framework for building API’s in Ruby
http://sinatra-book.gittr.com/
After looking at hundreds of API’s over past months – models begin to emerge:
Or some combination of all three.
The best tools for getting data in and out of Max:
An API factory.
Happened to look at mashape.com again today. Its grown considerably over the past year and now provides access to over 1300 API’s with open source client libraries and Oauth proxies.
Mashape is an API of API’s – a layer of abstraction that standardizes how you consume API’s.
Instructions for using the API: https://www.mashape.com/docs/consume/rest
Here’s an example of a typical API call which gets the weather in San Francisco. Note I have obscured the API-key.
curl -H "X-Mashape-Authorization: YOUR-MASHAPE-KEY" "https://george-vustrey-weather.p.mashape.com/api.php?_method=getForecasts&location=San%20Francisco"
Here’s the result:
[{"day_of_week":"Wed","high":"63","low":"47","condition":"Mostly Clear"},{"day_of_week":"Thu","high":"66","low":"50","condition":"Partly Cloudy"}]
[Note] examples in tkzic/mashape
The API description pages have curl examples.
[update] using pyOsc – there are examples in tkzic/python-api/pyOSC_examples
This appears to work fine with tests sending to Max
The three libs that seem to be in use…
pyOsc, simple Osc, liblo
download pyOSC
https://pypi.python.org/pypi/pyOSC
installing pyOSC
sudo python ./setup.py install
examples:
http://www.ixi-software.net/content/body_backyard_python.html
update: 11/1/2014 installed version 7.19.5 using easy_install
Here’s the website: http://pycurl.sourceforge.net
It worked. Because xCode was installed?
sudo env ARCHFLAGS="-arch x86_64" /usr/bin/easy_install setuptools pycurl==7.19.0
Here are instructions, but really all I needed was the above command
http://blog.carlotorniai.net/lion-and-pycurl/
Pycurl examples: http://www.angryobjects.com/2011/10/15/http-with-python-pycurl-by-example/
Local file examples in tkzic/python-api/
There are other Python libs like request, human curl, urllib….
node wrapper for curl
by jiangmiao
https://npmjs.org/package/node-curl
How to run curl from the shell in node.js: http://query7.com/nodejs-curl-tutorial
A variation on the Twitter mood-lamp program.
note 6/2014 – this may not work due to changes in oauth
local files:
It grabs a ‘feed’ or any URL which returns a bunch of text. Then it does some analysis on the text, and using the results to send RGB data back to Max using OSC.
An example of using the twitter4j library in Processing to do a Twitter search and display the results on a world map.
local file is in: documents/processing/Processing_Twitter
More information about twitter4j in processing:
https://forum.processing.org/topic/json-quiry-twitter
https://forum.processing.org/topic/twitter-streaming