Coder Social home page Coder Social logo

invasionofsmallcubes / khs-stockticker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jwboardman/khs-stockticker

0.0 1.0 0.0 85 KB

Example using Netty as a web server, and WebSockets to push unsolicited messages to a very simple JavaScript client

License: Apache License 2.0

Java 92.61% CSS 0.06% HTML 2.98% JavaScript 4.35%

khs-stockticker's Introduction

khs-stockticker

Example using Netty as a web server, and WebSockets to push unsolicited messages to a very simple JavaScript client

Cobbled together from several examples plus my own additions.

Some examples used:
https://www.websocket.org/echo.html
http://www.jarloo.com/get-near-real-time-stock-data-from-yahoo-finance/ (with help from Stack Overflow to make it return JSON)
https://github.com/netty/netty/blob/4.0/example/src/main/java/io/netty/example/http/file/HttpStaticFileServerHandler.java

Technologies Used:

Netty
GSON (for parsing incoming websocket requests into known classes)
SLF4j
HttpClient (for calling Yahoo's ticker REST service)
Eclipse minimal-json (for parsing Yahoo's huge JSON results without creating classes)

The app is a no-brainer. Use 'gradle run' to get the server going, then hit http://localhost:8080/wsticker to start the websocket connection. I auto-send GOOG and F as two symbols to start with. You can add more or remove symbols using the A the X buttons along with the symbol entry field. The connection must be active when you send or it won't get to the server, so click "Start" before adding or removing symbols.

What I didn't have time to do: add Shiro authentication. Maybe next time!

khs-stockticker's People

Contributors

jwboardman avatar vegemite4me avatar

Watchers

James Cloos 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.