Contenuto cancellato Contenuto aggiunto
Riga 217:
<pre>
for n in {1..14}; do djvm -d titolo.djvu 1; echo $n; done
</pre>
 
Scaricare una serie di file dai [https://commons.wikimedia.org/w/index.php?target=Candalua&namespace=all&tagfilter=&newOnly=1&start=&end=&limit=50&title=Special%3AContributions miei caricamenti recenti su Commons]:
<pre>
function forceDownload(url, fileName){
// fileName = url.substring(url.lastIndexOf('/')+1, url.length);
var xhr = new XMLHttpRequest();
xhr.open("GET", url, true);
xhr.responseType = "blob";
xhr.onload = function(){
var urlCreator = window.URL || window.webkitURL;
var imageUrl = urlCreator.createObjectURL(this.response);
var tag = document.createElement('a');
tag.href = imageUrl;
tag.download = fileName;
document.body.appendChild(tag);
tag.click();
document.body.removeChild(tag);
}
xhr.send();
}
 
$('.mw-contributions-title').each(function() {
title = $(this).attr('title');
$.ajax({
url: '/w/api.php?action=query&format=json&prop=imageinfo&iiprop=url&titles=' + title,
}).done(function(response) {
for (const [key, value] of Object.entries(response.query.pages)) {
imageurl = value.imageinfo[0].url;
imagetitle = value.title.replace('File:', '').replace(/ /g, '_');
console.log(imageurl);
console.log(imagetitle);
forceDownload(imageurl, imagetitle);
}
});
})
</pre>