Added PornCZ.

This commit is contained in:
DebaucheryLibrarian
2020-07-22 04:12:20 +02:00
parent 9d89a38490
commit 46c6c4dd21
125 changed files with 462 additions and 7 deletions

View File

@@ -170,6 +170,28 @@ function date(context, selector, format, match, attr = 'textContent') {
return extractDate(dateString, format, match);
}
function dateAgo(context, selector, match = /(\d+)\s*(\w+)/, attr = 'textContent') {
const timeString = q(context, selector, attr, 'textContent');
if (!timeString) {
return null;
}
const timeMatch = timeString.match(match);
if (timeMatch) {
const [n, period] = timeMatch.slice(1);
const thenDate = moment.utc().subtract(Number(n), period);
return {
date: thenDate.toDate(),
precision: period.replace(/s$/, ''),
};
}
return null;
}
function image(context, selector = 'img', attr, { origin, protocol = 'https' } = {}) {
const imageEl = (attr && q(context, selector, attr))
|| q(context, selector, 'data-src')
@@ -286,6 +308,7 @@ const quFuncs = {
cnt: content,
cnts: contents,
date,
dateAgo,
dur: duration,
duration,
element: q,