~ghost08/ratt

Fix koblenz press releases v1 PROPOSED

Daniel Hecker: 1
 Fix koblenz press releases

 1 files changed, 14 insertions(+), 2 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~ghost08/ratt/patches/34514/mbox | git am -3
Learn more about email & git

[PATCH] Fix koblenz press releases Export this patch

Urls are not consistent and need to be checked, before
prepending schema and host.
---
 confs/koblenz-press-releases.yml | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/confs/koblenz-press-releases.yml b/confs/koblenz-press-releases.yml
index 1764202..f695206 100644
--- a/confs/koblenz-press-releases.yml
+++ b/confs/koblenz-press-releases.yml
@@ -22,7 +22,13 @@ selectors:
    content: |-
      -- get link to press release
      a = sel:find("a")
      itemURL = "https://www.koblenz.de" .. a:attr("href")
      -- do not prepend schema and host, if not needed
      link = a:attr("href")
      if not(link:match("https*:\/\/.*")) then
        itemURL = "https://www.koblenz.de" .. link
      else
        itemURL = link
      end

      -- retrieve press release document
      doc, err = goquery.newDocFromURL(itemURL)
@@ -34,7 +40,13 @@ selectors:
      print(content)
    link: |-
      a = sel:find("a")
      itemURL = "https://www.koblenz.de" .. a:attr("href")
      -- do not prepend schema and host, if not needed
      link = a:attr("href")
      if not(link:match("https*:\/\/.*")) then
        itemURL = "https://www.koblenz.de" .. link
      else
        itemURL = link
      end
      print(itemURL)
    created: |-
      time = sel:find("time"):first():text()
-- 
2.37.1