making unveil mobile friendlier

This commit is contained in:
Martin Donnelly 2016-04-08 10:12:43 +01:00
parent 24fe4bcc00
commit 7c663a5df1
5 changed files with 365 additions and 313 deletions

File diff suppressed because it is too large Load Diff

View File

@ -2,6 +2,7 @@
"name": "Rinser",
"version": "0.1.1",
"devDependencies": {
"cheerio": "^0.20.0",
"del": "^2.2.0",
"ejs": "^2.3.3",
"gulp": "^3.9.1",

View File

@ -0,0 +1,32 @@
var cheerio = require('cheerio');
module.exports = function (item, itemOptions, source) {
// This plugin does no processing
// It's just a template
var $ = cheerio.load(itemOptions.description, {
normalizeWhitespace: true,
xmlMode: true
});
var tdihbody = $(":root");
if (tdihbody.length > 0)
{
try {
tdihbody.find('IMG').each(function (i, elem) {
var s, src = $(this).attr("src");
console.log(src);
});
}
catch (e) {
logger.error(e);
}
}
return itemOptions;
};

View File

@ -20,7 +20,7 @@ feeds.simple_test_feed = {
"description": "Combined Tech Feed",
'site_url': 'http://pipes.silvrtree.co.uk/tech.xml'
},
"plugins": ['filter_3_days', 'fix_images', 'fix_scripts'],
"plugins": ['filter_3_days', 'fix_images', 'fix_scripts', 'kill_unwanted_images'],
"sources": [{
"count": 100,
"feed_url": "http://feeds.feedburner.com/lenovoblogs/designmatters"

23
test.js
View File

@ -1,14 +1,11 @@
var RssBraider = require('rss-braider'),
fs = require('fs'),
ejs = require('ejs'),
read = require('fs').readFileSync,
join = require('path').join,
str = read(join(__dirname, '/templates/rss.ejs'), 'utf8'),
sqlite3 = require('sqlite3').verbose(),
feeds = {};
var db = new sqlite3.Database(__dirname + '/images.db');
var outputFile = 'tech',
RssBraider = require('rss-braider'),
fs = require('fs'),
ejs = require('ejs'),
read = require('fs').readFileSync,
join = require('path').join,
str = read(join(__dirname, '/templates/rss.ejs'), 'utf8'),
feeds = {};
// Pull feeds from config files: ,
// feeds.simple_test_feed = require("./config/feed").feed;
// Or define in-line
@ -22,12 +19,12 @@ feeds.simple_test_feed = {
'site_url':'http://pipes.silvrtree.co.uk/test.xml'
},
"plugins" : ['capitalize_title','filter_last_week'],
"plugins" : ['kill_unwanted_images'],
"sources" : [
{
"count": 5,
"feed_url": "http://feeds.bbci.co.uk/news/uk/rss.xml"
"feed_url": "http://qz.com/feed/"
}
]
};