changeset 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 faeb3b96bdeb
children 3e3fa35e3ce2
files INSTALL.md src/restartSYNC.sh src/sync.coffee
diffstat 3 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/INSTALL.md	Tue Jul 29 12:14:02 2014 +0200
+++ b/INSTALL.md	Tue Jul 29 16:06:05 2014 +0200
@@ -20,6 +20,7 @@
 cp app.js_to_pump.io-client-app_lib node_modules/pump.io-client-app/lib/app.js
 cp index.js_to_pump.io-client-app_lib_routes node_modules/pump.io-client-app/lib/routes/index.js
 mkdir -p lib/ && coffee -b -c -o lib/ src/*.coffee
+cp src/restartSYNC.sh lib/restartSYNC.sh
 ```
 
 * configure your Facebook App ID and your Google App ID in
--- a/src/restartSYNC.sh	Tue Jul 29 12:14:02 2014 +0200
+++ b/src/restartSYNC.sh	Tue Jul 29 16:06:05 2014 +0200
@@ -1,8 +1,8 @@
 #!/bin/bash
 
-cd /home/pumpbridge/pumpbridge/src
+cd /home/pumpbridge/pumpbridge/lib
 
-until coffee syncALONE.coffee; do
+until node syncALONE.js; do
     echo "sync crashed with exit code $?. Respawning.." >&2
     sleep 1
 done
--- 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)