I've been trying to understand how to setup systems from
the ground up on Ubuntu. I just installed redis onto
the box and here's how I did it and some things to look
out for.
To install:
| # probably ripped off from somewhere on drupal.org | |
| # requires the services module | |
| import xmlrpclib | |
| s = xmlrpclib.ServerProxy('http://localhost/services/xmlrpc') | |
| class DrupalNode: | |
| def __init__(self, title, body, path, ntype='page', uid=1, username='mmatienzo'): | |
| self.title = title |
| """ | |
| This is a simple example of WebSocket + Tornado + Redis Pub/Sub usage. | |
| Do not forget to replace YOURSERVER by the correct value. | |
| Keep in mind that you need the *very latest* version of your web browser. | |
| You also need to add Jacob Kristhammar's websocket implementation to Tornado: | |
| Grab it here: | |
| http://gist.github.com/526746 | |
| Or clone my fork of Tornado with websocket included: | |
| http://github.com/pelletier/tornado | |
| Oh and the Pub/Sub protocol is only available in Redis 2.0.0: |
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
| from app.config import TWITTER_APP_KEY, TWITTER_APP_SECRET | |
| twitter_oauth = oauth.remote_app( | |
| 'twitter', | |
| consumer_key=TWITTER_APP_KEY, | |
| consumer_secret=TWITTER_APP_SECRET, | |
| base_url='https://api.twitter.com/1.1/', | |
| request_token_url='https://api.twitter.com/oauth/request_token', |