/ Published in: JavaScript
Reload contents of all Wallabag 1.9.0 articles imported from Pocket (default importing tool didn't load content)
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
// dotjs: // https://github.com/defunkt/dotjs // "EXPORT YOUR WALLABAG DATA" JSON here var exported = []; $(function(){ // http://stackoverflow.com/a/4762297 function goTo(url) { var a = document.createElement("a"); if(!a.click) { //for IE window.location = url; return; } a.setAttribute("href", url); a.style.display = "none"; document.body.appendChild(a); a.click(); }; var id = parseInt(localStorage.getItem('id')); if(!id) { id = 0; } function reload_article(id) { if(id < 925) { // last article id (checked manually) if($.grep(exported,function(e){return parseInt(e.id) === parseInt(id);}).length) { localStorage.setItem('id',parseInt(id)+1); setTimeout(function(){ goTo('https://framabag.org/u/username/?action=reload_article&id='+id); },1000); } else { id++; reload_article(id); } } }; reload_article(id); });