7sIV799F

2ch pastebin

Apr 7th, 2015
254
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name       2ch pastebin
  3. // @version    0.2.2
  4. // @match      https://2ch.hk/*
  5. // ==/UserScript==
  6.  
  7. $('.posts').bind('DOMSubtreeModified', function() {
  8.   $('a[href^="http://pastebin.com/"]').each(function() {
  9.     var id = this.href.match(/pastebin\.com\/(\w+)/)[1];
  10.  
  11.     if (!id || $(this).next().is('.pastebin')) return;
  12.  
  13.     $('<div>', {
  14.       class: 'pastebin',
  15.       html: $('<iframe>', {
  16.         src: 'https://pastebin.com/embed_iframe.php?i=' + id,
  17.         style: 'border:none; width:800px; height:500px'
  18.       })
  19.     }).insertAfter(this);
  20.   });
  21. });
Advertisement
Comments
  • lg144ds
    3 years
    1
    1. // ==UserScript==
    2. // @name       2ch pastebin
    3. // @version    0.2.2
    4. // @match      https://2ch.hk/*
    5. // ==/UserScript==
    6.  
    7. $('.posts').bind('DOMSubtreeModified', function() {
    8.   $('a[href^="http://pastebin.com/"]').each(function() {
    9.     var id = this.href.match(/pastebin\.com\/(\w+)/)[1];
    10.  
    11.     if (!id || $(this).next().is('.pastebin')) return;
    12.  
    13.     $('<div>', {
    14.       class: 'pastebin',
    15.       html: $('<iframe>', {
    16.         src: 'https://pastebin.com/embed_iframe.php?i=' + id,
    17.         style: 'border:none; width:800px; height:500px'
    18.       })
    19.     }).insertAfter(this);
    20.   });
    21. });
Add Comment
Please, Sign In to add comment