Jump to content

Connectinig a Smiirl counter to a Caspio datapage


Recommended Posts

All,

 

Not sure if this is in the correct discussion, but has anyone connected a Smiirl counter (https://www.smiirl.com/) to a caspio datapage output/value yet? I understand the Smiirl counter connects based on JS /Node:

const express = require('express');
const app = express();

app.get('/', (req, res) => {
res.json({number: 12345})
});

app.listen(80);

or in PHP:

header('Access-Control-Allow-Origin: *');
header('Content-Type: application/json');

echo json_encode(array('number' => intval(date('Hi'))));

 

or in Phyton:

import http.server
import socketserver
import json
from http import HTTPStatus

class Handler(http.server.SimpleHTTPRequestHandler):
    def do_GET(self):
        data = {
            "number": 54321
            }
        self.send_response(HTTPStatus.OK)
        self.send_header('Content-type', 'application/json')
        self.end_headers()
        self.wfile.write(bytes(json.dumps(data), "utf-8"))

httpd = socketserver.TCPServer(('', 80), Handler)
httpd.serve_forever()

 

 

source: https://www.smiirl.com/en/counter/category/custom

Use case

We are using Caspio to monitor an approval/voting process, it would be a nice gimmick to hand the customer a Smiirl counter before the voting process starts so they can track it's progress live. The # of votes in favour would need to be posted by Caspio and picked up by the Smiirl counter.

 

Thoughts?

 

Looking forward to your ideas.

 

 

 

 

Edited by RABroos
Corrected and added extra information
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...