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:
- Use urlfetch instead of urllib2
- Use Django’s urlencode which will work with unicode (letting you comment/share in languages like Chinese)
- 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.

How To: Dynamic Slide Down Disqus Comments
Monday, March 3rd, 2008RSSmeme now has dynamically generated slide down Disqus comments for every story (see it in action by clicking the comment link next to “Contribute”). I had to hack around a bit with the Disqus provided embed.js to get it working, here’s how:
document.write()where the style information is written. Dynamically calling this script with the style writing will blank out your screen for some reason (I’m not a javascript expert so don’t ask me why).disqus_container_idbut alas it does not. I thought about copying thread.js locally and making this enhancement but decided against it.So here is how my code looks (the
hack()function is where I locally copied embed.js):There are some side effects that need to be fixed too:
disqus_urlanddisqus_container_idare global variables. Yuck, I know, but I could probably get around this too by making them arguments to hack(). For now it works for me.document.write(). I copied everything out of it and placed it into its own stylesheet.disqus_container_id(which you’ll need for the slide down effect anyway)That’s it! If you have any questions feel free to ask. You can look at my complete (production) javascript here.
Tags: comments, disqus, javascript, jquery, Programming, rssmeme
Posted in Uncategorized | 92 Comments »