Mercurial > pumpbridge
comparison src/facebook.coffee @ 24:08d9679da0f7
s/wrotes/writes/
author | Mathias Gebbe <mgebbe@intevation.de> |
---|---|
date | Thu, 19 Jun 2014 13:01:11 +0200 |
parents | b90e6df48d2d |
children | f27ddfa42e94 |
comparison
equal
deleted
inserted
replaced
23:8c56fdbac0fb | 24:08d9679da0f7 |
---|---|
357 return if not post.object.content? or post.object.content is "" | 357 return if not post.object.content? or post.object.content is "" |
358 ToESN.search {uid: post.object.id + "@facebook"}, (err, result) -> | 358 ToESN.search {uid: post.object.id + "@facebook"}, (err, result) -> |
359 if result.length is 0 | 359 if result.length is 0 |
360 body = post.object.content.replace(/<(?:.|\n)*?>/gm, '') + " " + post.object.url | 360 body = post.object.content.replace(/<(?:.|\n)*?>/gm, '') + " " + post.object.url |
361 if post.verb is "share" | 361 if post.verb is "share" |
362 text = post.object.author.url + " wrotes:" | 362 text = post.object.author.url + " writes:" |
363 FB.api "me/feed", "post", | 363 FB.api "me/feed", "post", |
364 message: text + body | 364 message: text + body |
365 , (res) -> | 365 , (res) -> |
366 if not res or res.error | 366 if not res or res.error |
367 console.log (if not res then "error occurred" else res.error) | 367 console.log (if not res then "error occurred" else res.error) |