Proteins, Code & Fashion

  • Science
  • Tech
  • Fashion
  • Archive
  • RSS
  • Ask me anything

Ringing a bell in your browser through WebSockets

Today at Dolbeau I wanted to make a bell ring when a new order comes in… just like Jeff Bezos did in the early days of Amazon. I wanted to make sure that our bell rings in any browser that has the bell page open. It turns out it’s super easy to do using NodeJS/Express and Socket.IO.

This is how it all works:

  1. Load the URL in any number of browsers
  2. Send a POST to the same url
  3. Listen to the bell ring in all open browsers!

Also you can specify which sound you want to play by using the ‘type’ POST parameter. Just check out the JS and HTML files and you’ll be good to go!

Fork it on GitHub!

    • #nodejs
    • #web
    • #programming
    • #hacks
    • #tech
  • 11 months ago
  • 3
  • Comments
  • Permalink
  • Share
    Tweet

3 Notes/ Hide

  1. intotheblackandblue likes this
  2. grossnasty likes this
  3. davecap posted this

Recent comments

Blog comments powered by Disqus
← Previous • Next →

Logo

Proteins, Code & Fashion

Yo! I'm David Caplan. I'm a co-founder of Dolbeau, the online mens fashion accessory company. Previously, I studied biochemistry at the University of Toronto. I'm a published scientist, hacker, and player of the occasional song.

Internet

  • @davc on Twitter
  • davecap on Pinboard
  • davecap on Soundcloud
  • Linkedin Profile
  • davecap on github

Twitter

loading tweets…

  • RSS
  • Random
  • Archive
  • Ask me anything
  • Mobile

Effector Theme by Carlo Franco.

Powered by Tumblr