Git Product home page Git Product logo

cs-whos-online's Introduction

Who's Online?

Pluggable online user counter, deployable straight on Heroku.

This is an entry for a CloudSpokes challenge.

Features

  • The counter only requires insertion of an iframe with a source URL containing the current username in the query
  • Therefore no other backend modification is required, other than rendering the username into the iframe URL (backend notifying counter application would slow down response times, because of sync http notifications)
  • Inside the iframe a socket.io connection is established with the counter server, which updates all clients in an async manner about joining or disconnecting users
  • Clicking the counter text, a popup is opened with a full list of online members, their names used as links to their profiles

Setup instructions

To use this online user counter on your website, follow these steps:

  • Deploy the repository on heroku (see below, suppose your app address is http://xxx.herokuapp.com)
  • Insert the following markup into your website (_USERNAME_ should be substituted by your logic to the logged in user's name)
<iframe style="width: 200px; height: 40px; border: 0;" src="http://xxx.herokuapp.com/embed?user=_USERNAME_"></iframe>

Deployment on Heroku

  • Issue heroku apps:create [app-name] --stack cedar in a terminal, then clone the prompted git URL
  • Copy content of this repository to the empty heroku repo
  • git commit -a and git push origin master to push&deploy the repository on heroku

Run locally

  • Install necessary node.js libraries with npm install
  • Launch the web server with node ./app.js

License

MIT license

cs-whos-online's People

Contributors

jeffdonthemic avatar

Stargazers

Jonathan Baltz avatar

Watchers

Justin Gasper avatar Sushil Shinde avatar James Cloos avatar Yoshifumi Kohata avatar Parth Shah avatar Jason Symons avatar  avatar Thomas Kranitsas avatar Kiril Kartunov avatar Will Price avatar Rishiraj Sahu avatar lindy avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.