making unveil mobile friendlier
This commit is contained in:
parent
24fe4bcc00
commit
7c663a5df1
File diff suppressed because it is too large
Load Diff
@ -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",
|
||||
|
32
plugins/kill_unwanted_images.js
Normal file
32
plugins/kill_unwanted_images.js
Normal 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;
|
||||
};
|
2
tech.js
2
tech.js
@ -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
23
test.js
@ -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/"
|
||||
}
|
||||
]
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user