diff src/sync.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/sync.coffee	Thu Jun 05 11:09:18 2014 +0200
+++ b/src/sync.coffee	Thu Jun 05 18:02:25 2014 +0200
@@ -1,16 +1,18 @@
 # 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.
 
 _ = require("underscore")
 async = require("async")
 Facebook = require("./facebook")
 Usermap = require("./usermap")
 Google = require("./google")
+Config = require ("./config")
+config = Config.config
+Twitter = require("./twitter")(config)
 
 syncFromESN = () ->
   console.log 'syncFromESN'
@@ -37,6 +39,20 @@
     console.log 'Error!'
     return
 
+  # Twitter
+  try
+    Usermap.scan ((user) ->
+      if user.id.indexOf('twitter') isnt -1
+        console.log "start sync for twitter user"
+        Twitter.sync(user)
+      return
+    ), (err) ->
+      return
+  catch err
+    console.log 'Error!'
+    return
+
+
   # Google
   try
     Usermap.scan ((user) ->
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)