Skip to content

Instantly share code, notes, and snippets.

@code
Created February 2, 2010 08:05
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save code/292496 to your computer and use it in GitHub Desktop.
Save code/292496 to your computer and use it in GitHub Desktop.
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