External Comment Integration

August 4th, 2011
comments, facebook, googleplus, tech
For a long time I've crossposted blog entries to facebook (and now google plus) and have avoided needing to implement commenting by letting those serve as discussion fora. I got kind of annoyed with this making the discussion fragmented and decided to fix this. Unfortunately, there's not an api available for google plus yet. So for now I just settled for pulling comments from the facebook api.

If you're interested in the technical details, I needed a pretty roundabout solution because I have two constraints: (1) I don't want people to have to authenticate with facebook or something to see the comments and (2) I can't run any server side code on my blog host. I ended up going with a simple wsgi app that pulls from facebook's graph api with an oauth token in my name, makes it into html, returns "'document.write(%s);' % json.dumps(html)", which is then included into my document with a script tag where I want the comments to show up. I do need to specify the facebook id of the post, instead of it automatically discovering it, but that's not so bad. I was originally planning to use an iframe, but it turns out that including content with an iframe that acts like part of your page instead of independently scrolling is a really hard problem involving lots of javacript and browser workarounds.

So comment away!

Update 2012-03-24: The code, minus facebook access tokens, is now on github.
Referenced in:

Comment via: google plus, facebook, substack

Recent posts on blogs I like:

Elixir's Last Dance

On May 18th, the contra dance band Elixir had their last gig ever. The dance was packed: there were three hundred people. It was the only dance BIDA has ever done where they sold tickets. People flew from across the country just to hear Elixir play one la…

via Lily Wise's Blog Posts June 5, 2025

Body Language For Trans People

When I first came out as trans, resources for trans people were full of advice about body language.

via Thing of Things June 2, 2025

Workshop House case study

Lauren Hoffman interviewed me about Workshop House and wrote this post about a community I’m working on building in DC.

via Home April 30, 2025

more     (via openring)