Mercurial > pumpbridge > pumpbridge
comparison src/sync.coffee @ 30:3e3fa35e3ce2
twitter sync likes, recommend mongodb
configure pump2twitter, twitter2pump in webui
author | Mathias Gebbe <mgebbe@intevation.de> |
---|---|
date | Thu, 28 Aug 2014 18:40:39 +0200 |
parents | 34cfa565f565 |
children | 8238d312e281 |
comparison
equal
deleted
inserted
replaced
29:34cfa565f565 | 30:3e3fa35e3ce2 |
---|---|
110 callback null, parsed | 110 callback null, parsed |
111 | 111 |
112 if network is 'twitter' | 112 if network is 'twitter' |
113 | 113 |
114 post.text = post.text.replace(/(http[s]?:\/\/[^ ]+)/ig,'<a href="$1">$1<\/a>') | 114 post.text = post.text.replace(/(http[s]?:\/\/[^ ]+)/ig,'<a href="$1">$1<\/a>') |
115 | |
115 parsed = "<img src='" + post.user.profile_image_url + "'></img> <a href='https://twitter.com/account/redirect_by_id/" + post.user.id + "'>" + post.user.name + "</a> <a href='https://twitter.com/" + post.user.screen_name + "/status/" + post.id_str + "'> writes </a> via " + network + " at " + post.created_at + ":<br><br>" + post.text | 116 parsed = "<img src='" + post.user.profile_image_url + "'></img> <a href='https://twitter.com/account/redirect_by_id/" + post.user.id + "'>" + post.user.name + "</a> <a href='https://twitter.com/" + post.user.screen_name + "/status/" + post.id_str + "'> writes </a> via " + network + " at " + post.created_at + ":<br><br>" + post.text |
116 _.each post.entities.media, (attachment) -> | 117 _.each post.entities.media, (attachment) -> |
117 parsed += "<br><img src='" + attachment.media_url + "'></img>" | 118 parsed += "<br><img src='" + attachment.media_url + "'></img>" |
118 callback null, parsed | 119 callback null, parsed |
119 | 120 |