friendfeed.py Patch for use on Google App Engine

Ask and ye shall receive.  Attached is a patch for using friendfeed.py on Google App Engine.  You need to also have demjson available.  Google App Engine does not allow use of many C modules (like cjson) and both json and simplejson will throw decoding errors from time to time. demjson is slow but won’t throw errors around (I really wish we could use cjson; it’s so much faster).

Basically the differences are:

  1. Use urlfetch instead of urllib2
  2. Use Django’s urlencode which will work with unicode (letting you comment/share in languages like Chinese)
  3. Use demjson instead of cjson (which cannot be used on Google App Engine), simplejson, or json (which both throw decoding errors from time to time)

Enjoy!

Update:

You don’t need to use demjson anymore; simplejson will work just fine.  I just got an email from Sanjeev saying that they fixed the issue (’\x’ is not valid JSON).  This makes things even easier because simplejson is included in Django (from django.utils import simplejson) which is included in Google App Engine.

Viewing 12 Comments

Trackbacks

close Reblog this comment
blog comments powered by Disqus