Skip to content

Instantly share code, notes, and snippets.

@softprops
Created January 30, 2014 05:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save softprops/8702917 to your computer and use it in GitHub Desktop.
Save softprops/8702917 to your computer and use it in GitHub Desktop.
$(function() {
var el = $("#slide-9") // last slide
, stream = new WebSocket("ws://stream.meetup.com/2/photos")
, target_event = 156380082 // http://www.meetup.com/Application-Developers-Alliance-NYC-Meetup/events/156380082/
, target_member = 8157820; // me (doug)
stream.onmessage = function (msg) {
var item = msg.data ? JSON.parse(msg.data) : null;
if (item) {
var event_id = item.photo_album.event ? item.photo_album.event.id : null
, member_id = item.member.member_id
, link = item.photo_link;
if (target_event === event_id && target_member == member_id) {
var background = {
"background": "url('" + link + "') no-repeat center center fixed",
"-webkit-background-size": "cover",
"-moz-background-size":"cover",
"-o-background-size":"cover",
"background-size":"cover",
"color":"#fff"
};
el.css(background);
}
}
};
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment