Skip to content

Instantly share code, notes, and snippets.

@hoverbird
Created September 17, 2010 19:36
Show Gist options
  • Save hoverbird/584797 to your computer and use it in GitHub Desktop.
Save hoverbird/584797 to your computer and use it in GitHub Desktop.
/*-------- Here's how your Gists render in #newtwitter's details pane --------*/
twttr.mediaType('twttr.media.types.Gist')
.url('http://gist.github.com')
.matcher(/\b(?:https?\:\/\/)?gist\.github\.com\/(\S+)/g)
.icon('generic')
.process(function(slug, cb) {
slug = slug.replace(/\/$/, '');
this.data["id"] = slug;
cb();
})
.methods({
html: function(cb) {
var t = '<div class="gist"><iframe src="http://gist.github.com/{id}.pibb" /></div>'
cb(twttr.supplant(t, this.data));
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment