Created
February 2, 2010 08:05
-
-
Save code/292496 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import gaerun | |
from google.appengine.ext import db | |
from google.appengine.api import urlfetch | |
from google.appengine.api import memcache | |
import simplejson | |
import logging | |
class User(db.Model): | |
name = db.StringProperty() | |
def twitter_fetch(what): | |
result = urlfetch.fetch(url="http://search.twitter.com/search.json?q=%s" % what) | |
if result.status_code == 200: | |
return simplejson.loads(result.content) | |
if __name__ == "__main__": | |
User(name="luke").put() | |
print User.all().fetch(100) | |
results = twitter_fetch("python") | |
logging.debug(results) | |
memcache.set("foo", "bar") | |
print memcache.get("foo") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment