Mercurial > pumpbridge
comparison src/sync.coffee @ 29:34cfa565f565
replace fromESN twitter links with html <a>
author | Mathias Gebbe <mgebbe@intevation.de> |
---|---|
date | Tue, 29 Jul 2014 16:06:05 +0200 |
parents | 08d9679da0f7 |
children | 3e3fa35e3ce2 |
comparison
equal
deleted
inserted
replaced
28:faeb3b96bdeb | 29:34cfa565f565 |
---|---|
109 | 109 |
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 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 | 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 |
115 _.each post.entities.media, (attachment) -> | 116 _.each post.entities.media, (attachment) -> |
116 parsed += "<br><img src='" + attachment.media_url + "'></img>" | 117 parsed += "<br><img src='" + attachment.media_url + "'></img>" |
117 callback null, parsed | 118 callback null, parsed |
118 | 119 |