From 883add487253cf7e523d993ad5d09ae466b5490c Mon Sep 17 00:00:00 2001 From: bernadette Date: Tue, 19 Mar 2024 15:57:12 +0100 Subject: [PATCH] added print function --- assets/js/script.js | 8 +++++++- request-print.py | 7 +++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 request-print.py diff --git a/assets/js/script.js b/assets/js/script.js index 4a81406..092e67a 100644 --- a/assets/js/script.js +++ b/assets/js/script.js @@ -106,4 +106,10 @@ function handleInput() { console.log("Paper: " + userInput); console.log("info_layer" + userInput); -} \ No newline at end of file +} + +function print(input){ + fetch("https://hub.xpub.nl/chopchop/cgi-bin/table.cgi?input=" + input); +} + +print("test test test"); \ No newline at end of file diff --git a/request-print.py b/request-print.py new file mode 100644 index 0000000..e2ded26 --- /dev/null +++ b/request-print.py @@ -0,0 +1,7 @@ +from escpos.printer import Usb + +p = Usb(0x483, 0x811e, in_ep=0x81, out_ep=0x02, profile="POS-5890") +p.text("A card-browser game: The player gets a card and inserts the keyword appearing on the front of this card in the browser. The browser returns a literal interpretation of the card's function, a text related to the feminist concept connected to that function, and a printed sentence with a command for the player to execute. In this way, the player becomes a feminist server. There is also the possibility to play further with the cards in a one-on-one (or mulit-player) game with open rules.") +p.qr("https://xpub.nl", size=8, center=True) +p.image("call.png", center=True) #width should be 384px if it's too long it might crash +p.textln("") #this creates an empty line