GithubHelp home page GithubHelp logo

airenas / forexpros-wss Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bingli224/forexpros-wss

0.0 0.0 0.0 39 KB

Simple secured websocket (wss) client to forexpros.com stream--a realtime source for investing.com.

Rust 97.35% Makefile 2.65%

forexpros-wss's Introduction

forexpros-wss

Simple secured websocket (wss) client to forexpros.com stream--a realtime instrument source for investing.com.

Accessible Pair IDs:

Pair ID Instrument name
8984 Hang Seng Futures
8873 Dow Jones Industrial Average (DJI)
14958 NASDAQ Composite
8830 Gold Futures
945629 BTC/USD
1058142 ETC/USD

For further pair id, hack the websocket in investing.com with some browser debugger, such as Chrome inspect.

Example

cargo run --example watch

Or

use forexpros_wss::push;

fn main ( ) {
	let pair_id = "945629";	// BTC/USD
	
	let handler = |s| {
		println ! ( "INFO: {:?}", s );
		
		OK (())
	};

	let stream = push::Stream::new ( pair_id.to_string ( ), handler )
		.expect ( "Failed to create stream" );
	
	println ! ("main: stream.pair_id={}", stream.pair_id);
	println ! ("main: stream.handler={:?}", stream.stream_handle_spawn);
	
	tokio::runtime::Runtime::new ( )
		.unwrap ( )
		.block_on (
			stream.stream_handle_spawn
		).unwrap ( ).unwrap ( );
}

forexpros-wss's People

Contributors

airenas avatar bingli224 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.