iAdd URL: support for links - gopher-lawn - The gopher lawn gopher directory project. Err bitreich.org 70 hgit clone git://bitreich.org/gopher-lawn/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/gopher-lawn/ URL:git://bitreich.org/gopher-lawn/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/gopher-lawn/ bitreich.org 70 1Log /scm/gopher-lawn/log.gph bitreich.org 70 1Files /scm/gopher-lawn/files.gph bitreich.org 70 1Refs /scm/gopher-lawn/refs.gph bitreich.org 70 1Tags /scm/gopher-lawn/tag bitreich.org 70 i--- Err bitreich.org 70 1commit 974f98c767fdd17fc8ede63a867f5c29061f9ec2 /scm/gopher-lawn/commit/974f98c767fdd17fc8ede63a867f5c29061f9ec2.gph bitreich.org 70 1parent c61ce3f78fe333bfb20aa2cd94a427743be571a7 /scm/gopher-lawn/commit/c61ce3f78fe333bfb20aa2cd94a427743be571a7.gph bitreich.org 70 hAuthor: Christoph Lohmann <20h@r-36.net> URL:mailto:20h@r-36.net bitreich.org 70 iDate: Fri, 28 Aug 2020 12:56:10 +0200 Err bitreich.org 70 i Err bitreich.org 70 iAdd URL: support for links Err bitreich.org 70 i Err bitreich.org 70 iDiffstat: Err bitreich.org 70 i M index.gph | 5 +++++ Err bitreich.org 70 i M lawn-mower/lawn-mower.py | 7 +++++-- Err bitreich.org 70 i Err bitreich.org 70 i2 files changed, 10 insertions(+), 2 deletions(-) Err bitreich.org 70 i--- Err bitreich.org 70 1diff --git a/index.gph b/index.gph /scm/gopher-lawn/file/index.gph.gph bitreich.org 70 i@@ -82,6 +82,11 @@ You want to propose a link or your own website? Either go on Err bitreich.org 70 i Err bitreich.org 70 i [1|Proposal menu.|/lawn/submit.dcgi|server|port] Err bitreich.org 70 i Err bitreich.org 70 i+If you want to save the moderators time, check out Err bitreich.org 70 i+[h|git://bitreich.org/gopher-lawn|URL:git://bitreich.org/gopher-lawn|server|port] Err bitreich.org 70 i+and add a file with categories and keywords to the »db« directory. There Err bitreich.org 70 i+are many example files in there for how the format looks like. Err bitreich.org 70 i+ Err bitreich.org 70 i Err bitreich.org 70 i [1|<< back to bitreich.org|/|server|port] Err bitreich.org 70 i Err bitreich.org 70 1diff --git a/lawn-mower/lawn-mower.py b/lawn-mower/lawn-mower.py /scm/gopher-lawn/file/lawn-mower/lawn-mower.py.gph bitreich.org 70 i@@ -160,8 +160,11 @@ def main(args): Err bitreich.org 70 i print("'%s' has no keywords defined." \ Err bitreich.org 70 i % (obj["linkname"])) Err bitreich.org 70 i Err bitreich.org 70 i- def linktype2gopher(linktype): Err bitreich.org 70 i+ def linktype2gopher(link): Err bitreich.org 70 i+ linktype = link["type"] Err bitreich.org 70 i if linktype == "link": Err bitreich.org 70 i+ if link["selector"].startswith("URL:"): Err bitreich.org 70 i+ return "h" Err bitreich.org 70 i return "1" Err bitreich.org 70 i elif linktype == "text": Err bitreich.org 70 i return "0" Err bitreich.org 70 i@@ -203,7 +206,7 @@ def main(args): Err bitreich.org 70 i Err bitreich.org 70 i def printlink(link): Err bitreich.org 70 i rtext = "[%s|%s|%s|%s|%s]\n" \ Err bitreich.org 70 i- % (linktype2gopher(link["type"]),\ Err bitreich.org 70 i+ % (linktype2gopher(link),\ Err bitreich.org 70 i link["linkname"],\ Err bitreich.org 70 i link["selector"],\ Err bitreich.org 70 i link["host"],\ Err bitreich.org 70 .