Skip to content

Instantly share code, notes, and snippets.

T("#login").connectButton(
{ size: "large",
authComplete: function(user) {
createUserInfo(T.currentUser);
homeTimeline();
T("#tweetbox").tweetBox({
height: 50,
width: 590,
defaultContent: "",
onTweet : function(p,h) {homeTimeline();}
function homeTimeline(){
$('div#tweets OL').html('');
twttr.anywhere(function (T) {
T.currentUser.homeTimeline().first(10).each(function(status) {
createStatus(status);
T("LI#status_"+status.id).hovercards();
});
});
}
urls = getUrls(status.text);
if (urls != null){
$.each(urls, function(index, url){
$.embedly(url, {maxWidth:580}, function(oembed){
if (oembed != null){
$("LI#status_"+status.id).append(oembed.code);
return false;
}
});
});
[{u'about': u"YouTube is the world's most popular online video community, allowing millions of people to discover, watch and share originally-created videos. YouTube provides a forum for people to connect, inform, and inspire others across the globe and acts as a distribution platform for original content creators and advertisers large and small.",
u'displayname': u'YouTube',
u'domain': u'youtube.com',
u'favicon': u'http://c1611152.cdn.cloudfiles.rackspacecloud.com/youtube.ico',
u'name': u'youtube',
u'regex': [u'http://.*youtube\\.com/watch.*',
u'http://.*\\.youtube\\.com/v/.*',
u'http://youtu\\.be/.*',
u'http://.*\\.youtube\\.com/user/.*\\#.*',
u'http://.*\\.youtube\\.com/.*\\#.*/.*'],
import urllib2
import json
import re
response = urllib2.urlopen('http://api.embed.ly/v1/api/services/python')
services = json.loads(response.read())
url = 'http://soundcloud.com/dociler/dociler-futuricity'
for service in services:
for regex in service['regex']:
if re.match(regex, url):
print "Matched %s to %s" % (url, service['displayname'])
import urllib2
import urllib
import json
import memcache
import re
#[url=http://example.com]Example[/url] OR [url]http://example.com[/url]
bbcode_url_re = re.compile('\[url(|\=(?P<url>.*?))\](?P<url_or_title>.*?)\[/url]')
cache = memcache.Client(['127.0.0.1:11211'])
MAX_WIDTH = 600
(function($) {
$.fn.oembed = function(url, options, callback) {
options = $.extend(true, $.fn.oembed.defaults, options);
return this.each(function() {
var container = $(this),
resourceURL = (url != null) ? url : container.attr("href"),
provider;
"""
Generate New Provider list for jQuery oEmbed.
"""
import json
import urllib2
import json
import re
def main():
response = urllib2.urlopen('http://api.embed.ly/v1/api/services/javascript')