Reload all Wallabag articles content


/ Published in: JavaScript
Save to your folder(s)

Reload contents of all Wallabag 1.9.0 articles imported from Pocket (default importing tool didn't load content)


Copy this code and paste it in your HTML
  1. // dotjs:
  2. // https://github.com/defunkt/dotjs
  3.  
  4. // "EXPORT YOUR WALLABAG DATA" JSON here
  5. var exported = [];
  6.  
  7. $(function(){
  8. // http://stackoverflow.com/a/4762297
  9. function goTo(url) {
  10. var a = document.createElement("a");
  11. if(!a.click) { //for IE
  12. window.location = url;
  13. return;
  14. }
  15. a.setAttribute("href", url);
  16. a.style.display = "none";
  17. document.body.appendChild(a);
  18. a.click();
  19. };
  20. var id = parseInt(localStorage.getItem('id'));
  21. if(!id) {
  22. id = 0;
  23. }
  24. function reload_article(id) {
  25. if(id < 925) { // last article id (checked manually)
  26. if($.grep(exported,function(e){return parseInt(e.id) === parseInt(id);}).length) {
  27. localStorage.setItem('id',parseInt(id)+1);
  28. setTimeout(function(){
  29. goTo('https://framabag.org/u/username/?action=reload_article&id='+id);
  30. },1000);
  31. } else {
  32. id++;
  33. reload_article(id);
  34. }
  35. }
  36. };
  37. reload_article(id);
  38. });

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.