Create a gist now

Instantly share code, notes, and snippets.

/*-------- 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