diff --git a/index.js b/index.js index c00b11a..114f33c 100644 --- a/index.js +++ b/index.js @@ -46,6 +46,8 @@ app.get('/api/feed',function(req,res){ opts.header = true; } } + + opts.boosts = true; if (req.query.boosts){ if (req.query.boosts.toLowerCase() == 'no' || req.query.boosts.toLowerCase() == 'false'){ opts.boosts = false; @@ -53,6 +55,8 @@ app.get('/api/feed',function(req,res){ opts.boosts = true; } } + + opts.replies = true; if (req.query.replies){ if (req.query.replies.toLowerCase() == 'no' || req.query.replies.toLowerCase() == 'false'){ opts.replies = false; diff --git a/lib/convert.js b/lib/convert.js index a9c364c..fe3063d 100644 --- a/lib/convert.js +++ b/lib/convert.js @@ -173,6 +173,14 @@ function buildUp(jsonObj,opts){ item.isReply = true; } + if(item.categories){ + item.hasCw = item.categories.indexOf('nsfw') > -1; + + if(item.hasCw){ + item.cw = item.summary; + } + } + return true; }); diff --git a/lib/template.ejs b/lib/template.ejs index acc4234..3d5cdf6 100644 --- a/lib/template.ejs +++ b/lib/template.ejs @@ -48,34 +48,34 @@ <% if (item.isBoost) { %>
<%- item.title %>
<% } %> -
- - - -
- <%= item.author.displayName %> -
<%= item.author.fullName %>
-
-
-
- <%- item.content %> -
- <% if (item.enclosures.length > 0){ %> -
- <% for (var i = 0; i < item.enclosures.length; i ++){ var e = item.enclosures[i] %> - - <% if (e.type.indexOf('image') > -1){ %> - - <% }else if (e.type.indexOf('video') > -1){ %> - - <% } %> -
- <% } %> -
<%= item.stringDate %>
+
+ + + +
+ <%= item.author.displayName %> +
<%= item.author.fullName %>
+
+
+
+ <%- item.content %> +
+ <% if (item.enclosures.length > 0){ %> +
+ <% for (var i = 0; i < item.enclosures.length; i ++){ var e = item.enclosures[i] %> + + <% if (e.type.indexOf('image') > -1){ %> + + <% }else if (e.type.indexOf('video') > -1){ %> + + <% } %> +
+ <% } %> +
<%= item.stringDate %>
<% }); %>