Mercurial > pumpbridge
comparison src/google.coffee @ 28:faeb3b96bdeb
use html-to-text
author | Mathias Gebbe <mgebbe@intevation.de> |
---|---|
date | Tue, 29 Jul 2014 12:14:02 +0200 |
parents | f27ddfa42e94 |
children | 3e3fa35e3ce2 |
comparison
equal
deleted
inserted
replaced
27:f27ddfa42e94 | 28:faeb3b96bdeb |
---|---|
41 (updateuser,callback) -> | 41 (updateuser,callback) -> |
42 user = updateuser | 42 user = updateuser |
43 #getUser(user) | 43 #getUser(user) |
44 getFriends(user,callback) | 44 getFriends(user,callback) |
45 ], (err, friends) -> | 45 ], (err, friends) -> |
46 async.eachLimit friends, 3, ((friend, callb) -> | 46 async.eachLimit friends, 2, ((friend, callb) -> |
47 async.waterfall [ | 47 async.waterfall [ |
48 (callback) -> | 48 (callback) -> |
49 getStream(user, friend, callback) | 49 getStream(user, friend, callback) |
50 (stream, callback) -> | 50 (stream, callback) -> |
51 return if not stream? or not stream.items? or stream.items.length is 0 | 51 return if not stream? or not stream.items? or stream.items.length is 0 |
52 async.eachLimit stream.items, 10, ((post, cb) -> | 52 async.eachLimit stream.items, 2, ((post, cb) -> |
53 async.waterfall [ | 53 async.waterfall [ |
54 (callback) -> | 54 (callback) -> |
55 console.log "check googlepost " + post.id + " to " + me | 55 console.log "check googlepost " + post.id + " to " + me |
56 FromESN.search {uid: post.id + "@google_to_" + me}, callback | 56 FromESN.search {uid: post.id + "@google_to_" + me}, callback |
57 (result, callback) -> | 57 (result, callback) -> |
79 , callback | 79 , callback |
80 ], (err, result) -> | 80 ], (err, result) -> |
81 #console.log err | 81 #console.log err |
82 console.log "done" | 82 console.log "done" |
83 cb() | 83 cb() |
84 return | |
85 ), (err) -> | 84 ), (err) -> |
86 callb() | 85 callb() |
87 return | |
88 ], (err, result) -> | 86 ], (err, result) -> |
89 ), (err) -> | 87 ), (err) -> |
90 if err | 88 if err |
91 console.log 'one post fail to process' | 89 console.log 'one post fail to process' |
92 else | 90 else |
93 console.log 'all google friends processed' | 91 console.log 'all google friends processed' |
94 return | 92 return |
95 return | |
96 | |
97 | 93 |
98 ####################################### | 94 ####################################### |
99 ###### get user info googleplus ###### | 95 ###### get user info googleplus ###### |
100 ####################################### | 96 ####################################### |
101 getUser = (user) -> | 97 getUser = (user) -> |