…L@g9wM}³€X K"Y^ÒšTy"È¡a"²*µöz½0uü°êN(x`¶X@ç–iI-q«øyüâ+o5¿ {Å¡pwNj®)â5‚Œ7€1-Á¿û„A:÷\õE×N¸ž%×[\ëÄÉXr Y¼§bid‘ddates2024-11-16T23:55:00etitlexyTanzania Receipt QR Reader - タンザニアã®ãƒ¬ã‚·ãƒ¼ãƒˆã«æ„Ÿå‹•! å“ç›®ã”ã¨ã«æ—¥æœ¬å††ã«ã™ã‚‹ã‚¦ã‚§ãƒ–アプリdtagsx#js #africa #codefor #Tanzaniacurlxhttps://fukuno.jig.jp/4497dbodyy タンザニアã®ãŸã‚ã®ã‚³ãƒ¼ãƒ‰ã€Code for Tanzania!

タンザニアã§ã‚‚らã£ãŸãƒ¬ã‚·ãƒ¼ãƒˆã™ã¹ã¦ã«QRコードãŒï¼


アクセスã™ã‚‹ã¨ãƒ¬ã‚·ãƒ¼ãƒˆã®å†…容ãŒã‚¦ã‚§ãƒ–ã§è¦‹ãˆã¾ã™ã€‚
é‹å–¶ã—ã¦ã„ã‚‹ã®ã¯ã€ã‚¿ãƒ³ã‚¶ãƒ‹ã‚¢æ”¿åºœã®ç¨Žå‹™æ©Ÿé–¢ã€Tanzania Revenue Authority。
HTMLã§ã—ã‹å–å¾—ã§ããšã€APIã‚‚ãªã•ãã†ãªã®ã§ã€JSONã§å–å¾—ã§ãるよã†ã«ãƒ¬ãƒƒãƒ„ã€ã‚·ãƒ“ックテックï¼


「Tanzania Receipt QR Readerã€
src on GitHub
リシートã®QRコードを読ã¿è¾¼ã¾ã›ã‚‹ã¨HTMLã‚’JSON化ã—ã¦å–å¾—ã—ã€æ—¥æœ¬å††ã¾ãŸã¯ãƒ‰ãƒ«è¡¨ç¤ºä»˜ãã§è¡¨ç¤ºã™ã‚‹ã‚¦ã‚§ãƒ–アプリã§ã™ã€‚ タンザニアã®ãƒ¬ã‚­ãƒ¼ãƒˆã‚’æŒã£ã¦ã„ãªã„æ–¹ã¯ã€DEMOモードã§ã©ã†ãžï¼

レシートã«ã‚·ãƒ¼ã‚¯ãƒ¬ãƒƒãƒˆã¨ã—ã¦æ™‚間分秒ãŒã¤ã„ã¦ã„ã‚‹ã‚‚ã®ã¨ã€ã¤ã„ã¦ã„ãªã„ã‚‚ã®ãŒã‚ã‚Šã¾ã—ãŸã€‚
Cookieを使ã£ã¦ãƒ¬ã‚·ãƒ¼ãƒˆå–得ページã¸ã‚¢ã‚¯ã‚»ã‚¹ã—ã¾ã™ã€‚ fetchReceipt.js import { getCookie } from "./getCookie.js"; export const fetchReceipt = async (receiptVerificationCode) => { const n = receiptVerificationCode.indexOf("_"); if (n < 0) throw new Error("needs _hhmmss"); const vcode = receiptVerificationCode.substring(0, n); const s = receiptVerificationCode.substring(n + 1); const hms = s.substring(0, 2) + ":" + s.substring(2, 4) + ":" + s.substring(4, 6); //const hms = "21:20:46"; const baseurl = "https://verify.tra.go.tz/"; const url = baseurl + vcode; const res = await fetch(url); //console.log(res.headers); const options = { headers: { "Cookie": getCookie(res, "ASP.NET_SessionId") } }; //console.log(options); const res2 = await fetch(baseurl + "Verify/Verified?Secret=" + hms, options) const html = await res2.text(); return html; }; å–å¾—ã—ãŸHTMLã‹ã‚‰JSON化ã™ã‚‹ã‚³ãƒ¼ãƒ‰ã¯ parseReceipt.js ã§ã™ã€‚

CORS設定ã•ã‚Œã¦ãŠã‚‰ãšã€ãƒ–ラウザã‹ã‚‰ç›´æŽ¥ã‚¢ã‚¯ã‚»ã‚¹ã¯ã§ããªã‹ã£ãŸã®ã§ã€ä¸‹è¨˜ã®ã‚ˆã†ã«ã‚µãƒ¼ãƒãƒ¼ã‚¢ãƒ—リケーションを作ã£ã¦ã€API呼ã³å‡ºã—ã§ä½¿ãˆã‚‹ã‚ˆã†ã«ã—ã¾ã™ã€‚ import { fetchWeb } from "https://code4fukui.github.io/wsutil/fetchWeb.js"; import { getReceipt } from "./getReceipt.js"; export default fetchWeb(async (param, req, path, conninfo) => { //console.log("param", param); return await getReceipt(param); }); サーãƒãƒ¼ã«è¨­å®šã—ã¦ã§ãã‚ãŒã‚Šï¼ï¼ˆå‚考ã€README.md#setup)


ã“ã¡ã‚‰ãŒã‚¿ãƒ³ã‚¶ãƒ‹ã‚¢ã®ã‚¹ãƒ¼ãƒ‘ー


å産ã€ãƒŠãƒƒãƒ„ã‚’è²·ã„ã¾ã—ãŸ


タンザニアã®ãƒŠãƒƒãƒ„ã€ä»Šæœˆã®ã‚µã‚¤ãƒ•ãƒ©ã«æŒã£ã¦ã„ãã¾ã™ï¼


「CyberFriday - 2024-11-29ã€

ç¦äº•å¸‚ã®ã‚«ãƒ•ã‚§ã€ãƒ¨ãƒªãƒã«ã¦é–‹å‚¬ï¼ cimgxGhttps://img.sabae.cc/data/2052/30cd9780-e652-4d23-a2ab-4bb3b95408cc.jpg