summaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorYves Fischer <yves.fischer@cern.ch>2016-01-26 11:57:04 +0100
committerYves Fischer <yves.fischer@cern.ch>2016-01-26 11:57:04 +0100
commit9614bfef37e5fcc7f048150480b767f1afbac1a5 (patch)
tree803f06fea6575278f2e7c93220aec324eda2e31e /src/main
parenta413a2db9f83e8afe8342b769445823df770700f (diff)
downloadglocals-classifieds-9614bfef37e5fcc7f048150480b767f1afbac1a5.tar.gz
glocals-classifieds-9614bfef37e5fcc7f048150480b767f1afbac1a5.zip
more fix rss feed
Diffstat (limited to 'src/main')
-rw-r--r--src/main/groovy/org/xapek/yvesf/classifieds/Dumper.groovy6
-rw-r--r--src/main/groovy/org/xapek/yvesf/classifieds/Model.groovy5
2 files changed, 9 insertions, 2 deletions
diff --git a/src/main/groovy/org/xapek/yvesf/classifieds/Dumper.groovy b/src/main/groovy/org/xapek/yvesf/classifieds/Dumper.groovy
index 7d72fbe..623c786 100644
--- a/src/main/groovy/org/xapek/yvesf/classifieds/Dumper.groovy
+++ b/src/main/groovy/org/xapek/yvesf/classifieds/Dumper.groovy
@@ -7,16 +7,18 @@ import org.xapek.yvesf.classifieds.Model.ClassifiedsList
class Dumper {
static dump(ClassifiedsList classifiedList, PrintWriter writer) {
- new MarkupBuilder(writer).rss(version: '2.0') {
+ new MarkupBuilder(writer).rss(version: '2.0', 'xmlns:atom': 'http://www.w3.org/2005/Atom') {
channel {
title('Glocals')
description('glocal classifieds feed')
+ link('https://www.xapek.org/git/yvesf/classifieds')
classifiedList.each { Classified classified ->
item {
title("${classified.type} - ${classified.title} - ${classified.composedLocation}")
guid(classified.link)
link(classified.link)
- author("${classified.mem_name}@noemail.local")
+ pubDate(classified.formattedDate)
+ author("${classified.mem_id}@noemail.local (${classified.mem_name})")
description(getDescription(classified) + classified.description)
}
}
diff --git a/src/main/groovy/org/xapek/yvesf/classifieds/Model.groovy b/src/main/groovy/org/xapek/yvesf/classifieds/Model.groovy
index 35aafdf..b0c9e00 100644
--- a/src/main/groovy/org/xapek/yvesf/classifieds/Model.groovy
+++ b/src/main/groovy/org/xapek/yvesf/classifieds/Model.groovy
@@ -45,7 +45,9 @@ class Model {
String title
String id
String mem_name
+ String mem_id
String description
+ String date
Classified(Map map) {
metaClass.properties.each { MetaProperty property ->
@@ -60,6 +62,9 @@ class Model {
}
}
+ String getFormattedDate() {
+ return Date.parse('MMM dd, yy', date).format('EEE, dd MMM yyyy HH:mm:ss Z')
+ }
String getLink() {
return "http://www.glocals.com/classifieds/housing-and-real-estate/${id}.htm"
}