diff src/sync.coffee @ 29:34cfa565f565

replace fromESN twitter links with html <a>
author Mathias Gebbe <mgebbe@intevation.de>
date Tue, 29 Jul 2014 16:06:05 +0200
parents 08d9679da0f7
children 3e3fa35e3ce2
line wrap: on
line diff
--- a/src/sync.coffee	Tue Jul 29 12:14:02 2014 +0200
+++ b/src/sync.coffee	Tue Jul 29 16:06:05 2014 +0200
@@ -111,6 +111,7 @@
 
   if network is 'twitter'
 
+    post.text = post.text.replace(/(http[s]?:\/\/[^ ]+)/ig,'<a href="$1">$1<\/a>')
     parsed = "<img src='" + post.user.profile_image_url + "'></img> <a href='https://twitter.com/account/redirect_by_id/" + post.user.id + "'>" + post.user.name + "</a> <a href='https://twitter.com/" + post.user.screen_name + "/status/" + post.id_str + "'> writes </a> via " + network + " at " + post.created_at + ":<br><br>" + post.text
     _.each post.entities.media, (attachment) ->
       parsed += "<br><img src='" + attachment.media_url + "'></img>"
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)