Mercurial > pumpbridge
comparison src/sync.coffee @ 19:6b3f38af3fa4
use child_process for backend
author | Mathias Gebbe <mgebbe@intevation.de> |
---|---|
date | Fri, 13 Jun 2014 18:13:36 +0200 |
parents | a52b5b244e51 |
children | 08d9679da0f7 |
comparison
equal
deleted
inserted
replaced
18:c552faae9c1c | 19:6b3f38af3fa4 |
---|---|
32 if user.id.indexOf('@facebook') isnt -1 | 32 if user.id.indexOf('@facebook') isnt -1 |
33 console.log "start sync for facebook user" | 33 console.log "start sync for facebook user" |
34 Facebook.sync(user) | 34 Facebook.sync(user) |
35 ), (err) -> | 35 ), (err) -> |
36 catch err | 36 catch err |
37 console.log 'Error!' | 37 console.log 'Error!' + err |
38 | 38 |
39 # Twitter | 39 # Twitter |
40 try | 40 try |
41 Usermap.scan ((user) -> | 41 Usermap.scan ((user) -> |
42 if user.id.indexOf('@twitter') isnt -1 | 42 if user.id.indexOf('@twitter') isnt -1 |
43 console.log "start sync for twitter user" | 43 console.log "start sync for twitter user" |
44 Twitter.sync(user) | 44 Twitter.sync(user) |
45 ), (err) -> | 45 ), (err) -> |
46 catch err | 46 catch err |
47 console.log 'Error!' | 47 console.log 'Error!' + err |
48 | 48 |
49 | 49 |
50 # Google | 50 # Google |
51 try | 51 try |
52 Usermap.scan ((user) -> | 52 Usermap.scan ((user) -> |
53 if user.id.indexOf('@google') isnt -1 | 53 if user.id.indexOf('@google') isnt -1 |
54 console.log "start sync for google user" | 54 console.log "start sync for google user" |
55 Google.sync(user) | 55 Google.sync(user) |
56 ), (err) -> | 56 ), (err) -> |
57 catch err | 57 catch err |
58 console.log 'Error!' | 58 console.log 'Error!' + err |
59 #### | 59 #### |
60 return | 60 return |
61 | 61 |
62 | 62 |
63 postParser = (post, user, network, callback) -> | 63 postParser = (post, user, network, callback) -> |
130 | 130 |
131 syncFromESN() | 131 syncFromESN() |
132 | 132 |
133 return | 133 return |
134 | 134 |
135 | |
136 exports.postParser = postParser | 135 exports.postParser = postParser |
137 exports.sync = sync | 136 exports.sync = sync |