35,369
רעדאגירונגען
אין תקציר עריכה |
אין תקציר עריכה |
||
| שורה 7: | שורה 7: | ||
"list": "allpages", | "list": "allpages", | ||
"utf8": 1, | "utf8": 1, | ||
"apnamespace": " | "apnamespace": "0", | ||
"apfilterredir": "nonredirects", | "apfilterredir": "nonredirects", | ||
"apfrom": 'רבי שלמה האלבערשטאם', | //"apfrom": 'רבי שלמה האלבערשטאם', | ||
"aplimit": " | "aplimit": "300" | ||
}).done((data) => { | }).done((data) => { | ||
//console.table(data); | //console.table(data); | ||
| שורה 16: | שורה 16: | ||
console.timeLog('מדידת זמן', 'a'); | console.timeLog('מדידת זמן', 'a'); | ||
console.table(list); | console.table(list); | ||
var sum = 0; | //var sum = 0; | ||
for (const p in list) { | for (const p in list) { | ||
const pageName = list[p].title; | const pageName = list[p].title; | ||
wikidataDesc(pageName); | wikidataDesc(pageName); | ||
sum++; | //sum++; | ||
if (sum >= 199) { | //if (sum >= 199) { | ||
// console.log('last was: ', pageName); | |||
} | //} | ||
} | } | ||
}) | }) | ||
| שורה 29: | שורה 29: | ||
function wikidataDesc(page) { | function wikidataDesc(page) { | ||
const pageName = page.replace(/^רבי /, "")//.replace('איד', 'ייד')//.replace(/^הרב /, "").replace(/\"הייליגע\"/g, "הייליגע").replace('דעיוויד', 'דייוויד'); | const pageName = page//.replace(/^רבי /, "")//.replace('איד', 'ייד')//.replace(/^הרב /, "").replace(/\"הייליגע\"/g, "הייליגע").replace('דעיוויד', 'דייוויד'); | ||
$.ajax({ | $.ajax({ | ||
url: '//www.wikidata.org/w/api.php', | url: '//www.wikidata.org/w/api.php', | ||
| שורה 36: | שורה 36: | ||
'action': 'wbgetentities', | 'action': 'wbgetentities', | ||
'sites': "yiwiki", | 'sites': "yiwiki", | ||
'titles': pageName.replace("רוי:", ""),//.replace('מדינת ישראל', 'ישראל'), | 'titles': pageName,//.replace("רוי:", ""),//.replace('מדינת ישראל', 'ישראל'), | ||
'props': 'descriptions', | 'props': 'descriptions', | ||
'languages': 'he|en|de' | 'languages': 'he|en|de|yi' | ||
}, | }, | ||
dataType: 'jsonp', | dataType: 'jsonp', | ||
| שורה 84: | שורה 84: | ||
function addDesc(pageName, descriptions) { | function addDesc(pageName, descriptions) { | ||
var text = ''; | var text = ''; | ||
if ('yi' in descriptions) { | |||
text += 'יידיש=' + descriptions.yi.value + '|'; | |||
} | |||
if ('en' in descriptions) { | if ('en' in descriptions) { | ||
text += 'ענגליש=' + descriptions.en.value + '|'; | text += 'ענגליש=' + descriptions.en.value + '|'; | ||