Skip to content
This repository has been archived by the owner on Aug 13, 2019. It is now read-only.

Commit

Permalink
rss fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sylvinus committed Jun 27, 2012
1 parent 9d7edc2 commit 4c48b2f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ JoshfireFactory.bootstrap({save:true,appid:"4fc877ec5d5e4c3813000004",host:"josh
datasource:ds,
dataquery:query,
layout:dolayout,
host:req.header('host'),
data:data
},baseTplVars));
});
Expand Down
10 changes: 7 additions & 3 deletions tpl/rss.ejs
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0">
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
<%
var channel = [
{ title: {_cdata:options.title}},
{ description: {_cdata:options.title}},
{ link: options.link||""},
{ link: "http://"+host},
{ "atom:link":{_attr:{href:"http://"+host+"/?feed=rss2",rel:"self",type:"application/rss+xml"}}}, //TODO right href!
{ generator: "http://factory.joshfire.com"},
{ lastBuildDate: new Date().toGMTString()}
];
_.each(data.entries,function(entry,i) {
var url = (entry.url || "").replace("http://"+dataquery.filter.url.replace(/\/$/,""),"http://"+host);
channel.push({item:[
{title:entry.name},
{link:entry.url},
{link:url},
{guid:url},
{pubDate: new Date(entry.datePublished).toGMTString()}, //TODO!
{description:{_cdata:entry.articleBody}}
]});
Expand Down

0 comments on commit 4c48b2f

Please sign in to comment.