Skip to content

Instantly share code, notes, and snippets.

@JustinTulloss
Created March 17, 2009 08:18
Show Gist options
  • Select an option

  • Save JustinTulloss/80396 to your computer and use it in GitHub Desktop.

Select an option

Save JustinTulloss/80396 to your computer and use it in GitHub Desktop.
(defn urlize
"A function that takes some text and creates links out of URLs
that it finds"
([text]
(.replaceAll
(re-matcher #"https?://[-\w]+\.\w[-\w/]*+" text)
"<a href=\"$0\">$0</a>")))
(defn twitter-status
([tweet]
(html
[:div {:class "tweet"}
[:div {:class "tweet-text"} (urlize (tweet "text"))]
[:div {:class "tweet-user"} ((tweet "user" {}) "name" '()) ]
])))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment