about summary refs log tree commit diff stats
path: root/chesstv.tlv
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2022-02-12 18:58:24 -0800
committerKartik K. Agaram <vc@akkartik.com>2022-02-12 18:58:24 -0800
commit27a99111eebfddc32e0ad79c3de8a629b3bc8106 (patch)
tree1641b7fdfd1e0fc1d4729d6e4204245e4c705a8d /chesstv.tlv
parent3db03840e111631e45422787bc8e50cb890f280e (diff)
downloadteliva-27a99111eebfddc32e0ad79c3de8a629b3bc8106.tar.gz
fix chesstv.tlv after we introduced sandboxing
Diffstat (limited to 'chesstv.tlv')
-rw-r--r--chesstv.tlv23
1 files changed, 23 insertions, 0 deletions
diff --git a/chesstv.tlv b/chesstv.tlv
index 91d8d07..d96755e 100644
--- a/chesstv.tlv
+++ b/chesstv.tlv
@@ -260,3 +260,26 @@
     >    return tostring(o)
     >  end
     >end
+- __teliva_timestamp:
+    >Sat Feb 12 18:57:02 2022
+  __teliva_note:
+    >better UX when app isn't permitted to access the network
+  main:
+    >function main()
+    >  init_colors()
+    >  local request = {
+    >    url = "https://lichess.org/api/tv/feed",
+    >    sink = function(chunk, err)
+    >             if chunk then
+    >               curses.clear()
+    >               -- main event loop is here
+    >               render(chunk)
+    >               curses.getch()
+    >             end
+    >             return 1
+    >           end,
+    >  }
+    >  http.request(request)
+    >  -- degenerate event loop just to show errors in sandboxing, etc.
+    >  while true do curses.getch(); end
+    >end