Skip to content

Instantly share code, notes, and snippets.

@hoverbird
Created September 17, 2010 19:36
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • 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