User:Theleekycauldron/Scripts/PSHAW/dependencies/Hook.js: Difference between revisions

Content deleted Content added
oopsie
redo
Line 67:
}
tag_talk(article,file){
let res;
let today = new Date()
today = `${today.getUTCDate()} ${["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"][today.getUTCMonth()]} ${today.getUTCFullYear()}`
res = `{{DYK talk|${today}|entry=${this.hook}|${file}}}`
for (let credit of credits){
get_section([`Talk:${credit.article}`],"user|content",null,"older",0).then((talktext) => {
res = `{{DYK talk|${today}|entry=${this.hook}|${file}}}`
talktext += `\n${res}`
get_section([`Talk:${credit.article}`],"user|content",null,"older",0).then((talktext) => {
talktextvar params += `\n${res}`
varaction: params = {'edit',
actiontitle: 'edit'`Talk:${article}`,
summary: `Article appeared on [[WP:DYK|DYK]] on ${today}, adding {{[[Template:DYK talk|DYK talk]]}}`,
title: `Talk:${credit.article}`,
section: '0',
summary: `Article appeared on [[WP:DYK|DYK]] on ${today}, adding {{[[Template:DYK talk|DYK talk]]}}`,
sectiontext: '0'talktext,
textformat: talktext,'json'
}
format: 'json'
api.postWithToken( 'csrf', params );
}
})
api.postWithToken( 'csrf', params );
})
}
}