diff src/sync.coffee @ 5:af9f5b94c019

receive tweets
author Mathias Gebbe <mgebbe@intevation.de>
date Fri, 06 Jun 2014 14:42:28 +0200
parents f352c74a6a5b
children 2123f355ab68
line wrap: on
line diff
--- a/src/sync.coffee	Fri Jun 06 10:18:14 2014 +0200
+++ b/src/sync.coffee	Fri Jun 06 14:42:28 2014 +0200
@@ -118,6 +118,13 @@
 
     callback null, parsed
 
+  if network is 'twitter'
+
+    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 + "'> schreibt </a> via " + network + " am " + post.created_at + ":<br><br>" + post.text
+    _.each post.entities.media, (attachment) ->
+      parsed += "<br><img src='" + attachment.media_url + "'></img>"
+    callback null, parsed
+
   return
 
 
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)