diff src/facebook.coffee @ 3:98a070c98982

add Twitter support
author Mathias Gebbe <mgebbe@intevation.de>
date Thu, 05 Jun 2014 18:02:25 +0200
parents b73191efc65b
children f352c74a6a5b
line wrap: on
line diff
--- a/src/facebook.coffee	Thu Jun 05 11:09:18 2014 +0200
+++ b/src/facebook.coffee	Thu Jun 05 18:02:25 2014 +0200
@@ -1,10 +1,9 @@
 # Copyright (C) 2014 by Intevation GmbH
 # Author: Mathias Gebbe <mgebbe@intevation.de>
 #
-# This file is Free Software under the Apache License, Version 2.0
-# (the "License"); and comes with ABSOLUTELY NO WARRANTY!
-# You may not use this file except in compliance with the License.
-# See LICENSE for details.
+# This file is Free Software under the Apache License, Version 2.0;
+# and comes with NO WARRANTY!
+# See the documentation coming with pumpbridge for details.
 
 https = require("https")
 async = require("async")
@@ -276,7 +275,7 @@
   FB.setAccessToken token
 
   return if typeof post.object.content  is "undefined" or post.object.content is ""
-  ToESN.search {uid: post.object.id }, (err, result) ->
+  ToESN.search {uid: post.object.id + "@twitter"}, (err, result) ->
     if result.length is 0
       body = post.object.content.replace(/<(?:.|\n)*?>/gm, '') + " " + post.object.url
 
@@ -290,7 +289,7 @@
         async.waterfall [
           (callback) ->
             savePost = new ToESN()
-            savePost.uid = post.object.id
+            savePost.uid = post.object.id + "@twitter"
             savePost.sourceUser = post.actor.id
             savePost.sourcePost = post.object.id
             savePost.targetUser = user.user_ESN
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)