contrib/rss_downloader: move tag link to Config
authorAlexis Laferrière <alexis.laf@xymus.net>
Tue, 21 Jul 2015 13:26:42 +0000 (09:26 -0400)
committeralexis laf <xymus@tolkien.info.uqam.ca>
Wed, 29 Jul 2015 17:05:26 +0000 (13:05 -0400)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

contrib/rss_downloader/src/rss_downloader.nit

index 66cd969..3551686 100644 (file)
@@ -52,6 +52,9 @@ class Config
        # XML tag used for pattern recognition
        fun tag_title: String do return "title"
 
+       # XML tag of the link to act upon
+       fun tag_link: String do return "link"
+
        # Action to apply on each selected RSS element
        fun act_on(element: Element)
        do
@@ -265,7 +268,7 @@ redef class Text
                var elements = new Array[Element]
                for item in items do
                        var title = item[tool_config.tag_title].first.as(XMLStartTag).data
-                       var link = item["link"].first.as(XMLStartTag).data
+                       var link = item[tool_config.tag_link].first.as(XMLStartTag).data
 
                        elements.add new Element(title, link)
                end