Skip to content

Instantly share code, notes, and snippets.

@briancray
briancray / linkify.js
Created November 6, 2012 13:56
Linkify Twitter API entities
/*
Compliant with Twitter's Developer Display Requirements:
https://dev.twitter.com/terms/display-requirements
*/
var linkify_result = function (tweet /* tweet object from the results array */) {
var subs = [],
last_offset = 0,
new_tweet = '',
entity,
replace = {
(function () {
var loaded = false;
test_cc = window.test_cc ? test_cc : false;
test_url = window.test_url ? test_url : false;
var inject_jsapi = function () {
var h = document.getElementsByTagName('head')[0];
var s = document.createElement('script');
s.type = 'text/javascript';