Adjust the comment DCGI in order to be a CGI - gophercgis - Collection of gopher CGI/DCGI for geomyidae
(HTM) hg clone https://bitbucket.org/iamleot/gophercgis
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) changeset 05e2b80086c32e8747ce5aeaf86c23edb5510f34
(DIR) parent 1a44a60ebf9a146de0009a8212c302b7c7455a70
(HTM) Author: Leonardo Taccari <iamleot@gmail.com>
Date: Mon, 13 Aug 2018 01:58:15
Adjust the comment DCGI in order to be a CGI
Most comments are just markdown-ish.
Diffstat:
reddit/c.dcgi | 26 ++++++++++++--------------
1 files changed, 12 insertions(+), 14 deletions(-)
---
diff -r 1a44a60ebf9a -r 05e2b80086c3 reddit/c.dcgi
--- a/reddit/c.dcgi Mon Aug 13 00:41:17 2018 +0200
+++ b/reddit/c.dcgi Mon Aug 13 01:58:15 2018 +0200
@@ -13,23 +13,21 @@
/usr/pkg/bin/curl -A "${ua}" -s "${url}" |
/usr/pkg/bin/jq -r '
( .[0] | .data.children[] | .data |
- "t",
- "[h|\(.subreddit_name_prefixed | gsub("\\|"; "\\|") ) - " +
- "\(.title | gsub("\\|"; "\\|") )|" +
- "URL:\(.url | gsub("\\|"; "\\|"))|server|port]",
- "t\(.author) \( .created_utc | strftime("%F %H:%M") )",
- "tScore: \(.score)",
- "tComments: \(.num_comments)",
- "t",
+ "",
+ "\(.subreddit_name_prefixed) - \(.title)",
+ "\(.author) \(.created_utc | strftime("%F %H:%M"))",
+ "Score: \(.score)",
+ "Comments: \(.num_comments)",
+ "",
if .selftext != "" then
- "t\(.selftext | gsub(">"; ">") | gsub("&"; "&") | split("\n") | join("\nt") )",
- "t"
+ "\(.selftext | gsub(">"; ">") | gsub("&"; "&"))",
+ ""
else
empty
end ),
( .[1] | .. | select(.kind? == "t1") | .data |
- "t\(.author) \(.score) \( .created_utc | strftime("%F %H:%M") )",
- "t\(.body | gsub(">"; ">") | gsub("&"; "&") | split("\n") | join("\nt") )",
- "t",
- "t" )
+ "\(.author) \(.score) \(.created_utc | strftime("%F %H:%M"))",
+ "\(.body | gsub(">"; ">") | gsub("&"; "&"))",
+ "",
+ "" )
'