invoking a C++ program to access a JavaScript push service

I have a personal finance application built with Qt that needs to integrate with a JavaScript push service for real-time currency updates. The service does not use \endf in the http requests, specifically for fetching currency tickers.

<script src="//js.pusher.com/2.2/pusher.min.js" type="text/javascript"></script>
<script type="text/javascript">
var pusher = new Pusher("cb65d0a7a72cd94adf1f");
var channel = pusher.subscribe("ticker.160");
channel.bind("message", function(data) {
  //console.log(data);
  var topbuy = data.trade.topbuy;
  console.log("Price: ", topbuy.price,
              "Quantity:", topbuy.quantity);
});
</script>

How can I translate this functionality to C++ so that my application can directly interact with the ticker service instead of relying on JavaScript?

Answer №1

As stated on , their communication is based on WebSockets. You may consider exploring libraries such as or the Casablanca SDK from Microsoft at

Using one of these resources, connecting and receiving Pusher messages should be a straightforward process.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

cppcheck is issuing a warning regarding a const std::string[] declaration

I'm having trouble understanding a warning from cppcheck (version 1.85 running on a Linux system) which is indicating: someFile.h:23:29: caution: Redundant code: Detected a statement that starts with string constant. [constStatement] const std: ...

Need help capturing Ctrl+Plus keystrokes in Qt?

Is there a way to detect the key combination Ctrl++ in the function QWidget::keyPressEvent? Here is my current simplified code: void foo::keyPressEvent(QKeyEvent *event) { if (event->modifiers() == Qt::ControlModifier) { switch (event- ...

Filtering data based on the model in React Native allows you to refine and organize

This code snippet represents a modal that contains two custom dropdown components, a text input, and a button. When the button is clicked, it filters data from an API. Currently, I am struggling to create a functional filter function despite multiple atte ...

Ways to transfer data from a component to the Vue store?

One thing I am struggling with is setting data from my component to the store. methods: { // Inside my component ...mapMutations('lists', ['setContactListName']),// Importing function from the store viewHandler ...

Utilizing Sharepoint and Jquery to dynamically apply an active class to navigation menus based on the current page being

My current HTML setup includes jQuery v3.3.1, but I'm facing a challenge in dynamically adding an active tag to the site based on the user's location. Instead of using the limited SharePoint menu options, I'm considering creating my own men ...

The Facebook share button on my website is malfunctioning

Could someone please help me figure out why my custom Facebook share button is not functioning properly? When I click the button, the share window fails to appear. I have tested it as an html file on a live web server and have thoroughly reviewed the Faceb ...

Example: Utilizing data transfer from model to directive

I have a question regarding a specific part in an example from Thinkster. I believe my confusion is due to my limited understanding of JavaScript and AngularJS fundamentals. I've been teaching myself since December, starting with the basics of JavaScr ...

There is a lack of definition for an HTML form element in JavaScript

Encountering an issue with a HTML form that has 4 text inputs, where submitting it to a Javascript function results in the first 3 inputs working correctly, but the fourth being undefined. Highlighted code snippet: The HTML section: <form action="inse ...

Steps for making a CSS animation that horizontally moves an element

I've been working on a React project that features a horizontally scrolling banner. The animation for the automatic scroll is set up like this: "@keyframes marquee": { "0%": { transform: "translateX(0);" }, &quo ...

Can you merge the values between two arrays of objects by counting them and combining them into a single array?

I'm faced with an array conundrum categories: [ { name: 'category1', items: 0, }, { name: 'category2', items: 0, }, { name: 'category3', items: 0, }, ] And then there's this separate ar ...

React components multiplying with every click, tripling or even quadrupling in number

My app enables users to create channels/chatrooms for communication. I have implemented a feature where pressing a button triggers the creation of a channel, using the function: onCreateChannel. Upon calling this function, the state of createChannel chan ...

The toolbar is not visible at the top of the page when using the scroll-off-screen property

I am currently working on implementing a v-toolbar for a page, with the requirement that the toolbar remains visible on the screen at all times, even when scrolling. I have tried using 'scroll-off-screen', which does keep the toolbar visible whil ...

When utilizing the yo angular-fullstack:endpoint, the message endpoint fails to produce the message.socket.js

Hey there, I've encountered an issue where the yo angular-fullstack endpoint shopPacket is not generating the shopPacket.socket.js file. I attempted to update the yo angular full stack generator, but unfortunately, the problem persists. yo angular-f ...

The Express GET route does not support parameters or additional paths

I am facing an issue with making a fetch request when trying to add additional path or parameters... Here is what I want to achieve: const fetchOwnerCardList = () => { fetch("http://localhost:5000/api/card/ownerCards", { method: "GET", header ...

Customizing Bootstrap to automatically display a modal without the need for a button click

According to the Bootstrap website, modals are typically triggered using buttons. As I am working with React, I would like to control when the modal is displayed using JavaScript. Is there a way to have the modal appear by default? Here is the code snip ...

The function finally is not available after executing the promises with api.get().thenReturn().catch()

I'm currently working on a React Native API call. On paper, everything seems to be in order - import DataAPI from "../../utils/API"; componentDidMount() { let merchantId = this.props.merchant.id; let api = new DataAPI(this.props.gath ...

Exploring jsTree: A Guide to Extracting all Leaf Nodes

Is there a way to extract all leaf nodes (ID & text) from jsTree without using the checkbox UI? Root -----A -----A1 -----A1.1 -----A2 -----A2.1 -----B -----B2 ...

The error message `Error [ERR_REQUIRE_ESM]: require() of ES Module` is triggered when attempting to call the old

I've been attempting to integrate with the Unsplash API, but I'm encountering an issue. When I try to execute the script using ts-node like this: ts-node unsplash.ts I receive the following error: C:\Users\USER\AppData\Roamin ...

Storing data in a void pointer based on the CIN input type always results in an access exception error for unsigned characters

if(menu_option==1) //INSERT { SDI::StoredData* temp = new SDI::StoredData(); int pos = 0; void* val = 0; int type = 0; string input; std::cout << "\t\t2.4 Enter what type of data (0 = int ...

Changing component properties using router-view in Vue.js is the recommended approach

Looking to pass a boolean value from a view within a router-view up to the root App.vue and then on to a component in the App.vue. Successfully achieved this, but encountering an error: Received a warning about mutating a prop directly, as it will be over ...