Skip to content

Instantly share code, notes, and snippets.

View gbtrabzon's full-sized avatar

Gurkan gbtrabzon

  • Cambridgeshire / United Kingdom
View GitHub Profile
@dawsontoth
dawsontoth / tweetView.js
Created February 10, 2011 04:07
Make tweets and links clickable in Titanium Mobile! Here I make a tweet look just like it does on Twitter, and interact the same too.
/**
* Define our parser class. It takes in some text, and then you can call "linkifyURLs", or one of the other methods,
* and then call "getHTML" to get the fully parsed text back as HTML!
* @param text that you want parsed
*/
function Parser(text) {
var html = text;
var urlRegex = /((ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?)/gi;