comparison src/sync.coffee @ 4:f352c74a6a5b

remove typeof, corrected facebooks toESN entrys
author Mathias Gebbe <mgebbe@intevation.de>
date Fri, 06 Jun 2014 10:18:14 +0200
parents 98a070c98982
children af9f5b94c019
comparison
equal deleted inserted replaced
3:98a070c98982 4:f352c74a6a5b
84 if post.type is 'status' 84 if post.type is 'status'
85 parsed = "<img src='" + profilePicLink + "'></img> <a href='" + user.profileLink + "'>" + user.displayName + "</a> <a href='https://www.facebook.com/" + post.id + "'> schreibt</a> via " + network + " am " + post.updated_time + ":<br><br>" + post.message 85 parsed = "<img src='" + profilePicLink + "'></img> <a href='" + user.profileLink + "'>" + user.displayName + "</a> <a href='https://www.facebook.com/" + post.id + "'> schreibt</a> via " + network + " am " + post.updated_time + ":<br><br>" + post.message
86 86
87 if post.type is 'photo' 87 if post.type is 'photo'
88 parsed = "<img src='" + profilePicLink + "'></img> <a href='" + user.profileLink + "'>" + user.displayName + "</a> <a href='"+ post.link + "'> schreibt</a> via " + network + " am " + post.updated_time + ":<br>" 88 parsed = "<img src='" + profilePicLink + "'></img> <a href='" + user.profileLink + "'>" + user.displayName + "</a> <a href='"+ post.link + "'> schreibt</a> via " + network + " am " + post.updated_time + ":<br>"
89 parsed += "<br>" + post.message if typeof post.message isnt "undefined" 89 parsed += "<br>" + post.message if post.message? and post.message isnt ""
90 parsed += "<br><img src='" + post.picture + "'></img>" 90 parsed += "<br><img src='" + post.picture + "'></img>"
91 91
92 if post.type is 'link' or post.type is 'video' 92 if post.type is 'link' or post.type is 'video'
93 parsed = "<img src='" + profilePicLink + "'></img> <a href='" + user.profileLink + "'>" + user.displayName + "</a> <a href='https://www.facebook.com/" + post.id + "'> schreibt</a> via " + network + " am " + post.updated_time + ":<br>" 93 parsed = "<img src='" + profilePicLink + "'></img> <a href='" + user.profileLink + "'>" + user.displayName + "</a> <a href='https://www.facebook.com/" + post.id + "'> schreibt</a> via " + network + " am " + post.updated_time + ":<br>"
94 parsed += "<br>" + post.message if typeof post.message isnt "undefined" 94 parsed += "<br>" + post.message if post.message? and post.message isnt ""
95 parsed += "<br>" + post.description if typeof post.description isnt "undefined" 95 parsed += "<br>" + post.description if post.description?
96 parsed += "<br><a href='" + post.link + "'>"+ post.link + "</a>" if typeof post.link isnt "undefined" 96 parsed += "<br><a href='" + post.link + "'>"+ post.link + "</a>" if post.link?
97 parsed += "<br><img src='" + post.picture + "'></img>" if typeof post.picture isnt "undefined" 97 parsed += "<br><img src='" + post.picture + "'></img>" if post.picture?
98
99 98
100 callback null, parsed 99 callback null, parsed
101 100
102 if network is 'google' 101 if network is 'google'
103 parsed = "<img src='" + post.actor.image.url + "'></img> <a href='" + post.actor.url + "'>" + post.actor.displayName + "</a> <a href='"+ post.object.url + "'> schreibt</a> via " + network + " am " + post.updated + ":<br><br>" + post.object.content 102 parsed = "<img src='" + post.actor.image.url + "'></img> <a href='" + post.actor.url + "'>" + post.actor.displayName + "</a> <a href='"+ post.object.url + "'> schreibt</a> via " + network + " am " + post.updated + ":<br><br>" + post.object.content
104 if typeof post.object.attachments isnt "undefined" 103 if not post.object.attachments?
105 _.each post.object.attachments, (attachment) -> 104 _.each post.object.attachments, (attachment) ->
106 105
107 if attachment.objectType == "photo" 106 if attachment.objectType == "photo"
108 parsed += "<br><img src='" + attachment.image.url + "'></img>" 107 parsed += "<br><img src='" + attachment.image.url + "'></img>"
109 108
110 if attachment.objectType == "article" 109 if attachment.objectType == "article"
111 parsed += "<br><a href='" + attachment.url + "'>"+ attachment.displayName + "</a>" 110 parsed += "<br><a href='" + attachment.url + "'>"+ attachment.displayName + "</a>"
112 if typeof attachment.image isnt "undefined" 111 if not attachment.image?
113 parsed += "<br><img src='" + attachment.image.url + "'></img>" 112 parsed += "<br><img src='" + attachment.image.url + "'></img>"
114 113
115 if attachment.objectType == "video" 114 if attachment.objectType == "video"
116 parsed += "<br><a href='" + attachment.url + "'>"+ attachment.displayName + "</a>" 115 parsed += "<br><a href='" + attachment.url + "'>"+ attachment.displayName + "</a>"
117 if typeof attachment.image isnt "undefined" 116 if not attachment.image?
118 parsed += "<br><img src='" + attachment.image.url + "'></img>" 117 parsed += "<br><img src='" + attachment.image.url + "'></img>"
119 118
120 callback null, parsed 119 callback null, parsed
121 120
122 return 121 return
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)