אונטערשייד צווישן ווערסיעס פון "מעדיעוויקי:Common.js/externalsmaker.js"
קפיצה לניווט
קפיצה לחיפוש
(אפדעיט) |
אין תקציר עריכה |
||
| (40 מיטלסטע ווערסיעס פון 3 באַניצער נישט געוויזן.) | |||
| שורה 1: | שורה 1: | ||
/* This code | /* This code runs in different sites as bookmarklet */ | ||
function wikiit(event, force_popup) { | function wikiit(event, force_popup) { | ||
window.$ = window.jQuery; | window.$ = window.jQuery; | ||
function hasHebrew(text) { | |||
if (typeof text !== 'string') { | |||
return false; | |||
} | |||
return /[\u0590-\u05FF]/.test(text); | |||
} | |||
function dateFormat(dateArr) { | function dateFormat(dateArr) { | ||
if (dateArr instanceof Array) { | if (dateArr instanceof Array) { | ||
var m = ["יאנואר", "פעברואר", "מערץ", "אפריל", "מאי", "יוני", "יולי", " | var m = ["יאנואר", "פעברואר", "מערץ", "אפריל", "מאי", "יוני", "יולי", "אויגוסט", "סעפטעמבער", "אקטאבער", "נאוועמבער", "דעצעמבער"]; | ||
if (dateArr.length != 3) | if (dateArr.length != 3) | ||
| שורה 23: | שורה 28: | ||
return jQuery.trim(dateArr); | return jQuery.trim(dateArr); | ||
} | } | ||
function dateFormatEng(dateArr) { | |||
if (dateArr instanceof Array) { | |||
var m = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]; | |||
if (dateArr.length != 3) | |||
return ''; | |||
dateArr[1] = m[Number(dateArr[1]) - 1]; | |||
if (Number(dateArr[2]) <= 50) | |||
dateArr[2] = 20 + dateArr[2]; | |||
else if (Number(dateArr[2]) >= 50 && Number(dateArr[2]) < 100) | |||
dateArr[2] = 19 + dateArr[2]; | |||
if (dateArr[0].charAt(0) == '0') | |||
dateArr[0] = dateArr[0].substring(1, dateArr[0].length); | |||
dateArr = dateArr[1] + " " + dateArr[0] + ", " + dateArr[2]; | |||
} | |||
return jQuery.trim(dateArr); | |||
} | |||
function engDateParse(engDate) { | function engDateParse(engDate) { | ||
var m = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]; | var m = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]; | ||
| שורה 44: | שורה 68: | ||
.replace(/\s+/gm, ' ')) | .replace(/\s+/gm, ' ')) | ||
.replace(/&[mn]dash;/g, '-') | .replace(/&[mn]dash;/g, '-') | ||
.replace( | .replace(/"/g, '"') | ||
.replace( | .replace(/ /g, ' ') | ||
.replace( | .replace(/״/g, '"') | ||
.replace( | .replace(/׳/g, "'") | ||
.replace(/(\n|\r)/g, ' ') | .replace(/(\n|\r)/g, ' ') | ||
.replace(/=/g, "{{=}}") | .replace(/=/g, "{{=}}") | ||
| שורה 53: | שורה 77: | ||
.replace(/((?<!עיתונות)\|\|?)/gm, function (x) { return "{{" + x.replace(/\|/g, "!") + "}}"; }) | .replace(/((?<!עיתונות)\|\|?)/gm, function (x) { return "{{" + x.replace(/\|/g, "!") + "}}"; }) | ||
.replace(/[\u200B\u200E\u200F\u2028\u202A\u202B\u202C\u202D\u202E]/g, '') // remove invisible Unicode control characters | .replace(/[\u200B\u200E\u200F\u2028\u202A\u202B\u202C\u202D\u202E]/g, '') // remove invisible Unicode control characters | ||
.replace(/ {2,}/g, ' '); | .replace(/ {2,}/g, ' ') | ||
.replace('#google_vignette', ''); | |||
} | } | ||
function getWikiLink() { | function getWikiLink() { | ||
let result = ""; | |||
const oldid = getParameterByName("oldid") || getParameterByName("diff"); | |||
const host = window.location.host; | |||
if (host.startsWith("yi.hamichlol.org.il") && oldid) { | |||
const oldComment = window.prompt("קעפּל פאַר די לינק. קען בלייבן ליידיג.", ""); | |||
result = `{{אונטערשייד צווישן ווערסיעס|${getParameterByName("title")}|${oldid}||${oldComment || "אונטערשייד צווישן ווערסיעס"}}}`; | |||
} else { | |||
const nms = { | |||
"yi.hamichlol.org.il": "", | |||
"www.hamichlol.org.il": "ע:", | |||
"he.wikiquote.org": "q:", | |||
"he.wikisource.org": "s:", | |||
"en.wiktionary.org": "wikt:", | |||
}; | |||
const wikinamespace = document.querySelector(".mw-page-title-namespace"); | |||
const wikiname = document.querySelector(".mw-page-title-main"); | |||
const wikiarticle = wikiname | |||
? wikinamespace | |||
? `${wikinamespace.textContent}:${wikiname.textContent}` | |||
: wikiname.textContent | |||
: null; | |||
const wikitype = nms[host]; | |||
if (wikitype !== undefined && wikiname) { | |||
result = `[[${wikitype}${wikiarticle}${wikitype ? "|" + wikiname.textContent : ""}]]`; | |||
} | |||
} | |||
if (result) { | |||
navigator.clipboard.writeText(result).then(() => { | |||
alert("✅ קאפירט: " + result); | |||
}); | |||
return true; | |||
} | |||
return false; | |||
} | } | ||
if (window.location.host. | if (window.location.host.includes("hamichlol")) { | ||
if (getWikiLink()) { | |||
if (window.old$) { window.$ = window.old$; } | |||
return; | |||
} | |||
} | } | ||
var VE = ' | var VE = ', ', | ||
TODAY = 'היינט', | TODAY = 'היינט', | ||
YESTERDAY = 'נעכטן'; | YESTERDAY = 'נעכטן'; | ||
| שורה 91: | שורה 134: | ||
var data = [ | var data = [ | ||
{ | { | ||
hostname: /yediot(h)?(.ynet)?\.co\.il/, | |||
hostname: /yediot(h)?(.ynet)?\.co\.il/, | |||
params: [ | params: [ | ||
{ str: "ידיעות אחרונות" }, | { str: "ידיעות אחרונות" }, | ||
| שורה 121: | שורה 154: | ||
{ telem: ".text16w", match: /\/(.*?)$/ }, | { telem: ".text16w", match: /\/(.*?)$/ }, | ||
{ telem: ".text16w" }, | { telem: ".text16w" }, | ||
{ telem: ".art_header_footer_author span" | { telem: ".art_header_footer_author span" }, | ||
{ attr: ["meta[property='vr:author']", 'content'], remove: ['מערכת ONE'] } | { attr: ["meta[property='vr:author']", 'content'], remove: ['מערכת ONE'] } | ||
], | ], | ||
[ | [ | ||
{ telem: '.art_header_title' }, | { telem: '.art_header_title' }, | ||
{ attr: ["meta[property='og:title']", "content"] }, | { attr: ["meta[property='og:title']", "content"], remove: [/ - אוכל - ynet.*/] }, | ||
{ elem: 'head>title', match: /(?:ynet\s*-?)?([^\-]*)/ }, | { elem: 'head>title', match: /(?:ynet\s*-?)?([^\-]*)/ }, | ||
{ telem: 'h1' } | { telem: 'h1' }, | ||
{ elem: 'font.leshonit' } | |||
], | ], | ||
[ | [ | ||
{ url: 1, match: /co\.il\/((?:ency|home|headlines)\/.*?html?)/ }, | |||
{ url: 1, match: /L-(.*?),/ }, | { url: 1, match: /L-(.*?),/ }, | ||
{ url: 1, match: /co\.il\/(.*)/ } | { url: 1, match: /co\.il\/(.*)/, remove: ['#autoplay'] } | ||
], | ], | ||
[ | [ | ||
{ url: 1, match: /co\.il\/((?:ency)\/.*?html?)/, prefix: "תאריך=", func: function(s) { return s ? 'ללא' : ''; }}, | |||
{ elem: 'td:has(h1:first) .text12g:last', date: '.' }, | { elem: 'td:has(h1:first) .text12g:last', date: '.' }, | ||
{ elem: ".text12g + .text12g", date: '.' }, | { elem: ".text12g + .text12g", date: '.' }, | ||
| שורה 146: | שורה 182: | ||
}, | }, | ||
{ | { | ||
hostname: /(www| | hostname: /(www|afula|ashdod|batyam|beersheva|emek|hadera|haifa|herzliya|hodhasharon|holon|jerusalem|kfarsaba|kibbutz|krayot|modiin|netania|netanya|petahtikva|raanana|rehovot|rishon|roshhaayin)\.mynet\.co\.il$/i, | ||
params: [ | params: [ | ||
{ str: 'mynet3' }, | { str: 'mynet3' }, | ||
{ | { attr: ["meta[property='channel-name']", "content"], remove: ['MYNET ', 'mynet ', 'מיינט '], func:function(s) { return (s=='עפולה ועמק'||s=='עפולה והעמק')?'העמק':s=='פתח תקוה'?'פתח תקווה':s=='ראשון'?'ראשון לציון':s; } }, | ||
{ | { attr: ["meta[property='vr:author']", "content"], remove: ['מערכת mynet'] }, | ||
{ | { attr: ["meta[property='og:title']", "content"] }, | ||
{ url: 1, match: /article\/(.*)$/ }, | { url: 1, match: /article\/(.*)$/ }, | ||
{ | { attr: ["meta[property='article:published_time']", "content"], date:['-',[2,1,0]] } | ||
] | ] | ||
}, | }, | ||
| שורה 159: | שורה 195: | ||
hostname: /^\w+\.walla\.co\.il$/, | hostname: /^\w+\.walla\.co\.il$/, | ||
params: [ | params: [ | ||
{ str: 'וואלה | { str: 'וואלה' }, | ||
[ | [ | ||
{ telem: 'div.writers-names' }, | { telem: 'div.writers-names' }, | ||
| שורה 165: | שורה 201: | ||
{ telem: '.info .author:first, .provider', match: /^([^\|]*)/ }, | { telem: '.info .author:first, .provider', match: /^([^\|]*)/ }, | ||
{ telem: 'div.wp-0-b:first span:first', match: /מאת:(.*),/ }, | { telem: 'div.wp-0-b:first span:first', match: /מאת:(.*),/ }, | ||
{ telem: '.author > div', match: /^([^\|]*)/ | { telem: '.author > div', match: /^([^\|]*)/ } | ||
], | ], | ||
{ attr: ["meta[property='og:title']", "content"], remove: [ / - וואלה!.*/ ] }, | { attr: ["meta[property='og:title']", "content"], remove: [ / - וואלה!?.*/ ] }, | ||
[ | [ | ||
{ url: 1, match: /item\/(\d+)/ }, | { url: 1, match: /item\/(\d+)/ }, | ||
| שורה 179: | שורה 215: | ||
{ telem: ".w2.txt-w:last", match: /, (\d+ ב.*? \d+),/ } | { telem: ".w2.txt-w:last", match: /, (\d+ ב.*? \d+),/ } | ||
] | ] | ||
] | ], | ||
removeparam: { | |||
'1': [/(מערכת )?וואלה!?[א-ת ]+/] | |||
} | |||
}, | }, | ||
{ | { | ||
hostname: "www.haaretz.co.il", | hostname: "www.haaretz\\.(co\\.il|com)", | ||
params: [ | params: [ | ||
{ str: 'הארץ' }, | { str: 'הארץ' }, | ||
| שורה 188: | שורה 227: | ||
{ var: ['articlePage', 'dimension1'] }, | { var: ['articlePage', 'dimension1'] }, | ||
{ telements: ["header address", VE] }, | { telements: ["header address", VE] }, | ||
{ attr: ["meta[name='author']", "content"] }, | |||
{ telem: 'address > a' }, | { telem: 'address > a' }, | ||
{ attr: [ | { telem: 'main > div > section > div > div > a', remove: [ 'שיתוף בוואטסאפ' ] }, | ||
{ telem: 'address' } | |||
], | |||
[ | |||
{ telem: 'h1#article-header' }, | |||
{ attr: ['meta[property="og:title"]', 'content'] } | |||
], | ], | ||
{ url: 1, match: /([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})/, addParam: 'gift' }, | { url: 1, match: /([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})/, addParam: 'gift' }, | ||
[ | [ | ||
{ telem: "header time", date: '.' }, | { telem: "header time", date: '.' }, | ||
{ telem: 'time', date: '.' }, | { telem: 'time', date: '.' }, | ||
{ telem: 'time', remove: [ /\d\d\:\d\d\, / ], removeDatePadding: true } | { telem: 'time', remove: [/\d\d\:\d\d\, /, /\d{1,2}:\d\d [apmAPM]{2} [a-zA-Z]{3}/], removeDatePadding: true } | ||
] | ] | ||
] | ] | ||
| שורה 224: | שורה 269: | ||
{ attr: ["meta[property='og:title']", "content"] } | { attr: ["meta[property='og:title']", "content"] } | ||
], | ], | ||
{ url: 1, match: /(\d+)/ }, | [ | ||
{ url: 1, match: /org\.il\/(.*p-\d{4,}.*)/ }, | |||
{ url: 1, match: /(\d+)/ } | |||
], | |||
[ | [ | ||
{ telem: '.story_autor_date' }, | { telem: '.story_autor_date' }, | ||
| שורה 232: | שורה 280: | ||
], | ], | ||
{ url: 1, match: /org\.il\/(.+?)\// } | { url: 1, match: /org\.il\/(.+?)\// } | ||
] | |||
}, | |||
{ | |||
hostname: "archive.kan.org.il", | |||
params: [ | |||
{ str: 'כאן ארכיון' }, | |||
{ attr: ["meta[property='og:title']", "content"], remove: ['כאן ארכיון |'] }, | |||
{ url: 1, match: /(\d+)/ }, | |||
{ telem: 'span.itemPageDate', remove: ['תאריך שידור:'], date: '.' } | |||
] | ] | ||
}, | }, | ||
| שורה 292: | שורה 349: | ||
{ str: 'ערוץ7' }, | { str: 'ערוץ7' }, | ||
[ | [ | ||
{ telem: '.article-credit--author' | { telem: '.article-credit--author' }, | ||
{ telem: '.article-info--author' | { telem: '.article-info--author' } | ||
], | ], | ||
{ telem: 'h1.article-title' }, | { telem: 'h1.article-title' }, | ||
| שורה 300: | שורה 357: | ||
{ telem: '.article-date-gregorian', date: '.' }, | { telem: '.article-date-gregorian', date: '.' }, | ||
{ telem: '.article-date-gregorian-date', date: '.' } | { telem: '.article-date-gregorian-date', date: '.' } | ||
] | ], | ||
] | { url: 1, match: /.*(flashes).*/ } | ||
], | |||
removeparam: { | |||
'1': ['ערוץ 7'] // needed because of the space | |||
} | |||
}, | }, | ||
{ | { | ||
| שורה 311: | שורה 372: | ||
{ ldjson: { key:'author' } } | { ldjson: { key:'author' } } | ||
], | ], | ||
{ elem: '#F_Title, .mainArticletitle' }, | [ | ||
{ elem: '#F_Title, .mainArticletitle' }, | |||
{ telem: 'h1.project_title' } | |||
], | |||
{ url: 1, match: /=(\d+)/ }, | { url: 1, match: /=(\d+)/ }, | ||
[ | [ | ||
{ elem: '.articleInfo .timestamp, #coteret_Modified, #F_Modified_on, .g_Article_DateTime', date: '/' }, | { elem: '.articleInfo .timestamp, #coteret_Modified, #F_Modified_on, .g_Article_DateTime', date: '/' }, | ||
{ attr: ["meta[name='article_created']", "content"], date: '/' }, | { attr: ["meta[name='article_created']", "content"], date: '/' }, | ||
{ telem: '.articleInfo .timestamp', date: '.'} | { telem: '.articleInfo .timestamp', date: '.'}, | ||
{ telem: 'span.project_date', date: '.'} | |||
] | ] | ||
] | ] | ||
| שורה 334: | שורה 399: | ||
params: [ | params: [ | ||
{ str: 'בחדרי חרדים' }, | { str: 'בחדרי חרדים' }, | ||
{ | { ldjson: { key:'author' }, remove: [ /,? ?(כתב )?בחדרי חרדים/ ] }, | ||
{ | { attr: ["meta[property='og:title']", "content"], remove:[' - בחדרי חרדים'] }, | ||
[ | [ | ||
{ url: 1, match: /news\/(\d+)/ }, | { url: 1, match: /news\/(\d+)/ }, | ||
{ var: 'userid' } | { var: 'userid' } | ||
], | ], | ||
{ | { ldjson: { key:'datePublished' } } | ||
] | |||
}, | |||
{ | |||
hostname: "www.kore.co.il", | |||
params: [ | |||
{ str: 'כל רגע' }, | |||
{ ldjson: { key:'author' } }, | |||
{ attr: ["meta[property='og:title']", "content"], remove:[' - כל רגע'] }, | |||
[ | |||
{ url: 1, match: /viewArticle\/(\d+)/ }, | |||
{ var: 'userid' } | |||
], | |||
{ ldjson: { key:'datePublished' } } | |||
] | ] | ||
}, | }, | ||
{ | { | ||
hostname: "www. | hostname: "www.c14.co.il", | ||
params: [ | params: [ | ||
{ str: 'עכשיו 14' }, | { str: 'עכשיו 14' }, | ||
{ telem: ' | [ // הימור, אין מקור טוב אחר (opt 1 + opt 2) | ||
{ telem: ' | { telem: "a[href^='/author/'] p" }, // opt 1 | ||
{ url: 1, match: / | { attr: [ 'main > section > article > div:nth-of-type(3) > div > div > div > img', 'alt' ] } // opt 2 | ||
{ | ], | ||
{ telem: 'h1' }, | |||
{ url: 1, match: /article\/(\d+)/ }, | |||
{ attr: ["meta[name='article:published_time']", "content"], date:['-',[2,1,0]] } | |||
], | |||
removeparam: { | |||
'1': [ /מערכת.*/, 'דסק החדשות C14' ] | |||
} | |||
}, | }, | ||
{ | { | ||
| שורה 374: | שורה 458: | ||
}, | }, | ||
{ | { | ||
hostname: "www.makorrishon.co.il", condition: function () { return location.pathname.startsWith('/nrg/'); }, minimum: 7, | |||
hostname: "www.makorrishon.co.il", condition: function () { return | |||
params: [ | params: [ | ||
{ str: 'nrg' }, | { str: 'nrg' }, | ||
[ | [ | ||
{ elem: "#articleCBar span:first, .cdat.small.bold, .articleBar h4:first, .jeg_meta_author a", match:/<!-- ARTICLE_WRITER_START -->(.*)<!-- ARTICLE_WRITER_END -->/ }, | { elem: "#articleCBar span:first, .cdat.small.bold, .articleBar h4:first, .jeg_meta_author a", match:/<!-- ARTICLE_WRITER_START -->(.*)<!-- ARTICLE_WRITER_END -->/ }, | ||
{ telem: "#articleCBar span:first, .cdat.small.bold, .articleBar h4:first, .jeg_meta_author a" } | { telem: "#articleCBar span:first, .cdat.small.bold, .articleBar h4:first, .jeg_meta_author a" }, | ||
{ telem: '.newsVitzCredit > sprint' } | |||
], | ], | ||
[ | [ | ||
{ var: 'titleName'}, | { var: 'titleName'}, | ||
{ elem: 'h1', match: [/<!-- ARTICLE_TITLE_START --> (.*?)<!-- ARTICLE_TITLE_END -->/, /(.*?) \|/] } | { elem: 'h1', match: [/<!-- ARTICLE_TITLE_START --> (.*?)<!-- ARTICLE_TITLE_END -->/, /(.*?) \|/] }, | ||
{ elem: '#titleS1' } | |||
], | ], | ||
[ | [ | ||
| שורה 415: | שורה 478: | ||
{ elem: "#articleCBar span:first, .articleBar h4:first", date: '/' }, | { elem: "#articleCBar span:first, .articleBar h4:first", date: '/' }, | ||
{ telem: ".jeg_meta_date", date: '-' }, | { telem: ".jeg_meta_date", date: '-' }, | ||
{ elem: "#articleCBar span:first, .cdat.small.bold, .articleBar h4:first, .jeg_meta_author a", match:/<!-- ARTICLE_DATE_START -->(.*)<!-- ARTICLE_DATE_END -->/, date: '/'} | { elem: "#articleCBar span:first, .cdat.small.bold, .articleBar h4:first, .jeg_meta_author a", match:/<!-- ARTICLE_DATE_START -->(.*)<!-- ARTICLE_DATE_END -->/, date: '/'}, | ||
{ telem: '.newsVitzCredit:nth-of-type(2)', date: '/' } | |||
], | ], | ||
[ | [ | ||
| שורה 428: | שורה 492: | ||
params: [ | params: [ | ||
{ str: 'מקור ראשון' }, | { str: 'מקור ראשון' }, | ||
{ | { ldjson: { key:'author'}, remove: [/(:?כתב|מערכת)? מקור ראשון/] }, | ||
{ telem: "h1:first" }, | { telem: "h1:first" }, | ||
{ url:1, match: /makorrishon\.co\.il\/(.*?)\/?$/ }, | { url:1, match: /makorrishon\.co\.il\/(.*?)\/?$/ }, | ||
] | ] | ||
}, | }, | ||
| שורה 461: | שורה 501: | ||
params: [ | params: [ | ||
{ str: 'one' }, | { str: 'one' }, | ||
{ elem: ".article-credit > a", match: /^.*$/gm, remove: ["מאת | { elem: ".article-credit > a", match: /^.*$/gm, remove: ["מאת ", "</a>"] }, | ||
{ telem: "h1, #_ctl0_Main_ucFullArticle_lblCaption, #_ctl0_Main_ucFullArticle_lbColCaption" }, | { telem: "h1, #_ctl0_Main_ucFullArticle_lblCaption, #_ctl0_Main_ucFullArticle_lbColCaption" }, | ||
{ url: 1, match: [/Article\/\d\d\-\d\d\/\d,\d+,\d+,\d+\/(\d+)/i, /Article\/(\d+)/i, /id=(\d+)/] }, | { url: 1, match: [/Article\/\d\d\-\d\d\/\d,\d+,\d+,\d+\/(\d+)/i, /Article\/(\d+)/i, /id=(\d+)/] }, | ||
| שורה 473: | שורה 513: | ||
[ | [ | ||
{ telem: ".normal14 .normal, .content li.taxonomy-term-reference-0, .views-field-name .field-content" }, | { telem: ".normal14 .normal, .content li.taxonomy-term-reference-0, .views-field-name .field-content" }, | ||
{ ldjson: { key:'author' } } | { ldjson: { key:'author'} } | ||
], | ], | ||
[ | [ | ||
| שורה 485: | שורה 525: | ||
{ elem: '.time', date: '.' } | { elem: '.time', date: '.' } | ||
] | ] | ||
] | ], | ||
removeparam: { | |||
'1': [/(:?כתבי|מערכת) [א-ת]+ היום/] | |||
} | |||
}, | }, | ||
{ | { | ||
| שורה 515: | שורה 558: | ||
{ str: 'TheMarker' }, | { str: 'TheMarker' }, | ||
[ | [ | ||
{ telements: [".prsnlArticleEnvelope .autorBarAnchor, .prsnlArticleEnvelope .autorBarWriters", VE | { telements: [".prsnlArticleEnvelope .autorBarAnchor, .prsnlArticleEnvelope .autorBarWriters", VE] }, | ||
{ attr: ['meta[name="author"]', "content"] }, | { attr: ['meta[name="author"]', "content"] }, | ||
{ telem: "a.author-bar li:eq(2), .h3_author" | { telem: "a.author-bar li:eq(2), .h3_author" }, | ||
{ telem: "div.art__info address" }, | { telem: "div.art__info address" }, | ||
{ var: ["_sf_async_config","authors"] } | { var: ["_sf_async_config","authors"] } | ||
], | ], | ||
[ { var: ['articlePage', 'name'] }, | [ { var: ['articlePage', 'name'] }, | ||
{ telem: "header > h1" }, | |||
{ telem: "header > div > h1" }, | |||
{ attr: ['meta[property="og:title"]', 'content'] }, | { attr: ['meta[property="og:title"]', 'content'] }, | ||
{ telem: "h1.h-mb--xxtight, h1.mainTitle" }, | { telem: "h1.h-mb--xxtight, h1.mainTitle" }, | ||
| שורה 530: | שורה 575: | ||
{ attr: ["meta[property='article:published']", "content"], date:['-',[2,1,0]] }, | { attr: ["meta[property='article:published']", "content"], date:['-',[2,1,0]] }, | ||
{ telem: ".author-bar li:eq(1), .h3_date, div.art__info time", date: '.' }, | { telem: ".author-bar li:eq(1), .h3_date, div.art__info time", date: '.' }, | ||
{ telem: ".inner_bar", date:'/'} | { telem: ".inner_bar", date:'/'}, | ||
{ url: 1, match: /\.com.*\/(\d{4}-\d{2}-\d{2})\/.*/, date:['-',[2,1,0]] }, | |||
{ telem: 'time', remove: [ /\d\d\:\d\d\, / ], removeDatePadding: true } | |||
], | ], | ||
{ url: 1, match: /\/\/(.*?).themarker/i, defvalue: "www" } | { url: 1, match: /\/\/(.*?).themarker/i, defvalue: "www" } | ||
] | ], | ||
removeparam: { | |||
'1': ["מאת:"] | |||
} | |||
}, | }, | ||
{ | { | ||
| שורה 541: | שורה 591: | ||
[ | [ | ||
{ telem: ".shahor.art-author" }, | { telem: ".shahor.art-author" }, | ||
{ telem: ".calcalistArticleHeader_footer .authors" } | { telem: ".calcalistArticleHeader_footer .authors" }, | ||
{ telem: "span.authorArticle" } | |||
], | ], | ||
{ | { attr: ['meta[property="og:title"]', 'content'], remove: [' | כלכליסט'] }, | ||
[ | [ | ||
{ url: 1, match: /L\-(\d+)/ }, { attr: ["link[rel='alternate']", "href"], match: /guid=(\d+)/}, | { url: 1, match: /L\-(\d+)/ }, { attr: ["link[rel='alternate']", "href"], match: /guid=(\d+)/}, | ||
{ url: 1, match: /calcalist\.co\.il\/( | { url: 1, match: /calcalist\.co\.il\/(.*)/ } | ||
], | ], | ||
[ | [ | ||
{ telem: ".art-publish-date.afor > .l-date:last", date: '.' }, | { telem: ".art-publish-date.afor > .l-date:last", date: '.' }, | ||
{ telem: ".calcalistArticleHeader_footer .date", date: '.'} | { telem: ".calcalistArticleHeader_footer .date", date: '.'}, | ||
{ telem: "span.art-publish-date", date: '.'} | |||
] | ] | ||
] | ] | ||
| שורה 570: | שורה 622: | ||
params: [ | params: [ | ||
{ str: 'NFC' }, | { str: 'NFC' }, | ||
{ telem: "# | { telem: "#titleTop > table a", remove: ["מחלקה ראשונה"] }, | ||
{ | { attr: ['meta[property="og:title"]', 'content'] }, | ||
{ url: 1, match: /ve\/(.*?)\.html/ }, | { url: 1, match: /ve\/(.*?)\.html/ }, | ||
{ telem: "#ctl00_ContentMain_UcArticle1_lblCreateDate", date: '/' } | { telem: "#ctl00_ContentMain_UcArticle1_lblCreateDate", date: '/' } | ||
| שורה 623: | שורה 675: | ||
params: [ | params: [ | ||
{ str: 'British Pathe' }, | { str: 'British Pathe' }, | ||
{ telem: " | [ | ||
{ telem: ".searchTermVal", func: function(val) { return 'סרטוני חדשות על ' + val; }, remove: [/"/g] }, | |||
{ telem: " | { attr: ["meta[property='og:title']", "content"] } | ||
] | ], | ||
[ | |||
{ telem: ".searchTermVal", remove: [/"/g] }, | |||
{ url: 1, match: /britishpathe\.com\/.*?(\d+)\// } | |||
] | |||
] | |||
}, | }, | ||
{ | { | ||
| שורה 632: | שורה 689: | ||
params: [ | params: [ | ||
{ str: 'אתר צה"ל' }, | { str: 'אתר צה"ל' }, | ||
{ telem: ".article | { telem: ".author-article", remove: [ /,?\s*?מערכת (את"צ|אתר צה"ל|צה"ל)/ ] }, | ||
{ telem: "h1" }, | { telem: "h1" }, | ||
[ | [ | ||
{ telem: ".article- | { attr: ["body", "data-uid"] }, | ||
{ url: 'decodeURI', match: /idf\.il\/(.*)$/ } | |||
], | |||
{ telem: ".rating-article > .rating-item", date: '.' } | |||
] | |||
}, | |||
{ | |||
hostname: "maarachot.idf.il", | |||
params: [ | |||
{ str: 'מערכות1' }, | |||
{ telem: "p.author > a" }, | |||
{ attr: ["meta[property='og:title']", "content"] }, | |||
{ url: 'decodeURI', match: /idf\.il\/.*\/מערכות-([\d-]+)\//, func: function (val) { return val ? val : '0'; } }, | |||
{ url: 1, match: /idf\.il\/(\d{4})\// }, | |||
{ url: 'decodeURI', match: /idf\.il\/.*\/(?:מערכות-[\d-]+)?(.*)\//, func: function (val) { return (document.querySelector("meta[property='og:title']").content.replace(/ /g, '-').replace(/[?"'\(\)]/g, '') == val) ? '' : val; } } | |||
] | ] | ||
}, | }, | ||
| שורה 647: | שורה 714: | ||
{ str: 'כיכר השבת' }, | { str: 'כיכר השבת' }, | ||
{ attr: ["meta[name='author']", "content"] }, | { attr: ["meta[name='author']", "content"] }, | ||
{ | { attr: ["meta[property='og:title']", "content"] }, | ||
[ | [ | ||
{ url: 1, match: /il\/.*?\/(\d*)/ }, | { url: 1, match: /il\/.*?\/(\d*)/ }, | ||
{ url: 1, match: /il\/(.*)/ } | { url: 1, match: /il\/(.*)/ } | ||
], | ], | ||
{ attr: ["meta[ | { attr: ["meta[property='article:published_time']", "content"], date:['-', '210'] } | ||
] | ] | ||
}, | }, | ||
| שורה 659: | שורה 726: | ||
params: [ | params: [ | ||
{ str: 'כיפה' }, | { str: 'כיפה' }, | ||
{ telem: "author", remove: [ | { telem: "author", remove: [", כיפה"] }, | ||
{ telem: "h1" }, | { telem: "h1" }, | ||
{ url: 1, match: /co\.il\/(.+)/ }, | { url: 1, match: /co\.il\/(.+)/ }, | ||
| שורה 717: | שורה 784: | ||
], | ], | ||
{ urlparam: 'pgnum', prefix: 'page=' } | { urlparam: 'pgnum', prefix: 'page=' } | ||
] | |||
}, | |||
{ | |||
hostname: "www.izkor.gov.il", | |||
params: [ | |||
{ str: 'יזכור' }, | |||
{ url: 1, match: /gov\.il\/(.*)/, func: function (val) { return val.replace(/%20/, '%2520'); } }, | |||
{ url: 1, match: /gov\.il\/(.*?)\// } | |||
] | ] | ||
}, | }, | ||
| שורה 726: | שורה 801: | ||
{ telem: "title", remove: "HBreader - " }, | { telem: "title", remove: "HBreader - " }, | ||
{ urlparam: 'sfid' }, | { urlparam: 'sfid' }, | ||
{prefix: ' | {prefix: 'page=', url: 1, match:/p\=(\d+)/i, remove: "contents not available אין תוכן העניינים"}, | ||
] | ] | ||
}, | }, | ||
| שורה 771: | שורה 846: | ||
{ urlparam: "id" }, | { urlparam: "id" }, | ||
{ telem: "#themag" } | { telem: "#themag" } | ||
] | |||
}, | |||
{ | |||
hostname: 'www.nli.org.il', hrefmatch: /newspapers\/bamahane/, // it's own thing and not part of the larger nli | |||
params: [ | |||
{ str: 'במחנה' }, | |||
{ str: '', func: function (str) { return window.prompt("שם מחבר", str!='N/A'?str:''); } }, | |||
{ str: '', func: function (str) { return window.prompt("כותרת הדף", str); } }, // $('.pageblockselected').attr('title') | |||
{ url: 1, match: /newspapers\/bamahane\/(\d{4}\/\d{2}\/\d{2})\// }, | |||
{ url: 1, match: /page\/(\d+)/ } | |||
] | ] | ||
}, | }, | ||
| שורה 794: | שורה 879: | ||
'ahj': 'החרות ירושלים', | 'ahj': 'החרות ירושלים', | ||
'ahr': 'על המשמר', | 'ahr': 'על המשמר', | ||
'ajns': 'עיתונות|ajns', | |||
'ashnav': 'אשנב', | 'ashnav': 'אשנב', | ||
'baderech': 'עיתונות|baderech', | |||
'bamar': 'במערכה', | 'bamar': 'במערכה', | ||
'bustenai': 'עיתונות|bustenai', | |||
'dav': 'דבר', | 'dav': 'דבר', | ||
'dhy': 'דואר היום', | 'dhy': 'דואר היום', | ||
'diedeborah' :'עיתונות|diedeborah', | |||
'dmt': 'מאמענט', | 'dmt': 'מאמענט', | ||
'dnajlb': 'עיתונות|dnajlb', | |||
'emda': 'עמדה', | 'emda': 'עמדה', | ||
'eretzh': 'עיתונות|eretzh', | |||
'etger': 'עיתונות|etger', | |||
'frw': 'פארווערטס', | 'frw': 'פארווערטס', | ||
'haa': 'המאסף', | 'haa': 'המאסף', | ||
| שורה 807: | שורה 899: | ||
'hadt': 'האחדות', | 'hadt': 'האחדות', | ||
'haibri': 'העברי', | 'haibri': 'העברי', | ||
'hairtlv': 'העיר', | |||
'ham': 'העם', | 'ham': 'העם', | ||
'haolam': 'העולם', | 'haolam': 'העולם', | ||
| שורה 812: | שורה 905: | ||
'has': 'השומר הצעיר ורשה', | 'has': 'השומר הצעיר ורשה', | ||
'haschiloah': 'השילוח1', | 'haschiloah': 'השילוח1', | ||
'haumaisr': 'האומה1', | |||
'hayal': 'לחייל', | 'hayal': 'לחייל', | ||
'hayomisr': 'עיתונות|hayomisr', | |||
'hayomw': 'היום וורשה', | 'hayomw': 'היום וורשה', | ||
'hazit': 'החזית', | 'hazit': 'החזית', | ||
'hbkr': 'הבקר', | 'hbkr': 'הבקר', | ||
'hcl': 'הכרמל', | 'hcl': 'הכרמל', | ||
'heatid': 'עיתונות|heatid', | |||
'hebrew': 'שרהזאהן', | 'hebrew': 'שרהזאהן', | ||
'hed': 'הד המזרח', | 'hed': 'הד המזרח', | ||
'hegeh': 'עיתונות|hegeh', | |||
'hhr': 'הפועל הצעיר', | 'hhr': 'הפועל הצעיר', | ||
'hlb': 'הלבנון', | 'hlb': 'הלבנון', | ||
| שורה 846: | שורה 943: | ||
'ktuvim': 'כתובים', | 'ktuvim': 'כתובים', | ||
'lbf': 'לעבנס-פראגן', | 'lbf': 'לעבנס-פראגן', | ||
'lehiton': 'להיטון', | |||
'lmrv': 'למרחב', | 'lmrv': 'למרחב', | ||
'ltb': 'ליטערארישע בלעטער', | 'ltb': 'ליטערארישע בלעטער', | ||
'mad': 'מחזיקי הדת', | 'mad': 'מחזיקי הדת', | ||
'mahanayim': 'מחניים', | |||
'mar': 'מעריב', | 'mar': 'מעריב', | ||
'mgd': 'המגיד', | 'mgd': 'המגיד', | ||
'mrh': 'מוריה', | 'mrh': 'מוריה', | ||
'mzp': 'המצפה', | 'mzp': 'המצפה', | ||
'newpalestine' :'עיתונות|newpalestine', | |||
'omer': 'אמר', | 'omer': 'אמר', | ||
'pisgoh': 'הפסגה', | 'pisgoh': 'הפסגה', | ||
'plb' :'עיתונות|plb', | |||
'pls': 'PalPost', | |||
'shar': 'שערים', | 'shar': 'שערים', | ||
'sulm': 'סלם', | 'sulm': 'סלם', | ||
| שורה 860: | שורה 962: | ||
'yomyom': 'יוםיום', | 'yomyom': 'יוםיום', | ||
'ytlv': 'ידיעות תל אביב', | 'ytlv': 'ידיעות תל אביב', | ||
'zim': 'עיתונות|zim', | |||
'zmanim': 'זמנים' | 'zmanim': 'זמנים' | ||
}[s.toLowerCase()]; } } | }[s.toLowerCase()]; } } | ||
| שורה 867: | שורה 970: | ||
{ var: 'canonical_url', match: /newspapers\/\w+\/(\d+\/\d+\/\d+)\//, remove: '///'}, | { var: 'canonical_url', match: /newspapers\/\w+\/(\d+\/\d+\/\d+)\//, remove: '///'}, | ||
{ var: 'canonical_url', match: /article\/(\d+\.?\d*)(\/|$)/ } | { var: 'canonical_url', match: /article\/(\d+\.?\d*)(\/|$)/ } | ||
] | |||
}, | |||
{ | |||
hostname: "blog.nli.org.il", | |||
params: [ | |||
{ str: 'הספרנים' }, | |||
{ var: ['nliLayersActiveItem', 'data_order'], func: function(itemid) { return document.querySelector('.article-items > article:nth-of-type(' + itemid + ') .entry-meta span:nth-of-type(1)').textContent; } }, | |||
{ var: ['nliLayersActiveItem', 'data_order'], func: function(itemid) { return document.querySelector('.article-items > article:nth-of-type(' + itemid + ') .entry-title').textContent; } }, | |||
{ var: ['nliLayersActiveItem', 'data_url'], remove: [ /^\//, /\/$/ ] }, | |||
{ var: ['nliLayersActiveItem', 'data_order'], func: function(itemid) { return document.querySelector('.article-items > article:nth-of-type(' + itemid + ') .entry-meta span:nth-of-type(2)').textContent; }, date: '.' } | |||
] | ] | ||
}, | }, | ||
| שורה 873: | שורה 986: | ||
params: [ | params: [ | ||
{ str: 'אנשים ומחשבים' }, | { str: 'אנשים ומחשבים' }, | ||
{ | { attr: ["meta[name='author']", "content"] }, | ||
[ | [ | ||
{ telem: ".post_header > h2:nth-child(2)" }, | { telem: ".post_header > h2:nth-child(2)" }, | ||
| שורה 963: | שורה 1,076: | ||
}, | }, | ||
{ | { | ||
hostname: " | hostname: "ch10.co.il", | ||
params: [ | params: [ | ||
{ str: 'חרדים10' }, | { str: 'חרדים10' }, | ||
{ | { attr: ['meta[name="author"]', 'content'], remove: ['חרדים 10'] }, | ||
{ | { attr: ['meta[property="og:title"]', 'content'] }, | ||
{ url: 1, match: /news\/(\d+)/ }, | { url: 1, match: /news\/(\d+)/ }, | ||
{ | { attr: ['meta[property="article:published_time"]', 'content'], date: ['-', '210'] } | ||
] | ] | ||
}, | }, | ||
| שורה 986: | שורה 1,099: | ||
{ str: 'מעריב אונליין' }, | { str: 'מעריב אונליין' }, | ||
[ | [ | ||
{ telem: 'span.article-reporter a' | { ldjson: { key: 'author' } }, | ||
{ telem: 'span.article-reporter a' }, | |||
{ telem: 'a[rel=Author]' }, | { telem: 'a[rel=Author]' }, | ||
{ telem: '.article-date-report-wrap', match: /^.*\|(.*)$/m }, | { telem: '.article-date-report-wrap', match: /^.*\|(.*)$/m }, | ||
{ telem: 'span.article-reporter', | { telem: 'span.article-reporter' }, | ||
], | ], | ||
[ | [ | ||
| שורה 999: | שורה 1,113: | ||
{ telem: '.article-date-time, .article-he-date', date: '/' }, | { telem: '.article-date-time, .article-he-date', date: '/' }, | ||
{ telem: '.article-date-report-wrap', date: '/' }, | { telem: '.article-date-report-wrap', date: '/' }, | ||
{ telem: '.article-publish-date', date: '/' } | { telem: '.article-publish-date', date: '/' }, | ||
{ telem: 'div.tmi-article-reporter-date', date: '/'}, // tmi articles | |||
{ telem: 'time.tmi-article-info-date-time', date: '/'}, // tmi articles | |||
{ telem: 'time.blog-publish-date', date: '/'} // blogs | |||
] | ] | ||
] | ] | ||
| שורה 1,014: | שורה 1,131: | ||
}, | }, | ||
{ | { | ||
hostname: "davidson. | hostname: "davidson.org.il", | ||
params: [ | params: [ | ||
{ str: ' | { str: 'דוידסון1' }, | ||
{ | { attr: ['meta[name="twitter:data1"]', 'content'] }, | ||
{ attr: ['meta[property="og:title"]', 'content'] }, | { attr: ['meta[property="og:title"]', 'content'], remove: [' | מגזין | מכון דוידסון'] }, | ||
{ url: 1, match: / | { url: 1, match: /org\.il\/read-experience\/(.*)$/ }, | ||
{ | { telem: 'div.date', func: function (val) { var x = val.split(' '); x[1] = 'ב' + x[1]; return x.join(' '); } } | ||
] | ] | ||
}, | }, | ||
{ | { | ||
| שורה 1,040: | שורה 1,157: | ||
params: [ | params: [ | ||
{ str: 'אתר הגבורה' }, | { str: 'אתר הגבורה' }, | ||
{ attr: ['input[name=hdaid]', 'value'] }, | |||
{ attr: ['input[name=hdaid]', 'value'] } | { telem: 'h1' } | ||
] | ] | ||
}, | }, | ||
| שורה 1,051: | שורה 1,168: | ||
{ telem: 'h1' }, | { telem: 'h1' }, | ||
{ url: 1, match: /\.srugim\.co\.il\/(.*)$/ }, | { url: 1, match: /\.srugim\.co\.il\/(.*)$/ }, | ||
{ telem: '.post_details', date: '.' } | [ | ||
{ attr: ["meta[property='article:published_time']", "content"], date:['-',[2,1,0]] }, | |||
{ telem: '.post_details', date: '.' } | |||
] | |||
] | ] | ||
}, | }, | ||
| שורה 1,105: | שורה 1,225: | ||
{ var: ['detail_data', 'YEAR'] } | { var: ['detail_data', 'YEAR'] } | ||
], | ], | ||
{ str: '' }, | |||
[ | [ | ||
{ attr: ["ab", "value"], match: /^([^ ]*) /, prefix: 'page=' }, | { attr: ["ab", "value"], match: /^([^ ]*) /, prefix: 'page=' }, | ||
| שורה 1,118: | שורה 1,239: | ||
{ str: 'דבר העובדים' }, | { str: 'דבר העובדים' }, | ||
[ | [ | ||
{ attr: ['section', 'data-author_name | { attr: ['section', 'data-author_name'] }, | ||
{ attr: ['article', 'data-author_name | { attr: ['article', 'data-author_name'] } | ||
], | ], | ||
[ | [ | ||
| שורה 1,125: | שורה 1,246: | ||
{ telem: '.g-article-headline'} | { telem: '.g-article-headline'} | ||
], | ], | ||
{ url: 1, match: /www\.davar1\.co\.il\/(\d+)/ }, | { url: 1, match: /www\.davar1\.co\.il(?:\/.*)?\/(\d+)/ }, | ||
[ | [ | ||
{ attr: ['meta[itemprop="dateCreated"]', 'content'], date: '.' }, | { attr: ['meta[itemprop="dateCreated"]', 'content'], date: '.' }, | ||
{ telem: '.g-article-date', date: '.' } | { telem: '.g-article-date', date: '.' } | ||
] | ] | ||
] | ], | ||
removeparam: { | |||
'1': [ 'דבר ראשון' ] // old name in old articles | |||
} | |||
}, | }, | ||
{ | { | ||
| שורה 1,137: | שורה 1,261: | ||
{ str: "יוטיוב" }, | { str: "יוטיוב" }, | ||
{ urlparam: "v" }, | { urlparam: "v" }, | ||
{ telem: " | { telem: "player-microformat-renderer", func: function (str) { return JSON.parse(str).name; }, prefix: "שם=" }, | ||
{ telem: " | { telem: "player-microformat-renderer", func: function (str) { var dur = JSON.parse(str).duration.slice(2, -1), time = new Date(dur * 1000).toISOString(); return dur < 3600 ? time.substr(14, 5) : time.substr(11, 8); }, prefix: "לענג=" }, | ||
{ telem: " | { telem: "player-microformat-renderer", func: function (str) { return JSON.parse(str).author; }, prefix: "ערוץ=" } | ||
] | ] | ||
}, | }, | ||
| שורה 1,218: | שורה 1,342: | ||
{ str: "פס\"ד עליון" } | { str: "פס\"ד עליון" } | ||
], | ], | ||
{ prefix:'קישור=', urlparam: 'fileName'}, | [ | ||
{ prefix:'קישור=', urlparam: 'path', func: function(s) { return !s.indexOf('NetVerdicts') ? s.replace('NetVerdicts/', '') : false; } }, | |||
{ prefix:'קישור=', urlparam: 'fileName'} | |||
], | |||
{ prefix:'קובץ=', url: 1, func: function(s) { return s.indexOf('NetVerdicts') > -1 ? getParameterByName('fileName') : ''; }, removeifempty: true }, | |||
{ prefix:'סוג=', var: 'all_text', match: /([^\s]+?)[\s]+\d+\/\d+/m}, | { prefix:'סוג=', var: 'all_text', match: /([^\s]+?)[\s]+\d+\/\d+/m}, | ||
[ | [ | ||
| שורה 1,269: | שורה 1,397: | ||
params:[ | params:[ | ||
{ str: "JDN"}, | { str: "JDN"}, | ||
{ telem: "span.elementor-post-info__item--type-author" | { telem: "span.elementor-post-info__item--type-author" }, | ||
{ telem: "h1.elementor-heading-title" }, | { telem: "h1.elementor-heading-title" }, | ||
{ url: 1, match: /\/(\d+)\// }, | { url: 1, match: /\/(\d+)\// }, | ||
{ | { attr: ['meta[property="article:published_time"]', 'content'], date: ['-', '210'] } | ||
] | ] | ||
}, | }, | ||
| שורה 1,305: | שורה 1,433: | ||
params: [ | params: [ | ||
{ str: 'יובל אראל'}, | { str: 'יובל אראל'}, | ||
{ telem: 'a.author-name' | { telem: 'a.author-name' }, | ||
{ telem: 'h1.post-title ' }, | { telem: 'h1.post-title ' }, | ||
{ url: 1, match: /com\/(.*)/ } | { url: 1, match: /com\/(.*)/ } | ||
| שורה 1,315: | שורה 1,443: | ||
{ str: 'גיקטיים'}, | { str: 'גיקטיים'}, | ||
[ | [ | ||
{ telem: 'p.post-meta > a' | { telem: 'p.post-meta > a' }, | ||
{ telem: 'section.post-content > p > strong' | { telem: 'section.post-content > p > strong' }, | ||
{ telem: '.author' | { telem: '.author' } | ||
], | ], | ||
| שורה 1,329: | שורה 1,457: | ||
{ telem: '.date', date: '.' } | { telem: '.date', date: '.' } | ||
], | ], | ||
] | ], | ||
removeparam: { | |||
'1': [ 'כתב אורח', /מאת:? / ] | |||
} | |||
}, | }, | ||
{ | { | ||
| שורה 1,390: | שורה 1,521: | ||
{ str: 'עונג שבת'}, | { str: 'עונג שבת'}, | ||
[ | [ | ||
{ telem: 'div.post-body > div > span' | { telem: 'div.post-body > div > span' }, | ||
{ telem: 'div.post-body > div > b' | { telem: 'div.post-body > div > b' }, | ||
{ telem: 'div.post-body > div > strong' | { telem: 'div.post-body > div > strong' } | ||
], | ], | ||
{ telem: 'h3.post-title' }, | { telem: 'h3.post-title' }, | ||
| שורה 1,398: | שורה 1,529: | ||
{ url: 1, match: /blog-post_(\d+).html/ }, | { url: 1, match: /blog-post_(\d+).html/ }, | ||
{ telem: 'h2.date-header', remove: [ /.*, / ] } | { telem: 'h2.date-header', remove: [ /.*, / ] } | ||
] | ], | ||
removeparam: { | |||
'1': ['מאת', 'כתב וצילם', 'כתב'] | |||
} | |||
}, | }, | ||
{ | { | ||
hostname: "anumuseum.org.il", | hostname: "dbs.anumuseum.org.il", | ||
params: [ | params: [ | ||
{ str: 'אנו – מוזיאון העם היהודי'}, | { str: 'אנו – מוזיאון העם היהודי'}, | ||
| שורה 1,420: | שורה 1,554: | ||
{ str: 'גיידסטאר'}, | { str: 'גיידסטאר'}, | ||
{ url: 1, match: /il\/organization\/(\d+)/ }, | { url: 1, match: /il\/organization\/(\d+)/ }, | ||
{ | { elem: 'title', remove: [' | גיידסטאר - אתר התאגידים של ישראל | משרד המשפטים' ] } | ||
] | ] | ||
}, | }, | ||
| שורה 1,461: | שורה 1,595: | ||
{ url: 1, match: /tidhar\/view\/(\d+)\/.+/ }, | { url: 1, match: /tidhar\/view\/(\d+)\/.+/ }, | ||
{ url: 1, match: /tidhar\/view\/\d+\/(\d+)/ } | { url: 1, match: /tidhar\/view\/\d+\/(\d+)/ } | ||
] | |||
}, | |||
{ | |||
hostname: "zman.co.il", | |||
params: [ | |||
{ str: 'זמן ישראל' }, | |||
{ ldjson: { key: 'author' } }, | |||
{ telem: "h1.headline" }, | |||
{ url: 1, match: /co\.il\/(\d+)/, dirty: true }, | |||
{ ldjson: { key: 'datePublished' } } | |||
] | |||
}, | |||
{ | |||
hostname: "wikirefua.org.il", | |||
params: [ | |||
{ str: 'ויקירפואה' }, | |||
{ telem: "h1.firstHeading" }, | |||
{ telem: "h1.firstHeading", func: function(data) { var match = data.match(/ - [A-Za-z].*/); return match ? data.replace(match[0], '') : false; } } | |||
] | ] | ||
}, | }, | ||
| שורה 1,472: | שורה 1,624: | ||
{ attr: ["meta[name='citation_journal_title']", "content"] }, | { attr: ["meta[name='citation_journal_title']", "content"] }, | ||
{ attr: ["meta[name='citation_publication_date']", "content"] } | { attr: ["meta[name='citation_publication_date']", "content"] } | ||
] | |||
}, | |||
{ | |||
hostname: "i24news.tv", | |||
params: [ | |||
{ str: 'i24' }, | |||
{ telem: ".signature-link > a", remove: ['i24NEWS'] }, | |||
{ attr: ["meta[property='og:title']", "content"], remove: [' - i24NEWS'] }, | |||
{ url: 1, match: /i24news\.tv\/(.*)/ }, | |||
[ | |||
{ attr: ["meta[property='pubdate']", "content"], date:['-',[2,1,0]], func: function(val) { return window.location.pathname.indexOf('/he/') == 0 ? val : ''; } }, | |||
{ telem: ".common-information-wrapper > span > time ", func: function(val) { if (val) { var arr = val.split(' '); return [arr[0], arr[1], arr[2]].join(' '); } return ''; } } | |||
] | |||
] | ] | ||
} | } | ||
| שורה 1,489: | שורה 1,654: | ||
for (var k=0; k < data[i].params[j].length; k++) { | for (var k=0; k < data[i].params[j].length; k++) { | ||
try { | try { | ||
var curParam = data[i].params[j][k]; | var curParam = data[i].params[j][k], | ||
removed = false; params[j] = ''; | |||
if (typeof curParam.str != "undefined") { | if (typeof curParam.str != "undefined") { | ||
| שורה 1,496: | שורה 1,661: | ||
} else if (typeof curParam.ldjson != "undefined") { | } else if (typeof curParam.ldjson != "undefined") { | ||
var ldjson = null; | var ldjson = null; | ||
var ldjsons = $('script[type="application/ld+json"]').map(function(i,e) { return JSON.parse($(e).text()); }); | var ldjsons = $('script[type="application/ld+json"]').map(function(i,e) { try { return JSON.parse($(e).text().replace(/[\t\n\r]/g, ' ')); } catch (e) { return false; } }); | ||
if (typeof curParam.ldjson.n != "undefined") { | if (typeof curParam.ldjson.n != "undefined") { | ||
ldjson = ldjsons[curParam.ldjson.n]; | ldjson = ldjsons[curParam.ldjson.n]; | ||
| שורה 1,523: | שורה 1,688: | ||
params[j] = ldjson; | params[j] = ldjson; | ||
for (var t=0; t < curParam.ldjson.raw.length; t++) { | for (var t=0; t < curParam.ldjson.raw.length; t++) { | ||
params[j] = params[j][curParam.ldjson.raw[t]]; | params[j] = params[j][curParam.ldjson.raw[t]]; | ||
} | } | ||
| שורה 1,648: | שורה 1,812: | ||
console.error(e); | console.error(e); | ||
} | } | ||
params[j] = cleanText(params[j]); | !curParam.dirty && (params[j] = cleanText(params[j])); | ||
} else if (jQuery.isArray(params[j])) { | } else if (jQuery.isArray(params[j])) { | ||
params[j] = jQuery.trim(params[j].join("|")); | params[j] = jQuery.trim(params[j].join("|")); | ||
| שורה 1,660: | שורה 1,824: | ||
if (typeof curParam.shouldnt != "undefined" && typeof params[j] == "string" && params[j].match(curParam.shouldnt)) | if (typeof curParam.shouldnt != "undefined" && typeof params[j] == "string" && params[j].match(curParam.shouldnt)) | ||
params[j] = ''; | params[j] = ''; | ||
if (typeof curParam.removeifempty != "undefined" && !params[j]) | |||
params[j] = 'removeifempty'; | |||
if (data[i].removeparam) { | |||
if (data[i].removeparam[j]) { | |||
for (var r = 0; r < data[i].removeparam[j].length; ++r) { | |||
var currName = params[j]; | |||
params[j] = params[j].replace(data[i].removeparam[j][r], ''); | |||
if (currName != params[j]) { | |||
removed = true; | |||
} | |||
} | |||
} | |||
} | |||
// if the author is the same as the template, remove it | |||
if (j == 1 && params[0] && params[1]) { | |||
if ((params[1] == params[0]) || ((params[1].split(' ').length-1 <= params[0].split(' ').length) && params[1].toLowerCase().indexOf(params[0].toLowerCase()) > -1)) { | |||
params[1] = ''; | |||
removed = true; | |||
} | |||
} | |||
if ((params[j] != '') && (params[j] != undefined)) { | if ((params[j] != '') && (params[j] != undefined)) { | ||
console.log('found', j, params[j]); | console.log('found', j, params[j]); | ||
break; | break; | ||
} else if (removed) { | |||
console.log('not used', j, curParam); | |||
} else { | |||
console.log('not found', j, curParam); | |||
} | } | ||
} | } | ||
catch (e) { | catch (e) { | ||
| שורה 1,677: | שורה 1,867: | ||
while (params[params.length - 1] == "" && params.length > minimum) //remove all last empty params | while (params[params.length - 1] == "" && params.length > minimum) //remove all last empty params | ||
params.pop(); | params.pop(); | ||
// remove removeifempty child | |||
while (params.indexOf('removeifempty') > -1) | |||
params.splice(params.indexOf('removeifempty'), 1); | |||
if (window.popup_template_canceled && !force_popup) { | if (window.popup_template_canceled && !force_popup) { | ||
| שורה 1,685: | שורה 1,879: | ||
if (prompt("דרוקן OK וועט קאפּירן דעם מוסטער:", result) != null) { | if (prompt("דרוקן OK וועט קאפּירן דעם מוסטער:", result) != null) { | ||
$('<input>').val(result).appendTo('body').select();document.execCommand('copy'); | var temp_raw = $("<input>"); | ||
$("body").append(temp_raw); | |||
temp_raw.val(result); | |||
temp_raw.select(); | |||
document.execCommand("copy"); | |||
temp_raw.remove(); | |||
//$('<input>').val(result).appendTo('body').select();document.execCommand('copy'); | |||
} | } | ||
window.popup_template_canceled = false; | window.popup_template_canceled = false; | ||
| שורה 1,711: | שורה 1,911: | ||
if (isNaN(date)) { | if (isNaN(date)) { | ||
date = new Date(ldojson.publisher.datePublished); | date = new Date(ldojson.publisher.datePublished); | ||
} | |||
var שרייבער = $.map($(ldojson.author), function(a) { return a.name; }).join(VE); | |||
var קעפל = ldojson.name || ldojson.headline; | |||
var זייטל = (ldojson.publisher||ldojson_website[0]).name; | |||
var hebrewFound = hasHebrew(שרייבער) || hasHebrew(קעפל) || hasHebrew(זייטל); | |||
var dateFormatter = hebrewFound ? dateFormat : dateFormatEng; | |||
var formattedDate = ''; | |||
if (date != "Invalid Date") { | |||
var dateParts = [''+date.getDate(), ''+(date.getMonth()+1), ''+date.getFullYear()]; | |||
formattedDate = dateFormatter(dateParts); | |||
} | } | ||
var general = { | var general = { | ||
'שרייבער': שרייבער, | |||
'קעפל': קעפל, | |||
'אדרעס': location.href, | |||
'זייטל': זייטל, | |||
'דאטום': formattedDate, | |||
}; | }; | ||
console.log('data', general); | console.log('data', general); | ||
var gresult = '{{ | var gresult = '{{לינק|'+$.map(general, function(v,k) { | ||
return k + '=' + cleanText(jQuery.trim(decodeURIComponent($('<a />').html(v).text()))); | return k + '=' + cleanText(jQuery.trim(decodeURIComponent($('<a />').html(v).text()))); | ||
}).join('|') + '}}'; | }).join('|') + '}}'; | ||
if (window.addWikiNote) gresult = '{{הערה|' + gresult + '}}'; | |||
if (prompt("דרוקן OK וועט קאפּירן דעם מוסטער:", gresult) != null) { | if (prompt("דרוקן OK וועט קאפּירן דעם מוסטער:", gresult) != null) { | ||
$('<input>').val(gresult).appendTo('body').select();document.execCommand('copy'); | $('<input>').val(gresult).appendTo('body').select();document.execCommand('copy'); | ||
| שורה 1,745: | שורה 1,957: | ||
} | } | ||
var s = document.createElement('script'); | var s = document.createElement('script'); | ||
s.setAttribute('src', "https:// | s.setAttribute('src', "https://yi.hamichlol.org.il/w/load.php?modules=jquery&only=scripts"); | ||
s.onload = wikiit; | s.onload = wikiit; | ||
document.getElementsByTagName('body')[0].appendChild(s); | document.getElementsByTagName('body')[0].appendChild(s); | ||
יעצטיגע רעוויזיע זינט 22:54, 7 סעפטעמבער 2025
/* This code runs in different sites as bookmarklet */
function wikiit(event, force_popup) {
window.$ = window.jQuery;
function hasHebrew(text) {
if (typeof text !== 'string') {
return false;
}
return /[\u0590-\u05FF]/.test(text);
}
function dateFormat(dateArr) {
if (dateArr instanceof Array) {
var m = ["יאנואר", "פעברואר", "מערץ", "אפריל", "מאי", "יוני", "יולי", "אויגוסט", "סעפטעמבער", "אקטאבער", "נאוועמבער", "דעצעמבער"];
if (dateArr.length != 3)
return '';
dateArr[1] = m[Number(dateArr[1]) - 1];
if (Number(dateArr[2]) <= 50)
dateArr[2] = 20 + dateArr[2];
else if (Number(dateArr[2]) >= 50 && Number(dateArr[2]) < 100)
dateArr[2] = 19 + dateArr[2];
if (dateArr[0].charAt(0) == '0')
dateArr[0] = dateArr[0].substring(1, dateArr[0].length);
dateArr = dateArr[1] + " " + dateArr[0] + ", " + dateArr[2];
}
return jQuery.trim(dateArr);
}
function dateFormatEng(dateArr) {
if (dateArr instanceof Array) {
var m = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
if (dateArr.length != 3)
return '';
dateArr[1] = m[Number(dateArr[1]) - 1];
if (Number(dateArr[2]) <= 50)
dateArr[2] = 20 + dateArr[2];
else if (Number(dateArr[2]) >= 50 && Number(dateArr[2]) < 100)
dateArr[2] = 19 + dateArr[2];
if (dateArr[0].charAt(0) == '0')
dateArr[0] = dateArr[0].substring(1, dateArr[0].length);
dateArr = dateArr[1] + " " + dateArr[0] + ", " + dateArr[2];
}
return jQuery.trim(dateArr);
}
function engDateParse(engDate) {
var m = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
engDate = engDate.match(/(\w+) (\d+), (\d+)/);
return [engDate[2], (m.indexOf(engDate[1]) + 1), engDate[3]];
}
function match(str, expr) { str = str ? str.match(expr) : str; return (str && str.length > 1) ? str[1] : ''; }
function getParameterByName(name) {
/* http://james.padolsey.com/javascript/bujs-1-getparameterbyname/ */
var match = RegExp('[?&]' + name + '=([^&]*)')
.exec(window.location.search);
return match && decodeURIComponent(match[1].replace(/\+/gi, ' '));
}
function cleanText(text) {
return text
.replace(/ |\u202B-\u202d/gm, " "
.replace(/\s+/gm, ' '))
.replace(/&[mn]dash;/g, '-')
.replace(/"/g, '"')
.replace(/ /g, ' ')
.replace(/״/g, '"')
.replace(/׳/g, "'")
.replace(/(\n|\r)/g, ' ')
.replace(/=/g, "{{=}}")
.replace(/''/g, '"')
.replace(/((?<!עיתונות)\|\|?)/gm, function (x) { return "{{" + x.replace(/\|/g, "!") + "}}"; })
.replace(/[\u200B\u200E\u200F\u2028\u202A\u202B\u202C\u202D\u202E]/g, '') // remove invisible Unicode control characters
.replace(/ {2,}/g, ' ')
.replace('#google_vignette', '');
}
function getWikiLink() {
let result = "";
const oldid = getParameterByName("oldid") || getParameterByName("diff");
const host = window.location.host;
if (host.startsWith("yi.hamichlol.org.il") && oldid) {
const oldComment = window.prompt("קעפּל פאַר די לינק. קען בלייבן ליידיג.", "");
result = `{{אונטערשייד צווישן ווערסיעס|${getParameterByName("title")}|${oldid}||${oldComment || "אונטערשייד צווישן ווערסיעס"}}}`;
} else {
const nms = {
"yi.hamichlol.org.il": "",
"www.hamichlol.org.il": "ע:",
"he.wikiquote.org": "q:",
"he.wikisource.org": "s:",
"en.wiktionary.org": "wikt:",
};
const wikinamespace = document.querySelector(".mw-page-title-namespace");
const wikiname = document.querySelector(".mw-page-title-main");
const wikiarticle = wikiname
? wikinamespace
? `${wikinamespace.textContent}:${wikiname.textContent}`
: wikiname.textContent
: null;
const wikitype = nms[host];
if (wikitype !== undefined && wikiname) {
result = `[[${wikitype}${wikiarticle}${wikitype ? "|" + wikiname.textContent : ""}]]`;
}
}
if (result) {
navigator.clipboard.writeText(result).then(() => {
alert("✅ קאפירט: " + result);
});
return true;
}
return false;
}
if (window.location.host.includes("hamichlol")) {
if (getWikiLink()) {
if (window.old$) { window.$ = window.old$; }
return;
}
}
var VE = ', ',
TODAY = 'היינט',
YESTERDAY = 'נעכטן';
var data = [
{
hostname: /yediot(h)?(.ynet)?\.co\.il/,
params: [
{ str: "ידיעות אחרונות" },
{ telem: ".ya-author-additional" },
{ telem: ".ahya-title" },
{ var: "dcContentID" },
{ telem: ".ahya-date", date: '.' }
]
},
{
hostname: /www\.ynet\.co\.il/, minimum: 4,
params: [
{ str: 'ynet' },
[
{ elements: ['.authorHtmlCss', VE] },
{ telem: 'td:has(h1:first) .text14:first', match: /^(.{0,100})$/ },
{ elem: 'font.text14 span p:last', match: /^\((.*?)\)$/ },
{ telem: "style+span a[href^='http://www.ynet.co.il/tags/']" }, // for ynet bug
{ telem: ".text16w", match: /\/(.*?)$/ },
{ telem: ".text16w" },
{ telem: ".art_header_footer_author span" },
{ attr: ["meta[property='vr:author']", 'content'], remove: ['מערכת ONE'] }
],
[
{ telem: '.art_header_title' },
{ attr: ["meta[property='og:title']", "content"], remove: [/ - אוכל - ynet.*/] },
{ elem: 'head>title', match: /(?:ynet\s*-?)?([^\-]*)/ },
{ telem: 'h1' },
{ elem: 'font.leshonit' }
],
[
{ url: 1, match: /co\.il\/((?:ency|home|headlines)\/.*?html?)/ },
{ url: 1, match: /L-(.*?),/ },
{ url: 1, match: /co\.il\/(.*)/, remove: ['#autoplay'] }
],
[
{ url: 1, match: /co\.il\/((?:ency)\/.*?html?)/, prefix: "תאריך=", func: function(s) { return s ? 'ללא' : ''; }},
{ elem: 'td:has(h1:first) .text12g:last', date: '.' },
{ elem: ".text12g + .text12g", date: '.' },
{ elem: ".art_header_footer_author:last", date: '.' },
{ elem: ".ArticleHeaderComponent .date", date: '.'},
{ elem: ".authoranddate .date", date: '.'},
{ elem: ".authoranddate .date", stringDate: true, func: function(s) { return !s || s.indexOf('אתמול') > -1 ? YESTERDAY : TODAY; } }, // contains "אתמול" for yesterday, nothing for today
{ elem: ".date", date: '.' }
]
]
},
{
hostname: /(www|afula|ashdod|batyam|beersheva|emek|hadera|haifa|herzliya|hodhasharon|holon|jerusalem|kfarsaba|kibbutz|krayot|modiin|netania|netanya|petahtikva|raanana|rehovot|rishon|roshhaayin)\.mynet\.co\.il$/i,
params: [
{ str: 'mynet3' },
{ attr: ["meta[property='channel-name']", "content"], remove: ['MYNET ', 'mynet ', 'מיינט '], func:function(s) { return (s=='עפולה ועמק'||s=='עפולה והעמק')?'העמק':s=='פתח תקוה'?'פתח תקווה':s=='ראשון'?'ראשון לציון':s; } },
{ attr: ["meta[property='vr:author']", "content"], remove: ['מערכת mynet'] },
{ attr: ["meta[property='og:title']", "content"] },
{ url: 1, match: /article\/(.*)$/ },
{ attr: ["meta[property='article:published_time']", "content"], date:['-',[2,1,0]] }
]
},
{
hostname: /^\w+\.walla\.co\.il$/,
params: [
{ str: 'וואלה' },
[
{ telem: 'div.writers-names' },
{ telem: 'div.author' },
{ telem: '.info .author:first, .provider', match: /^([^\|]*)/ },
{ telem: 'div.wp-0-b:first span:first', match: /מאת:(.*),/ },
{ telem: '.author > div', match: /^([^\|]*)/ }
],
{ attr: ["meta[property='og:title']", "content"], remove: [ / - וואלה!?.*/ ] },
[
{ url: 1, match: /item\/(\d+)/ },
{ url: 1, match: /w=\/\d*\/(\d+)/ },
{ url: 1, match: /break\/(\d+)/ }
],
[
{ ldjson: { key: 'datePublished' } },
{ telem: '.info .date:first', match: /, (\d+ ב.*? \d+),/ },
{ elem: ["h1", "parent", "children", "eq,2"], match: /,(.*),/, shouldnt: "online_presence" },
{ telem: ".w2.txt-w:last", match: /, (\d+ ב.*? \d+),/ }
]
],
removeparam: {
'1': [/(מערכת )?וואלה!?[א-ת ]+/]
}
},
{
hostname: "www.haaretz\\.(co\\.il|com)",
params: [
{ str: 'הארץ' },
[
{ var: ['articlePage', 'dimension1'] },
{ telements: ["header address", VE] },
{ attr: ["meta[name='author']", "content"] },
{ telem: 'address > a' },
{ telem: 'main > div > section > div > div > a', remove: [ 'שיתוף בוואטסאפ' ] },
{ telem: 'address' }
],
[
{ telem: 'h1#article-header' },
{ attr: ['meta[property="og:title"]', 'content'] }
],
{ url: 1, match: /([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})/, addParam: 'gift' },
[
{ telem: "header time", date: '.' },
{ telem: 'time', date: '.' },
{ telem: 'time', remove: [/\d\d\:\d\d\, /, /\d{1,2}:\d\d [apmAPM]{2} [a-zA-Z]{3}/], removeDatePadding: true }
]
]
},
{
hostname: "www.ice.co.il",
params: [
{ str: 'אייס' },
{ telem: '#article-container div.credit span:first a', remove: ['מערכת ice'] },
{ telem: '#article-container div.col-lg-12 h1' },
{ url: 1, match: /article\/(\d+)/ },
{ telem: '#article-container div.credit time span:first', date: '/' }
]
},
{
hostname: "www.kan.org.il",
params: [
{ str: 'כאן' },
[
{ telem: '.story_autor_name' },
{ telem: '#progBrodcaster'},
{ telem: '.name'}
],
[
{ telem: '.story_title' },
{ telem: '#progName'},
{ attr: ["meta[property='og:title']", "content"] }
],
[
{ url: 1, match: /org\.il\/(.*p-\d{4,}.*)/ },
{ url: 1, match: /(\d+)/ }
],
[
{ telem: '.story_autor_date' },
{ telem: '.player_time', date: '.' },
{ attr: ["div[class='date date-local']", "data-date-utc"], date: '.' },
{ attr: ["*[class='date-local']", "data-date-utc"], date: '.' }
],
{ url: 1, match: /org\.il\/(.+?)\// }
]
},
{
hostname: "archive.kan.org.il",
params: [
{ str: 'כאן ארכיון' },
{ attr: ["meta[property='og:title']", "content"], remove: ['כאן ארכיון |'] },
{ url: 1, match: /(\d+)/ },
{ telem: 'span.itemPageDate', remove: ['תאריך שידור:'], date: '.' }
]
},
{
hostname: "13news.co.il", hrefmatch: /10news\//i,
params: [
{ str: 'ערוץ עשר' },
{ telem: 'li:contains("כתבים: ") + li' },
{ telem: 'h1' },
{ url: 1, match: /\/(\d+)$/ },
{ telem: 'li:contains("פורסם ב: ") + li', date: '/' },
{ url: 1, match: /\/([^\/]*?)\/\d+$/, defvalue: 'news' }
]
},
{
hostname: "13news.co.il", hrefmatch: /ntr\-/i,
params: [
{ str: 'נענע10' },
{ telem: '#author-and-date > ul', remove: ['חדשות nana10']},
{ telem: '#article-title' },
{ url: 1, match: /il\/.*\/ntr-(\d+)/ },
{ telem: '.time-updated', date: '.' }
]
},
{
hostname: "(13news.co.il|13tv.co.il)",
params: [
{ str: 'חדשות 13' },
{ ldjson: { key: 'author' } },
[
{ telem: 'h1#article-title' },
{ telem: 'h1' }
],
[
{ url: 1, match: /il\/(.*?)\/$/ },
{ attr:['meta[property="og:url"]', 'content'], match:/il\/(.*?)\/$/}
],
[
{ ldjson: { key: 'datePublished' } },
{ telem: 'li:contains("פורסם ב: ") + li', date: '/' }
],
[
{ url: 1, match: /\/([^\/]*?)\/\d+$/, defvalue: 'news' }
]
]
},
{
hostname: "mida.org.il",
params: [
{ str: 'מידה' },
{ telem: '.author', prefix: "כותב=" },
{ telem: '.entry-title', prefix: "כותרת=" },
{ elem: 'body', prefix: "מספר כתבה=", match: /post-(\d+)/ },
{ telem: '.published', prefix: "תאריך=", date: '/' }
]
},
{
hostname: "www.inn.co.il",
params: [
{ str: 'ערוץ7' },
[
{ telem: '.article-credit--author' },
{ telem: '.article-info--author' }
],
{ telem: 'h1.article-title' },
{ url: 1, match: /^.*\/(.*)$/ },
[
{ telem: '.article-date-gregorian', date: '.' },
{ telem: '.article-date-gregorian-date', date: '.' }
],
{ url: 1, match: /.*(flashes).*/ }
],
removeparam: {
'1': ['ערוץ 7'] // needed because of the space
}
},
{
hostname: "www.globes.co.il",
params: [
{ str: 'גלובס' },
[
{ attr: ["meta[property='article:author']", "content"] },
{ ldjson: { key:'author' } }
],
[
{ elem: '#F_Title, .mainArticletitle' },
{ telem: 'h1.project_title' }
],
{ url: 1, match: /=(\d+)/ },
[
{ elem: '.articleInfo .timestamp, #coteret_Modified, #F_Modified_on, .g_Article_DateTime', date: '/' },
{ attr: ["meta[name='article_created']", "content"], date: '/' },
{ telem: '.articleInfo .timestamp', date: '.'},
{ telem: 'span.project_date', date: '.'}
]
]
},
{
hostname: "www.the7eye.org.il",
params: [
{ str: 'העין השביעית' },
{ telem: "article a[rel='tag'], article a[href*='/writer/']" },
{ telem: "h1.headline" },
{ url: 1, match: /\/www\.the7eye\.org\.il\/(\d+)/ },
{ telem: "article span.date", date: '.' }
]
},
{
hostname: "www.bhol.co.il",
params: [
{ str: 'בחדרי חרדים' },
{ ldjson: { key:'author' }, remove: [ /,? ?(כתב )?בחדרי חרדים/ ] },
{ attr: ["meta[property='og:title']", "content"], remove:[' - בחדרי חרדים'] },
[
{ url: 1, match: /news\/(\d+)/ },
{ var: 'userid' }
],
{ ldjson: { key:'datePublished' } }
]
},
{
hostname: "www.kore.co.il",
params: [
{ str: 'כל רגע' },
{ ldjson: { key:'author' } },
{ attr: ["meta[property='og:title']", "content"], remove:[' - כל רגע'] },
[
{ url: 1, match: /viewArticle\/(\d+)/ },
{ var: 'userid' }
],
{ ldjson: { key:'datePublished' } }
]
},
{
hostname: "www.c14.co.il",
params: [
{ str: 'עכשיו 14' },
[ // הימור, אין מקור טוב אחר (opt 1 + opt 2)
{ telem: "a[href^='/author/'] p" }, // opt 1
{ attr: [ 'main > section > article > div:nth-of-type(3) > div > div > div > img', 'alt' ] } // opt 2
],
{ telem: 'h1' },
{ url: 1, match: /article\/(\d+)/ },
{ attr: ["meta[name='article:published_time']", "content"], date:['-',[2,1,0]] }
],
removeparam: {
'1': [ /מערכת.*/, 'דסק החדשות C14' ]
}
},
{
hostname: "iaf.org.il",
params: [
{ str: 'אתר חיל האוויר' },
[
{ telem: '#ctl00_headerCPH_uc_newStyleHeader_divOuther' },
{ telem: '.credits_line > .line' }
],
[
{ telem: '#ctl00_ContentPlaceHolder1_general_h2Title' },
{ telem: '.inner_bit_page_text_holder > h2' },
{ attr: ["meta[name='og:title']", "content"] }
],
{ url: 1, match: /(\d+-\d+)-/ },
[
{ telem: '#ctl00_headerCPH_uc_newStyleHeader_publishDate', date: '.' },
{ telem: '.curr_issue_title > ._date', date: '/' }
]
]
},
{
hostname: "www.makorrishon.co.il", condition: function () { return location.pathname.startsWith('/nrg/'); }, minimum: 7,
params: [
{ str: 'nrg' },
[
{ elem: "#articleCBar span:first, .cdat.small.bold, .articleBar h4:first, .jeg_meta_author a", match:/<!-- ARTICLE_WRITER_START -->(.*)<!-- ARTICLE_WRITER_END -->/ },
{ telem: "#articleCBar span:first, .cdat.small.bold, .articleBar h4:first, .jeg_meta_author a" },
{ telem: '.newsVitzCredit > sprint' }
],
[
{ var: 'titleName'},
{ elem: 'h1', match: [/<!-- ARTICLE_TITLE_START --> (.*?)<!-- ARTICLE_TITLE_END -->/, /(.*?) \|/] },
{ elem: '#titleS1' }
],
[
{ url: 1, match: /(\d+\/\d+)\.html/ },
{ url: 1, match: /\/(\d+)\/$/ }
],
[
{ elem: "#articleCBar span:first, .articleBar h4:first", date: '/' },
{ telem: ".jeg_meta_date", date: '-' },
{ elem: "#articleCBar span:first, .cdat.small.bold, .articleBar h4:first, .jeg_meta_author a", match:/<!-- ARTICLE_DATE_START -->(.*)<!-- ARTICLE_DATE_END -->/, date: '/'},
{ telem: '.newsVitzCredit:nth-of-type(2)', date: '/' }
],
[
{ url: 1, match: /online\/(.*?)\/ART/ },
{ url: 1, match: /il\/(.*?)\/\d+\/$/ }
],
{ url: 1, match: /ART(\d+)/ }
]
},
{
hostname: "www.makorrishon.co.il", condition: function () { return !location.pathname.startsWith('/nrg/'); }, minimum: 3,
params: [
{ str: 'מקור ראשון' },
{ ldjson: { key:'author'}, remove: [/(:?כתב|מערכת)? מקור ראשון/] },
{ telem: "h1:first" },
{ url:1, match: /makorrishon\.co\.il\/(.*?)\/?$/ },
]
},
{
hostname: "www.one.co.il",
params: [
{ str: 'one' },
{ elem: ".article-credit > a", match: /^.*$/gm, remove: ["מאת ", "</a>"] },
{ telem: "h1, #_ctl0_Main_ucFullArticle_lblCaption, #_ctl0_Main_ucFullArticle_lbColCaption" },
{ url: 1, match: [/Article\/\d\d\-\d\d\/\d,\d+,\d+,\d+\/(\d+)/i, /Article\/(\d+)/i, /id=(\d+)/] },
{ elem: ".article-credit > time", date: '/' }
]
},
{
hostname: "www.israelhayom.co.il",
params: [
{ str: 'ישראל היום' },
[
{ telem: ".normal14 .normal, .content li.taxonomy-term-reference-0, .views-field-name .field-content" },
{ ldjson: { key:'author'} }
],
[
{ attr: ['meta[property="og:title"]', 'content'], remove:[' | ישראל היום'] },
{ telem: ".pane-title" }
],
{ url: 1, match: /israelhayom.co.il\/(.*)$/ },
[
{ ldjson: { raw: ['publisher', 'datePublished'] }, date:['-', '210'] },
{ elem: '.single-post-meta-dates > time', date: '/' },
{ elem: '.time', date: '.' }
]
],
removeparam: {
'1': [/(:?כתבי|מערכת) [א-ת]+ היום/]
}
},
{
hostname: "www.mako.co.il",
params: [
{ str: 'mako' },
[
{ elements: ['.writerData *:visible:first a', VE], shouldnt: /\d+\/\d+\/\d+/ },
{ telem: 'span.katav', match: /^(.*?),?\s?$/ },
{ attr:['span[itemprop=author]', 'content'] }
],
[
{ telem: '.panel-pane.pane-node-content .pane-title'},
{ telem: ".article.clearer h1" },
{ telem: "h1" }
],
{ url: 1, match: /Article-(.*?).htm/ },
{ url: 1, match: /www\.mako\.co\.il\/(.*?)\/Article/ },
[
{ elem: ".writerData *:last", date: '/' },
{ elem: "span.displayDate", date: '/' },
{ attr: ["meta[property='article:published_time']", "content"], date:['-',[2,1,0]] }
]
]
},
{
hostname: /^\w+\.themarker\.com$/i,
params: [
{ str: 'TheMarker' },
[
{ telements: [".prsnlArticleEnvelope .autorBarAnchor, .prsnlArticleEnvelope .autorBarWriters", VE] },
{ attr: ['meta[name="author"]', "content"] },
{ telem: "a.author-bar li:eq(2), .h3_author" },
{ telem: "div.art__info address" },
{ var: ["_sf_async_config","authors"] }
],
[ { var: ['articlePage', 'name'] },
{ telem: "header > h1" },
{ telem: "header > div > h1" },
{ attr: ['meta[property="og:title"]', 'content'] },
{ telem: "h1.h-mb--xxtight, h1.mainTitle" },
{ telem: "h2" }
],
{ url: 1, match: /^.*\/(.+?)\/?$/ },
[
{ attr: ["meta[property='article:published']", "content"], date:['-',[2,1,0]] },
{ telem: ".author-bar li:eq(1), .h3_date, div.art__info time", date: '.' },
{ telem: ".inner_bar", date:'/'},
{ url: 1, match: /\.com.*\/(\d{4}-\d{2}-\d{2})\/.*/, date:['-',[2,1,0]] },
{ telem: 'time', remove: [ /\d\d\:\d\d\, / ], removeDatePadding: true }
],
{ url: 1, match: /\/\/(.*?).themarker/i, defvalue: "www" }
],
removeparam: {
'1': ["מאת:"]
}
},
{
hostname: "www.calcalist.co.il", minimum: 5,
params: [
{ str: 'כלכליסט' },
[
{ telem: ".shahor.art-author" },
{ telem: ".calcalistArticleHeader_footer .authors" },
{ telem: "span.authorArticle" }
],
{ attr: ['meta[property="og:title"]', 'content'], remove: [' | כלכליסט'] },
[
{ url: 1, match: /L\-(\d+)/ }, { attr: ["link[rel='alternate']", "href"], match: /guid=(\d+)/},
{ url: 1, match: /calcalist\.co\.il\/(.*)/ }
],
[
{ telem: ".art-publish-date.afor > .l-date:last", date: '.' },
{ telem: ".calcalistArticleHeader_footer .date", date: '.'},
{ telem: "span.art-publish-date", date: '.'}
]
]
},
{
hostname: "newmedia.calcalist.co.il",
params: [
{ str: 'מוסף כלכליסט' },
{ telem: ".credit" },
[
{ telem: "div.head-container > h1.head-2" },
{ attr: ['meta[property="og:title"]', 'content'], remove: [' | מוסף כלכליסט'] }
],
{ url: 1, match: /\.il\/magazine-(.*?)\.html/ }
]
},
{
hostname: "www.news1.co.il",
params: [
{ str: 'NFC' },
{ telem: "#titleTop > table a", remove: ["מחלקה ראשונה"] },
{ attr: ['meta[property="og:title"]', 'content'] },
{ url: 1, match: /ve\/(.*?)\.html/ },
{ telem: "#ctl00_ContentMain_UcArticle1_lblCreateDate", date: '/' }
]
},
{ //even this is not exactly "External Link Template"
hostname: "aleph.nli.org.il",
params: [
{ str: 'צ-מאמר' },
{ telem: "#fullRecordView th:contains(מחבר):first + td", func: function (str) { var strs = str.match(/^(.*?), (.*?)$/); return (strs.length == 3) ? (strs[2] + " " + strs[1]) : str; } },
{ telem: "#fullRecordView th:contains(כותר):first + td", match: /^(.*?)\.?[\s\u202c]*$/ },
{ telem: "#fullRecordView th:contains(בתוך):first + td", match: /^(.*?) \(/ },
{ str: '' },
{ telem: "#fullRecordView th:contains(בתוך):first + td", match: /\((.*?)\)/, func: function (yh) { return yh.substring(0, yh.length - 1) + '"' + yh.substr(yh.length - 1); } },
{ telem: "#fullRecordView th:contains(בתוך):first + td", match: /(\d+\-\d+)/ },
{ telem: "#fullRecordView th:contains(מס' מערכת):first + td", prefix: "רמבי=" }
]
},
{
hostname: "www.yeshiva.org.il", hrefmatch: /\/midrash\/shiur\.asp\?id=\d+/i,
params: [
{ str: 'אתר ישיבה1' },
{ telem: ".trav", remove: ["הרב"] },
{ telem: "h1" },
{ urlparam: "id" }
]
},
{
hostname: "www.sport5.co.il",
params: [
{ str: 'ספורט 5' },
{ ldjson: { key: 'author' }, remove: ["מערכת אתר ערוץ הספורט"] },
{ telem: "h1.article-main, h1#divTopTitle" },
[
{ url: 1, match: /Article\.\d+\.(\d+)\.html/ },
{ url: 1, match: /docID=(\d+)/i }
],
[
{ url: 1, match: /Article\.(\d+)\.\d+\.html/ },
{ url: 1, match: /FolderID=(\d+)/i }
],
[
{ telem: "#lblDate2", date: '/' },
{ telem: ".hint", date: '.' }
]
]
},
{
hostname: "britishpathe.com",
hrefmatch: /britishpathe\.com/i,
params: [
{ str: 'British Pathe' },
[
{ telem: ".searchTermVal", func: function(val) { return 'סרטוני חדשות על ' + val; }, remove: [/"/g] },
{ attr: ["meta[property='og:title']", "content"] }
],
[
{ telem: ".searchTermVal", remove: [/"/g] },
{ url: 1, match: /britishpathe\.com\/.*?(\d+)\// }
]
]
},
{
hostname: "www.idf.il",
params: [
{ str: 'אתר צה"ל' },
{ telem: ".author-article", remove: [ /,?\s*?מערכת (את"צ|אתר צה"ל|צה"ל)/ ] },
{ telem: "h1" },
[
{ attr: ["body", "data-uid"] },
{ url: 'decodeURI', match: /idf\.il\/(.*)$/ }
],
{ telem: ".rating-article > .rating-item", date: '.' }
]
},
{
hostname: "maarachot.idf.il",
params: [
{ str: 'מערכות1' },
{ telem: "p.author > a" },
{ attr: ["meta[property='og:title']", "content"] },
{ url: 'decodeURI', match: /idf\.il\/.*\/מערכות-([\d-]+)\//, func: function (val) { return val ? val : '0'; } },
{ url: 1, match: /idf\.il\/(\d{4})\// },
{ url: 'decodeURI', match: /idf\.il\/.*\/(?:מערכות-[\d-]+)?(.*)\//, func: function (val) { return (document.querySelector("meta[property='og:title']").content.replace(/ /g, '-').replace(/[?"'\(\)]/g, '') == val) ? '' : val; } }
]
},
{
hostname: "www.kikar.co.il",
params: [
{ str: 'כיכר השבת' },
{ attr: ["meta[name='author']", "content"] },
{ attr: ["meta[property='og:title']", "content"] },
[
{ url: 1, match: /il\/.*?\/(\d*)/ },
{ url: 1, match: /il\/(.*)/ }
],
{ attr: ["meta[property='article:published_time']", "content"], date:['-', '210'] }
]
},
{
hostname: "www.kipa.co.il",
params: [
{ str: 'כיפה' },
{ telem: "author", remove: [", כיפה"] },
{ telem: "h1" },
{ url: 1, match: /co\.il\/(.+)/ },
{ telem: "p.scheme-author > span", date: '/' }
]
},
{
hostname: "www.hebpsy.net",
params: [
{ str: 'פסיכולוגיה עברית' },
{ attr: ["meta[name='auhtor']", "content"] },
{ telem: "h2.head" },
{ urlparam: 'id' },
{ telem: ".body_textarea:first > div:last", func: function (str) { var arr = str.match(/(\d+)..([א-ת]+)..(\d+)/); return arr[1].replace(/^0+/, '') + " ב" + arr[2] + " " + arr[3]; } } //it's not space but other character
]
},
{
hostname: "www.hayadan.org.il",
params: [
{ str: 'הידען' },
{ telem: "a[rel='author'], span.author, li[itemprop='author']", remove: ["מאת "] },
{ telem: "h1.entry-title, h1.single-title, div.title-primary, span.breadcrumb_last" },
{ url: 1, match: /https?:\/\/www.hayadan\.org\.il\/(.*?)$/i },
[
{ telem: "span.meta-date, span.date" },
{ telem: ".entry-header .published" },
{
attr: ['meta[property="article:published_time"]', 'content'],
func: function(s) { return dateFormat(new Date(s).toLocaleDateString('he').split('.')); }, // just for after 22:00 articles as https://www.hayadan.org.il/colluns-astronauts-are-not-celebs-2307093
}
]
]
},
{
hostname: "hebrewbooks.org", hrefmatch: /org\/\d/,
params: [
{ str: 'היברובוקס' },
{ telem: "span.authorname" },
{ telem: "span.sefername" },
[
{ urlparam: 'req' },
{ url: 1, match: /hebrewbooks\.org\/(\d+)$/i }
],
{ telem: "#cpMstr_lblHebPlace:first", prefix: 'מקום הוצאה=' },
{ telem: "#cpMstr_lblHebDate:first", prefix: 'שנת הוצאה=' }
]
},
{
hostname: "hebrewbooks.org", hrefmatch: /pgnum/,
params: [
{ str: 'היברובוקס' },
{ telem: "span.authorname" },
{ telem: "span.sefername", remove: "-----" },
[
{ urlparam: 'req' },
{ url: 1, match: /hebrewbooks\.org\/(\d+)$/i }
],
{ urlparam: 'pgnum', prefix: 'page=' }
]
},
{
hostname: "www.izkor.gov.il",
params: [
{ str: 'יזכור' },
{ url: 1, match: /gov\.il\/(.*)/, func: function (val) { return val.replace(/%20/, '%2520'); } },
{ url: 1, match: /gov\.il\/(.*?)\// }
]
},
{
hostname: "hebrewbooks.org", hrefmatch: /p/,
params: [
{ str: 'היברובוקס' },
{ telem: "span" },
{ telem: "title", remove: "HBreader - " },
{ urlparam: 'sfid' },
{prefix: 'page=', url: 1, match:/p\=(\d+)/i, remove: "contents not available אין תוכן העניינים"},
]
},
{
hostname: "library.alhatorah.org",
params: [
{ str: 'על התורה' },
{ },
{ telem: "span.SP-title-text" },
{ urlparam: '?r1' },
]
},
{
hostname: "www.kolhalashon.com", hrefmatch: /RavInfoD/,
params: [
{ str : 'קול הלשון'},
{ urlparam: 'RavID', prefix: '3=' }
]
},
{
hostname: "www.kolhalashon.com", hrefmatch: /PlayShiur/,
params: [
{ str: 'קול הלשון'},
{ elem: '#ctl00_TopInternalPage_c_RavName', perfix: '|' },
{ elem: '#ctl00_TopInternalPage_c_ShiurTitle', perfix: '|' },
{ urlparam: 'FileName', perfix: '|'}
]
},
{
hostname: "www.izkor.gov.il", hrefmatch: /HalalKorot/i,
params: [
{ str: 'נזכור את כולם' },
{ urlparam: "id" },
{ attr: ['#ctl00_ctl00_MainContent_MainContent_HiddenFieldFullName', 'value'] },
{ prefix: 'מלא=', str: 'כן' }
]
},
{
hostname: "tchelet.org.il",
params: [
{ str: 'תכלת' },
{ telem: "h2 + a.author" },
{ telem: "h2" },
{ urlparam: "id" },
{ telem: "#themag" }
]
},
{
hostname: 'www.nli.org.il', hrefmatch: /newspapers\/bamahane/, // it's own thing and not part of the larger nli
params: [
{ str: 'במחנה' },
{ str: '', func: function (str) { return window.prompt("שם מחבר", str!='N/A'?str:''); } },
{ str: '', func: function (str) { return window.prompt("כותרת הדף", str); } }, // $('.pageblockselected').attr('title')
{ url: 1, match: /newspapers\/bamahane\/(\d{4}\/\d{2}\/\d{2})\// },
{ url: 1, match: /page\/(\d+)/ }
]
},
{
hostname: 'www.nli.org.il',
params: [
[
{
//just to reload ld+json
func:function() {
$('script[type="application/ld+json"]').remove();
if (location.pathname == "/he/newspapers/") {
window.canonical_url = $('link[rel="canonical"]').attr('href');
} else {
window.canonical_url = location.pathname;
}
var new_ldjson = $($.ajax({ url: window.canonical_url, async:false }).responseText).filter('script[type="application/ld+json"]');
console.log(new_ldjson);
$('head').prepend(new_ldjson);
}
},
{ var:'canonical_url', match:/newspapers\/(.*?)\//, func:function(s) { return {
'ahj': 'החרות ירושלים',
'ahr': 'על המשמר',
'ajns': 'עיתונות|ajns',
'ashnav': 'אשנב',
'baderech': 'עיתונות|baderech',
'bamar': 'במערכה',
'bustenai': 'עיתונות|bustenai',
'dav': 'דבר',
'dhy': 'דואר היום',
'diedeborah' :'עיתונות|diedeborah',
'dmt': 'מאמענט',
'dnajlb': 'עיתונות|dnajlb',
'emda': 'עמדה',
'eretzh': 'עיתונות|eretzh',
'etger': 'עיתונות|etger',
'frw': 'פארווערטס',
'haa': 'המאסף',
'haam': 'העם עיתון לאומי',
'hadashot': 'חדשות',
'hadorkrakow': 'עיתונות|hadorkrakow',
'hadt': 'האחדות',
'haibri': 'העברי',
'hairtlv': 'העיר',
'ham': 'העם',
'haolam': 'העולם',
'haretz': 'הארץ1',
'has': 'השומר הצעיר ורשה',
'haschiloah': 'השילוח1',
'haumaisr': 'האומה1',
'hayal': 'לחייל',
'hayomisr': 'עיתונות|hayomisr',
'hayomw': 'היום וורשה',
'hazit': 'החזית',
'hbkr': 'הבקר',
'hcl': 'הכרמל',
'heatid': 'עיתונות|heatid',
'hebrew': 'שרהזאהן',
'hed': 'הד המזרח',
'hegeh': 'עיתונות|hegeh',
'hhr': 'הפועל הצעיר',
'hlb': 'הלבנון',
'hma': 'קואינקה',
'hmd': 'המודיע',
'hmf': 'המשקיף',
'hmi': 'המזרחי',
'hmz': 'המליץ',
'hrt': 'חרות',
'hsk': 'השקפה',
'hym': 'היום',
'hyt': 'היינט',
'hzan': 'חזית העם',
'hzf': 'הצפירה',
'hzfn': 'הצפון',
'hzfwar': 'עיתונות|hzfwar',
'hzh': 'הצופה',
'hzn': 'הזמן',
'hzt': 'חבצלת',
'hzv': 'הצבי',
'iva': 'עברי אנכי',
'khm': 'קול העם',
'kmd': 'קול מחזיקי הדת',
'kmv': 'קול מבשר',
'kolhair': 'כל העיר1',
'kotert': 'כותרת ראשית',
'ktuvim': 'כתובים',
'lbf': 'לעבנס-פראגן',
'lehiton': 'להיטון',
'lmrv': 'למרחב',
'ltb': 'ליטערארישע בלעטער',
'mad': 'מחזיקי הדת',
'mahanayim': 'מחניים',
'mar': 'מעריב',
'mgd': 'המגיד',
'mrh': 'מוריה',
'mzp': 'המצפה',
'newpalestine' :'עיתונות|newpalestine',
'omer': 'אמר',
'pisgoh': 'הפסגה',
'plb' :'עיתונות|plb',
'pls': 'PalPost',
'shar': 'שערים',
'sulm': 'סלם',
'yarden': 'הירדן',
'yomyom': 'יוםיום',
'ytlv': 'ידיעות תל אביב',
'zim': 'עיתונות|zim',
'zmanim': 'זמנים'
}[s.toLowerCase()]; } }
],
{ ldjson:{ raw: 'author' }, func: function (str) { return window.prompt("שם מחבר", str!='N/A'?str:''); } },
{ ldjson:{ raw: 'name' }, func: function (str) { return window.prompt("כותרת הדף", str); } }, // $('.pageblockselected').attr('title')
{ var: 'canonical_url', match: /newspapers\/\w+\/(\d+\/\d+\/\d+)\//, remove: '///'},
{ var: 'canonical_url', match: /article\/(\d+\.?\d*)(\/|$)/ }
]
},
{
hostname: "blog.nli.org.il",
params: [
{ str: 'הספרנים' },
{ var: ['nliLayersActiveItem', 'data_order'], func: function(itemid) { return document.querySelector('.article-items > article:nth-of-type(' + itemid + ') .entry-meta span:nth-of-type(1)').textContent; } },
{ var: ['nliLayersActiveItem', 'data_order'], func: function(itemid) { return document.querySelector('.article-items > article:nth-of-type(' + itemid + ') .entry-title').textContent; } },
{ var: ['nliLayersActiveItem', 'data_url'], remove: [ /^\//, /\/$/ ] },
{ var: ['nliLayersActiveItem', 'data_order'], func: function(itemid) { return document.querySelector('.article-items > article:nth-of-type(' + itemid + ') .entry-meta span:nth-of-type(2)').textContent; }, date: '.' }
]
},
{
hostname: "www.pc.co.il",
params: [
{ str: 'אנשים ומחשבים' },
{ attr: ["meta[name='author']", "content"] },
[
{ telem: ".post_header > h2:nth-child(2)" },
{ telem: "h1.title-post" }
],
[
{ urlparam: 'p' },
{ url: 1, match: /\/(\d+)\/$/ }
],
{ telem: "span.date", match: /(\d+ ב[א-ת]+ \d+)/ }
]
},
{
hostname: "shironet.mako.co.il", hrefmatch: /type=lyrics/,
params: [
{ str: 'שירונט שיר' },
{ urlparam: 'wrkid' },
{ urlparam: 'prfid' },
{ telem: '.artist_song_name_txt' },
{ urlparam: 'lang', defvalue: '1' }
]
},
{
hostname: "shironet.mako.co.il", hrefmatch: /type=works/,
params: [
{ str: 'שירונט' },
{ urlparam: 'prfid', prefix: 'מספר=' },
{ telem: 'h1', prefix: 'שם=' }
]
},
{
hostname: 'www.sciam.co.il', hrefmatch: /%/,
params: [
{ str: 'סיינטיפיק אמריקן' },
{ telem: '.author-name' },
{ telem: '.entry-title' },
{ url: 1, match: /il\/(.+?)\// },
{ telem: '.entry-date', date: '.' }
]
},
{
hostname: "ratings.fide.com",
params: [
{ str: 'כרטיס פיד"ה' },
{ urlparam: 'event', prefix: '' }
]
},
{
hostname: "www.db.yadvashem.org",
params: [
{ str: 'מזהה חסיד אומות העולם' },
{ url: 1, match: /&itemId\=(\d+)/ }
]
},
{
hostname: "www.yadvashem.org",
params: [
{ str: 'מזהה חסיד אומות העולם' },
{ url: 1, match: /stories\/([a-z]+)/ },
{ prefix: 'עברית=', str: 'כן' }
]
},
{
hostname: "www.boxofficemojo.com",
params: [
{ str: 'מוג\'ו' },
{ urlparam: 'id', match: /(.*?)\.htm/ }
]
},
{
hostname: /article.yedioth?.co.il/,
params: [
{ str: 'ידיעות אחרונות' },
{ telem: '#lblAuthor' },
{ telem: '#lblTitle' },
{ urlparam: 'articleid' },
{ telem: '#lblDatePublished', date: '.' }
]
},
{
hostname: "www.0404.co.il",
params: [
{ str: '0404א' },
{ telem: '.post_admin', remove: ['חדשות 0404'] },
{ telem: '.stitle' },
{ urlparam: 'p' },
{ telem: '.post_date', date: '/' }
]
},
{
hostname: "ch10.co.il",
params: [
{ str: 'חרדים10' },
{ attr: ['meta[name="author"]', 'content'], remove: ['חרדים 10'] },
{ attr: ['meta[property="og:title"]', 'content'] },
{ url: 1, match: /news\/(\d+)/ },
{ attr: ['meta[property="article:published_time"]', 'content'], date: ['-', '210'] }
]
},
{
hostname: 'www.iaa-archives.org.il',
params: [
{ str: 'רשות העתיקות' },
{ str: '{{ס:' + "שם הדף בלי הסוגריים}}" },
{ url: 1, match: /loc_id\=(\d+)/ },
{ url: 1, match: /\?id\=(\d+)/ }
]
},
{
hostname: /www\.maariv\.co\.il/,
params: [
{ str: 'מעריב אונליין' },
[
{ ldjson: { key: 'author' } },
{ telem: 'span.article-reporter a' },
{ telem: 'a[rel=Author]' },
{ telem: '.article-date-report-wrap', match: /^.*\|(.*)$/m },
{ telem: 'span.article-reporter' },
],
[
{ attr: ['meta[property="og:title"]', 'content'] },
{ telem: '.article-title' }
],
{ url: 1, match: /co\.il\/(.*)/ },
[
{ telem: '.article-date-time, .article-he-date', date: '/' },
{ telem: '.article-date-report-wrap', date: '/' },
{ telem: '.article-publish-date', date: '/' },
{ telem: 'div.tmi-article-reporter-date', date: '/'}, // tmi articles
{ telem: 'time.tmi-article-info-date-time', date: '/'}, // tmi articles
{ telem: 'time.blog-publish-date', date: '/'} // blogs
]
]
},
{
hostname: /sport1\.maariv\.co\.il/,
params: [
{ str: 'ספורט1' },
{ telem: '.authors:first-child', remove: ['מערכת ספורט 1'] },
{ telem: 'h1.entry-title' },
{ url: 1, match: /co\.il\/(.*)\// },
{ telem: '.entry-date', date: '.' }
]
},
{
hostname: "davidson.org.il",
params: [
{ str: 'דוידסון1' },
{ attr: ['meta[name="twitter:data1"]', 'content'] },
{ attr: ['meta[property="og:title"]', 'content'], remove: [' | מגזין | מכון דוידסון'] },
{ url: 1, match: /org\.il\/read-experience\/(.*)$/ },
{ telem: 'div.date', func: function (val) { var x = val.split(' '); x[1] = 'ב' + x[1]; return x.join(' '); } }
]
},
{
hostname: "alaxon.co.il",
params: [
{ str: 'אלכסון' },
{ telem: '.author' },
{ telem: 'h1' },
{ url: 1, match: /alaxon\.co\.il\/(.*)$/ },
[
{ attr: ["meta[property='article:published_time']", "content"], date:['-',[2,1,0]] },
{ telem: '.date', date: '.' }
]
]
},
{
hostname: "www.gvura.org",
params: [
{ str: 'אתר הגבורה' },
{ attr: ['input[name=hdaid]', 'value'] },
{ telem: 'h1' }
]
},
{
hostname: "www.srugim.co.il",
params: [
{ str: 'סרוגים' },
{ telem: '.post_author', match: /(.+?)\d/, remove: [', חדשות סרוגים', 'חדשות סרוגים'] },
{ telem: 'h1' },
{ url: 1, match: /\.srugim\.co\.il\/(.*)$/ },
[
{ attr: ["meta[property='article:published_time']", "content"], date:['-',[2,1,0]] },
{ telem: '.post_details', date: '.' }
]
]
},
{
hostname: 'otzar.org',
params: [
{ str: 'אוצר החכמה' },
[
{ urlparam: 'book', func: function (bookid) {
if (!bookid) try{ bookid = $('#book-iframe').attr('src').match(/book=(\d+)/)[1]; } catch(e) {}
if (bookid && location.hostname == 'tablet.otzar.org') {
window.detail_data =
JSON.parse($.post({ url: '//tablet.otzar.org/he/php/detailBook.php', async: false,
data:'{"ParamQuery":"{\\"NUMBOOK\\":\\"'+bookid+'\\",\\"USERDATAID\\":0}","sqlFile":"selectSubOfBook"}' }
).responseText).arr[0];
} else if (window.booknameS && window.authorS) {
bookid = bookid || window.bookid;
window.detail_data = {
AUTHOR: window.authorS,
FULLNAME: window.booknameS,
bookid: bookid
};
} else {
bookid = bookid || window.bookid;
var parts = $('title').text().replace(' - אוצר החכמה','').split('/'); // new pages (april 2022)
if (parts.length == 1) {
parts = document.querySelector('div.item-tab-con.active .tab-title').textContent.split('/'); // old pages (april 2022)
}
window.detail_data = {
AUTHOR: parts[1],
FULLNAME: parts[0],
YEAR: parts[2],
PrintedP_AND_YEAR: parts[0].split('-')[1],
bookid: bookid
};
}
} },
{ var: ['detail_data', 'AUTHOR'] }
],
{ var: ['detail_data','FULLNAME'] },
[
{ var: ['detail_data','bookid'] },
{ url: 1, match: /(?:book|b)\/(\d*)\// }
],
[
{ var: ['detail_data', 'PrintedP_AND_YEAR'] },
{ func: function () {
return [
window.detail_data['PrintedP'].match(/[\u0590-\u05FF ]+/)[0],
window.detail_data['YEAR']
].join(' ');
} },
{ var: ['detail_data', 'YEAR'] }
],
{ str: '' },
[
{ attr: ["ab", "value"], match: /^([^ ]*) /, prefix: 'page=' },
{ elem: ["#ab", "val"], prefix: 'page=', match: /^(\d+) / },
{ urlparam: 'pagenum', prefix: 'page=' },
{ attr: ['.nav-active', 'position'], prefix: 'page='}
]
]
},
{
hostname: "www.davar1.co.il",
params: [
{ str: 'דבר העובדים' },
[
{ attr: ['section', 'data-author_name'] },
{ attr: ['article', 'data-author_name'] }
],
[
{ telem: '.headline' },
{ telem: '.g-article-headline'}
],
{ url: 1, match: /www\.davar1\.co\.il(?:\/.*)?\/(\d+)/ },
[
{ attr: ['meta[itemprop="dateCreated"]', 'content'], date: '.' },
{ telem: '.g-article-date', date: '.' }
]
],
removeparam: {
'1': [ 'דבר ראשון' ] // old name in old articles
}
},
{
hostname: "www.youtube.com", hrefmatch: /youtube\.com\/watch\?v=.*/i,
params: [
{ str: "יוטיוב" },
{ urlparam: "v" },
{ telem: "player-microformat-renderer", func: function (str) { return JSON.parse(str).name; }, prefix: "שם=" },
{ telem: "player-microformat-renderer", func: function (str) { var dur = JSON.parse(str).duration.slice(2, -1), time = new Date(dur * 1000).toISOString(); return dur < 3600 ? time.substr(14, 5) : time.substr(11, 8); }, prefix: "לענג=" },
{ telem: "player-microformat-renderer", func: function (str) { return JSON.parse(str).author; }, prefix: "ערוץ=" }
]
},
{
hostname: "www.forbes.co.il",
params: [
{ str: "פורבס" },
{ telem: "#divforprint td.date", match:/.*\|(.*)$/ },
{ telem: "h1.newsTitle"},
{ url:1, match:/\?(.*)$/, prefix:'3=' },
{ telem: "#divforprint td.date", date:'/' , prefix:'4='}
]
},
{
hostname: "supremedecisions.court.gov.il",
params: [
[
{ func:function() {
var f = function(body_j, head_j) {
window.body_j = body_j; // just for debug
window.head_j = head_j; // just for debug
window.all_text = body_j.text();
if (!window.all_text)
return;
window.parsed_data = {
OTTER:
body_j.find('td:contains("העותר:"):first + td:first').first().text() ||
body_j.find('td:contains("העותרת:"):first + td:first').first().text() ||
body_j.find('td:contains("המערער:"):first + td:first').first().text() ||
body_j.find('td:contains("המערערת:"):first + td:first').first().text() ||
body_j.find('td:contains("המבקש:"):first + td:first').first().text()||
body_j.find('td:contains("המבקשת:"):first + td:first').first().text(),
MESHIV:
body_j.find('td:contains("המשיב:"):first + td:first').first().text() ||
body_j.find('td:contains("המשיבה:"):first + td:first').first().text(),
OTTERS:
head_j.find('meta[name="side_nm"]').map(function(m) {
return head_j.find('meta[name="side_ty"]:eq('+m+')').attr('content') == "תביעה" ? [
$(this).attr('content')
] : [];
}).toArray(),
};
if (window.parsed_data.OTTERS && !window.parsed_data.OTTER) {
window.parsed_data.OTTER = (window.parsed_data.OTTERS.length > 1) ?
(window.parsed_data.OTTERS[0].trim() + ' ואחרים') :
(window.parsed_data.OTTERS[0]);
}
};
if (!window.all_text) {
f($('body'), $('head'));
}
if (!window.all_text) {
var xhr = new XMLHttpRequest();
xhr.open('GET', location.href.replace('type=4','type=2'), true);
xhr.responseType = 'arraybuffer';
xhr.onload = function(e) {
if (this.status == 200) {
console.log('this.response', this.response, this);
var text;
if (new Uint8Array(this.response).indexOf(0) < 0) {
text = new TextDecoder("windows-1255").decode(this.response);
} else {
text = new TextDecoder("UTF-16LE").decode(this.response);
}
var head_as_div = '<div id="head>'+text.replace(/^[\s\S]*<head.*?>|<\/head>[\s\S]*$/ig, '')+'</div>';
var body_as_div = '<div id="body>'+text.replace(/^[\s\S]*<body.*?>|<\/body>[\s\S]*$/ig, '')+'</div>';
f($(body_as_div), $(head_as_div));
if (window.all_text)
wikiit(undefined, 1);
} else {
window.all_text = 'Error! ' + this.status;
}
};
window.popup_template_canceled = true;
xhr.send();
}
} },
{ str: "פס\"ד עליון" }
],
[
{ prefix:'קישור=', urlparam: 'path', func: function(s) { return !s.indexOf('NetVerdicts') ? s.replace('NetVerdicts/', '') : false; } },
{ prefix:'קישור=', urlparam: 'fileName'}
],
{ prefix:'קובץ=', url: 1, func: function(s) { return s.indexOf('NetVerdicts') > -1 ? getParameterByName('fileName') : ''; }, removeifempty: true },
{ prefix:'סוג=', var: 'all_text', match: /([^\s]+?)[\s]+\d+\/\d+/m},
[
{ prefix:'עותר=', var:['parsed_data', 'OTTER'] },
{ prefix:'עותר=', var: 'all_text', match: /המבקש(?:ים|ות)\:\s*1\.([\s\S]]+?)2\./m, func:function(s) { return s && (s.trim()+' ואחרים'); } },
{ prefix:'עותר=', var: 'all_text', match: /העותר(?:ים|ות)\:\s*1\.([\s\S]+?)2\./m, func:function(s) { return s && (s.trim()+' ואחרים'); } },
{ prefix:'עותר=', var: 'all_text', match: /המערער(?:ים|ות)\:\s*1\.([\s\S]+?)2\./m, func:function(s) { return s && (s.trim()+' ואחרים'); } }
],
[
{ prefix:'משיב=', var:['parsed_data', 'MESHIV'] },
{ prefix:'משיב=', var: 'all_text', match: /המשיב(?:ים|ות)[\s\S]*?1\.([\s\S]+?)2\./m, func:function(s) { return s && (s.trim()+' ואחרים'); } }
],
[
{ prefix:'ניתן ב=', var: 'all_text', match: /ניתן\s+היום,.*?\((.*?)\)/m, date:'.'}, // https://supremedecisions.court.gov.il/Home/Download?path=HebrewVerdicts\11/850/019/o24&fileName=11019850.o24&type=4
{ prefix:'ניתן ב=', var: 'all_text', match: /ניתנה\s+היום,.*?\((.*?)\)/m, date:'.'} // https://supremedecisions.court.gov.il/Home/Download?path=HebrewVerdicts\16/240/062/02c&fileName=16062240.02c&type=4
]
]
},
{
hostname: "www.colbonews.co.il",
params: [
{ str: 'כלבו'},
{ telem: '#post_author', remove: ['מאת:'] },
{ url: 1, match: /www\.colbonews\.co\.il\/(.*)\/$/ },
{ telem: '#post_h1' },
{ telem: '#post_time', date:'.' }
]
},
{
hostname: "space.gov.il",
params :[
{ str: "סלה" },
{ telem: "hrf" },
{ telem: "h1" },
{ url: 1, match:/(\d+)$/ },
{ telem: "span.date-display-single", date:'.' }
]
},
{
hostname: "lib.cet.ac.il",
params:[
{ str: "מטח" },
{ telem: ".TitleText", match: /מחבר.*?\:([\S\s]*)$/ },
{ telem: "title" },
{ urlparam: "item" }
]
},
{
hostname: "jdn.co.il",
params:[
{ str: "JDN"},
{ telem: "span.elementor-post-info__item--type-author" },
{ telem: "h1.elementor-heading-title" },
{ url: 1, match: /\/(\d+)\// },
{ attr: ['meta[property="article:published_time"]', 'content'], date: ['-', '210'] }
]
},
{
hostname: "google\.co.*", hrefmatch:/google.*?\/maps/,
params: [
{ str: "coord" },
[ //order does matter
{ telem: ".widget-reveal-card-open .link-like.widget-reveal-card-lat-lng", match: /(-?[\d\.]+), / },
{ url: 1, match: /([\d\.]+)!..[\d\.]+$/ },
{ url: 1, match: /@(-?[\d\.]+),/ }
],
[ //order does matter
{ telem: ".widget-reveal-card-open .link-like.widget-reveal-card-lat-lng", match: /-?[\d\.]+, (-?[\d\.]+)/ },
{ url: 1, match: /[\d\.]+!..([\d\.]+)$/ },
{ url: 1, match: /@-?[\d\.]+,(-?[\d\.]+),/ }
]
]
},
{
hostname: "timeout.co.il",
params: [
{ str: 'Time Out ישראל'},
{ telem: 'div.byline > a', remove: ['מערכת טיים אאוט'] },
{ telem: 'h1.headline' },
{ url: 1, match: /il\/(.+?)\// },
{ telem: 'div.date > span' }
]
},
{
hostname: "yuvalerel.com",
params: [
{ str: 'יובל אראל'},
{ telem: 'a.author-name' },
{ telem: 'h1.post-title ' },
{ url: 1, match: /com\/(.*)/ }
]
},
{
hostname: "geektime.co.il",
params: [
{ str: 'גיקטיים'},
[
{ telem: 'p.post-meta > a' },
{ telem: 'section.post-content > p > strong' },
{ telem: '.author' }
],
[
{ telem: 'article.post-entry > h1' },
{ telem: '.head-title' }
],
{ url: 1, match: /il\/(.*)\// },
[
{ telem: 'p.post-meta', date: '.' },
{ telem: '.date', date: '.' }
],
],
removeparam: {
'1': [ 'כתב אורח', /מאת:? / ]
}
},
{
hostname: "eureka.org.il",
params: [
{ str: 'אאוריקה'},
{ telem: 'div.head-text > h2' },
{ url: 1, match: /il\/item\/(\d*)\// }
]
},
{
hostname: "ha-makom.co.il",
params: [
{ str: 'המקום'},
{ telem: 'div.jeg_meta_author > a' },
{ telem: 'div.entry-header > h1' },
{ url: 1, match: /il\/(.*)/ },
{ telem: 'div.jeg_meta_date > a', date: '.' }
]
},
{
hostname: "benyehuda.org",
params: [
{ str: 'פרויקט בן-יהודה'},
{ url: 1, match: /org\/\w+\/(\d+)/, prefix: "זיהוי=" },
[
{ telem: 'div.author-page-top-name', prefix: 'שם=' },
{ telem: 'div.work-title > div.headline-2-v02', prefix: 'שם=' }
],
{ telem: 'div.work-title > div.headline-1-v02', prefix: 'שם היצירה=', remove: ['[', ']'] }
]
},
{
hostname: "archives.gov.il",
params: [
{ str: 'ארכיון המדינה'},
[
{ telem: 'h2#chapter-title > span:nth-child(2)' },
{ telem: 'h2#chapter-title' },
{ telem: 'div.inner > h2' },
{ telem: 'div#item-data > h1' },
{ telem: 'div#page-centered-header-title > h1 '}
],
{ url: 1, match: /il\/(.*)/ }
]
},
{
hostname: "mekomit.co.il",
params: [
{ str: 'שיחה מקומית'},
{ telem: 'article#main > header > div.post_details > a' },
{ telem: 'article#main > header > h1.post_title' },
{ url: 1, match: /il\/(.*)\// },
{ telem: 'article#main > header > div.post_details > time', date: '.' }
]
},
{
hostname: "onegshabbat.blogspot.com",
params: [
{ str: 'עונג שבת'},
[
{ telem: 'div.post-body > div > span' },
{ telem: 'div.post-body > div > b' },
{ telem: 'div.post-body > div > strong' }
],
{ telem: 'h3.post-title' },
{ url: 1, match: /com\/(\d{4}\/\d{2})\// },
{ url: 1, match: /blog-post_(\d+).html/ },
{ telem: 'h2.date-header', remove: [ /.*, / ] }
],
removeparam: {
'1': ['מאת', 'כתב וצילם', 'כתב']
}
},
{
hostname: "dbs.anumuseum.org.il",
params: [
{ str: 'אנו – מוזיאון העם היהודי'},
{ url: 1, match: /il\/.*\/\w(\d+)\/.*/ },
{ telem: 'title', remove: [' | מאגרי מידע - אנו מוזיאון העם היהודי' ] }
]
},
{
hostname: "kolzchut.org.il",
params: [
{ str: 'כל זכות'},
{ attr: ["meta[property='og:title']", "content"] }
]
},
{
hostname: "guidestar.org.il", hrefmatch: /organization/,
params: [
{ str: 'גיידסטאר'},
{ url: 1, match: /il\/organization\/(\d+)/ },
{ elem: 'title', remove: [' | גיידסטאר - אתר התאגידים של ישראל | משרד המשפטים' ] }
]
},
{
hostname: "www.inss.org.il",
params: [
{ str: 'INSS'},
{ telements: ['.authors_in_post_item .author span', VE] },
[
{ telem: '.banner_post_item_title, .banner_post_item h1' },
{ telem: 'h2.title_46' }
],
{ url: 1, match: /www\.inss\.org\.il\/he\/publication\/([^\/]+)/ },
{ telem: '.cataloging_references' }
]
},
{
hostname: "jfc.org.il", hrefmatch: /news_journal/,
params: [
{ str: 'יומן חדשות'},
{ telem: 'h1.content_title' },
{ url: 1, match: /il\/news_journal\/([\d-]+\/[\d-]+)/ },
{ telem: '.content_subtitle' }
]
},
{
hostname: "cbr.com",
params: [
{ str: 'CBR'},
{ attr: ["meta[property='article:author']", "content"] },
{ attr: ["meta[property='og:title']", "content"] },
{ url: 1, match: /com\/(.*)\// },
{ telem: '.date > time', remove: ['Published ']}
]
},
{
hostname: "www.tidhar.tourolib.org",
params: [
{ str: 'תדהר'},
{ url: 1, match: /tidhar\/view\/(\d+)\/.+/ },
{ url: 1, match: /tidhar\/view\/\d+\/(\d+)/ }
]
},
{
hostname: "zman.co.il",
params: [
{ str: 'זמן ישראל' },
{ ldjson: { key: 'author' } },
{ telem: "h1.headline" },
{ url: 1, match: /co\.il\/(\d+)/, dirty: true },
{ ldjson: { key: 'datePublished' } }
]
},
{
hostname: "wikirefua.org.il",
params: [
{ str: 'ויקירפואה' },
{ telem: "h1.firstHeading" },
{ telem: "h1.firstHeading", func: function(data) { var match = data.match(/ - [A-Za-z].*/); return match ? data.replace(match[0], '') : false; } }
]
},
{
hostname: "academia.edu",
params: [
{ str: 'אקדמיה' },
{ attr: ["meta[name='citation_author']", "content"] },
{ attr: ["meta[property='og:title']", "content"] },
{ url: 1, match: /academia.edu\/(\d+)/ },
{ attr: ["meta[name='citation_journal_title']", "content"] },
{ attr: ["meta[name='citation_publication_date']", "content"] }
]
},
{
hostname: "i24news.tv",
params: [
{ str: 'i24' },
{ telem: ".signature-link > a", remove: ['i24NEWS'] },
{ attr: ["meta[property='og:title']", "content"], remove: [' - i24NEWS'] },
{ url: 1, match: /i24news\.tv\/(.*)/ },
[
{ attr: ["meta[property='pubdate']", "content"], date:['-',[2,1,0]], func: function(val) { return window.location.pathname.indexOf('/he/') == 0 ? val : ''; } },
{ telem: ".common-information-wrapper > span > time ", func: function(val) { if (val) { var arr = val.split(' '); return [arr[0], arr[1], arr[2]].join(' '); } return ''; } }
]
]
}
];
for (var i = 0; i < data.length; i++) {
if (
location.hostname.match(data[i].hostname) &&
(!data[i].hrefmatch || location.href.match(data[i].hrefmatch)) &&
(!data[i].condition || data[i].condition())
) {
var params = [];
for (var j = 0; j < data[i].params.length; j++) {
if (!(data[i].params[j] instanceof Array)) {
data[i].params[j] = [data[i].params[j]];
}
for (var k=0; k < data[i].params[j].length; k++) {
try {
var curParam = data[i].params[j][k],
removed = false; params[j] = '';
if (typeof curParam.str != "undefined") {
params[j] = curParam.str;
} else if (typeof curParam.ldjson != "undefined") {
var ldjson = null;
var ldjsons = $('script[type="application/ld+json"]').map(function(i,e) { try { return JSON.parse($(e).text().replace(/[\t\n\r]/g, ' ')); } catch (e) { return false; } });
if (typeof curParam.ldjson.n != "undefined") {
ldjson = ldjsons[curParam.ldjson.n];
} else {
var filteredLdjson = ldjsons.filter(function(i,e) { return (curParam.ldjson.type?[curParam.ldjson.type]:['NewsArticle','Article']).includes(e['@type']); });
if (filteredLdjson.length == 1) {
ldjson = filteredLdjson[0];
} else {
console.error("more/less than single ldjson", filteredLdjson);
return;
}
}
if (curParam.ldjson.key == "datePublished") {
params[j] = ldjson.datePublished;
if (!curParam.date) {
curParam.date = ['-', '210'];
}
} else if (curParam.ldjson.key == "author") {
params[j] =
$.map($(ldjson.author), function(a) { return a.name; } )
.join(VE);
} else if (typeof curParam.ldjson.raw != "undefined") {
if (!(curParam.ldjson.raw instanceof Array)) {
curParam.ldjson.raw = [curParam.ldjson.raw];
}
params[j] = ldjson;
for (var t=0; t < curParam.ldjson.raw.length; t++) {
params[j] = params[j][curParam.ldjson.raw[t]];
}
}
} else if (typeof curParam.url != "undefined") {
params[j] = location.href;
if (curParam.url == 'decodeURIComponent')
params[j] = decodeURIComponent(params[j]);
else if (curParam.url == 'decodeURI')
params[j] = decodeURI(params[j]);
} else if (typeof curParam.attr != "undefined") {
params[j] = jQuery('html').find(curParam.attr[0]).attr(curParam.attr[1]);
} else if (typeof curParam.var != "undefined") {
if (!(curParam.var instanceof Array))
curParam.var = [curParam.var];
params[j] = window;
for (var vi=0; vi < curParam.var.length; vi++) {
params[j] = params[j][curParam.var[vi]];
if (!params[j])
break;
}
if (params[j] == window)
params[j] = undefined;
}
else if (typeof curParam.urlparam != "undefined") {
params[j] = getParameterByName(curParam.urlparam) || "";
} else if (typeof curParam.elem != "undefined") {
if (curParam.elem instanceof Array) {
params[j] = jQuery('html').find(curParam.elem[0]);
for (var elemIdx = 1; elemIdx < curParam.elem.length; elemIdx++) {
var func = curParam.elem[elemIdx].split(',');
params[j] = (func.length > 1) ? params[j][func[0]](func[1]) : params[j] = params[j][func[0]]();
}
if (typeof (params[j]) != "string")
params[j] = params[j].html();
}
else
params[j] = jQuery('html').find(curParam.elem).html();
}
else if (typeof curParam.first_text_node != "undefined") {
params[j] = jQuery('html').find(curParam.first_text_node).contents().filter(function () { return this.nodeType === 3; }).text();
} else if (typeof curParam.elements != "undefined" || (typeof curParam.telements != "undefined")) {
var sep;
if (typeof curParam.elements != "undefined") {
params[j] = jQuery('html').find(curParam.elements[0]).map(function (el) { return $(this).html(); }).toArray();
sep = curParam.elements[1];
}
if (typeof curParam.telements != "undefined") {
params[j] = jQuery('html').find(curParam.telements[0]).map(function (el) { return $(this).text(); }).toArray();
sep = curParam.telements[1];
}
if (sep != VE) { // hack for VE
params[j] = params[j].join(sep);
} else {
if (params[j].length > 2) {
params[j] = [params[j].slice(0,-1).join(', '), params[j].slice(-1)].join(sep);
} else {
params[j] = params[j].join(sep);
}
}
}
else if (typeof curParam.telem != "undefined") {
params[j] = jQuery('html').find(curParam.telem).first().text().trim();
}
if (typeof curParam.match != "undefined") {
if (!(curParam.match instanceof Array))
params[j] = match(params[j], curParam.match);
else for (var patIdx = 0; patIdx < curParam.match.length; patIdx++) {
var temp = match(params[j], curParam.match[patIdx]);
if (temp != '') {
params[j] = temp;
break;
}
}
}
if (typeof curParam.addParam != "undefined") {
addedParam = getParameterByName(curParam.addParam);
if (addedParam) {
params[j] += ('?' + curParam.addParam + '=' + addedParam);
}
}
if (typeof curParam.remove != "undefined")
for (var removeIdx = 0; removeIdx < curParam.remove.length; removeIdx++)
params[j] = params[j].replace(curParam.remove[removeIdx], "");
if (typeof curParam.func != "undefined") {
if (!(curParam.func instanceof Array))
curParam.func = [curParam.func];
for (var funcIdx = 0; funcIdx < curParam.func.length; funcIdx++) {
params[j] = curParam.func[funcIdx](params[j]);
}
}
if (typeof curParam.date != "undefined") {
if (!(curParam.date instanceof Array))
curParam.date = [curParam.date, [0,1,2]];
var gep = curParam.date[0].replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
params[j] = match(params[j], RegExp(('(\\d+' + gep + '\\d+' + gep + '\\d+)')));
if (params[j]) {
params[j] = params[j].split(curParam.date[0]);
params[j] = [params[j][curParam.date[1][0]], params[j][curParam.date[1][1]], params[j][curParam.date[1][2]]];
params[j] = dateFormat(params[j]);
}
}
if (typeof curParam.stringDate != "undefined") {
if (params[j]) {
var today = new Date(),
dd = (today.getDate() - (params[j] == YESTERDAY ? 1 : 0)).toString(),
mm = (today.getMonth() + 1).toString(),
yy = today.getFullYear().toString().slice(-2);
params[j] = dateFormat([dd, mm, yy]);
}
}
if (typeof curParam.removeDatePadding != "undefined") {
if (params[j]) {
var day = params[j].split(' ')[0];
if (day && day[0] === '0') params[j] = params[j].replace(day, day[1]);
}
}
if (typeof params[j] == "string") {
try {
params[j] = jQuery.trim(decodeURIComponent(params[j]));
} catch (e) {
console.error(e);
}
!curParam.dirty && (params[j] = cleanText(params[j]));
} else if (jQuery.isArray(params[j])) {
params[j] = jQuery.trim(params[j].join("|"));
}
if (params[j] && typeof curParam.prefix != "undefined")
params[j] = curParam.prefix + params[j];
if (typeof curParam.defvalue != "undefined" && params[j] == curParam.defvalue)
params[j] = '';
if (typeof curParam.shouldnt != "undefined" && typeof params[j] == "string" && params[j].match(curParam.shouldnt))
params[j] = '';
if (typeof curParam.removeifempty != "undefined" && !params[j])
params[j] = 'removeifempty';
if (data[i].removeparam) {
if (data[i].removeparam[j]) {
for (var r = 0; r < data[i].removeparam[j].length; ++r) {
var currName = params[j];
params[j] = params[j].replace(data[i].removeparam[j][r], '');
if (currName != params[j]) {
removed = true;
}
}
}
}
// if the author is the same as the template, remove it
if (j == 1 && params[0] && params[1]) {
if ((params[1] == params[0]) || ((params[1].split(' ').length-1 <= params[0].split(' ').length) && params[1].toLowerCase().indexOf(params[0].toLowerCase()) > -1)) {
params[1] = '';
removed = true;
}
}
if ((params[j] != '') && (params[j] != undefined)) {
console.log('found', j, params[j]);
break;
} else if (removed) {
console.log('not used', j, curParam);
} else {
console.log('not found', j, curParam);
}
}
catch (e) {
console.error(e);
}
}
}
var minimum = (typeof data[i].minimum != "undefined") ? (data[i].minimum) : (0);
while (params[params.length - 1] == "" && params.length > minimum) //remove all last empty params
params.pop();
// remove removeifempty child
while (params.indexOf('removeifempty') > -1)
params.splice(params.indexOf('removeifempty'), 1);
if (window.popup_template_canceled && !force_popup) {
console.log('popup_template_canceled');
} else {
var result = '{{' + params.join('|') + '}}';
if (window.addWikiNote) result = '{{הערה|' + result + '}}';
if (prompt("דרוקן OK וועט קאפּירן דעם מוסטער:", result) != null) {
var temp_raw = $("<input>");
$("body").append(temp_raw);
temp_raw.val(result);
temp_raw.select();
document.execCommand("copy");
temp_raw.remove();
//$('<input>').val(result).appendTo('body').select();document.execCommand('copy');
}
window.popup_template_canceled = false;
if (window.old$) { window.$ = window.old$; }
}
return;
}
}
try {
var ldojson = $('script[type="application/ld+json"]').map(function(i,e) { return JSON.parse($(e).text()); }).filter(function(i,e) { return ['NewsArticle', 'Article', 'article'].includes(e['@type']); });
var ldojson_website = [ { } ];
if (ldojson.length == 0) {
ldojson = $('script[type="application/ld+json"]').map(function(i,e) { return JSON.parse($(e).text()); }).filter(function(i,e) { return e['@graph']; });
if (ldojson.length == 1) {
ldojson_website = ldojson[0]['@graph'].filter(function(i,e) { return ['WebSite'].includes(i['@type']); });
ldojson = ldojson[0]['@graph'].filter(function(i,e) { return ['WebPage'].includes(i['@type']); });
}
}
console.log('ldojson:', ldojson);
if (ldojson.length == 1) {
ldojson = ldojson[0];
var date = new Date(ldojson.datePublished);
if (isNaN(date)) {
date = new Date(ldojson.publisher.datePublished);
}
var שרייבער = $.map($(ldojson.author), function(a) { return a.name; }).join(VE);
var קעפל = ldojson.name || ldojson.headline;
var זייטל = (ldojson.publisher||ldojson_website[0]).name;
var hebrewFound = hasHebrew(שרייבער) || hasHebrew(קעפל) || hasHebrew(זייטל);
var dateFormatter = hebrewFound ? dateFormat : dateFormatEng;
var formattedDate = '';
if (date != "Invalid Date") {
var dateParts = [''+date.getDate(), ''+(date.getMonth()+1), ''+date.getFullYear()];
formattedDate = dateFormatter(dateParts);
}
var general = {
'שרייבער': שרייבער,
'קעפל': קעפל,
'אדרעס': location.href,
'זייטל': זייטל,
'דאטום': formattedDate,
};
console.log('data', general);
var gresult = '{{לינק|'+$.map(general, function(v,k) {
return k + '=' + cleanText(jQuery.trim(decodeURIComponent($('<a />').html(v).text())));
}).join('|') + '}}';
if (window.addWikiNote) gresult = '{{הערה|' + gresult + '}}';
if (prompt("דרוקן OK וועט קאפּירן דעם מוסטער:", gresult) != null) {
$('<input>').val(gresult).appendTo('body').select();document.execCommand('copy');
}
if (window.old$) { window.$ = window.old$; }
return;
}
} catch (e) {
console.error('failed to create general link', e);
}
alert("דער זייטל אדער בלאט איז נישט געשטיצט דורכ'ן בוקמארקלעט.");
if (window.old$) { window.$ = window.old$; }
}
(function () {
if (typeof (jQuery) == "undefined") {
if (typeof ($) != "undefined") {
window.old$ = window.$;
console.log('store old dollar');
}
var s = document.createElement('script');
s.setAttribute('src', "https://yi.hamichlol.org.il/w/load.php?modules=jquery&only=scripts");
s.onload = wikiit;
document.getElementsByTagName('body')[0].appendChild(s);
} else {
wikiit();
}
})();