Advertisement
overloop

pixiv.js

Sep 7th, 2015
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name        pixiv
  3. // @namespace   mugiseyebrows.ru
  4. // @include     http://www.pixiv.net/
  5. // @version     1
  6. // @grant       none
  7. // ==/UserScript==
  8.  
  9. function loadjs(src,onload){
  10.   var e = document.createElement('script');
  11.   e.setAttribute("type","text/javascript");
  12.   e.setAttribute("src", src);
  13.   e.onload = onload;
  14.   document.getElementsByTagName("head")[0].appendChild(e);
  15. }
  16.  
  17. function appendImage(i) {
  18.   console.log('appendImage');
  19.   if (i>1) {
  20.     $(images[Math.floor(Math.random()*images.length)]).appendTo('body');
  21.     setTimeout(appendImage.bind(this,i-1),800);
  22.   }
  23. }
  24.  
  25. $(document).ready(function(){
  26.   console.log('$(document).ready');
  27.   $('<li class="bookmarks"><a href="#" id="my-images"><i class="_icon sprites-bookmarks"></i>img</a></li>').appendTo( '.navigation-list ul' );
  28.   $('nav.navigation-list').css('font-size','11px')
  29.  
  30.   $('#my-images').click(function(){
  31.     $('body').html('');
  32.     loadjs('http://mugiseyebrows.ru/pixiv/data.js',appendImage.bind(this,300));  
  33.     return false;
  34.   });
  35.  
  36. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement