Eyny

Simple Enhanced Feature of eyny.com

2017-02-25 या दिनांकाला. सर्वात नवीन आवृत्ती पाहा.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

You will need to install an extension such as Tampermonkey to install this script.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name        Eyny
// @namespace   yanagiragi
// @include     http://*.eyny.com/index.php
// @version     1.2
// @grant       none
// @require     https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js
// @description Simple Enhanced Feature of eyny.com
// ==/UserScript==

// Purpose : with entering "eyny.com", you will grant
// 1. new url with www****.eyny.com, to avoid imgur.com blocking www**.eyny.com
// 2. Already agreeed you are over 18 years old :)
// 3. No longer access homepage twice if you're trying to access some forums

const exclude = ['22']
//(function() {
    //'use strict';
      
      $('#hd').siblings()[2].innerHTML = "" // get rid of announcement since it may contain link to specific forum
    
      var forumId = []
      $.ajax({
          url : `http://${location.hostname}/forum.php?view=all`, 
          async: false,
          //headers: { 'Access-Control-Allow-Origin': '*' },
          method : "get"
      }).done(function(body){
        $(body).find('[href]').filter(function(){
          return this.href.match(/forum((-.)|(\.php\?view=all))/)
        }).each(function(index, value){
          forumId.push(value);
        })
      })
      
      $('[href]').filter(function(){ 
        return this.href.match(/forum((-.)|(\.php\?view=all))/)
      }).each(function(index, value){
        if(value == 'forum.php?view=all'){
           $(this).attr('href',`http://yrwww${Math.floor(Math.random() * 1000 + 1000)}.eyny.com/forum.php?mod=forumdisplay&fid=${forum[index]}&filter=author&orderby=dateline`)  
        }
        else{
          var fid = value.href.substring( value.href.lastIndexOf('forum-')+6,value.href.lastIndexOf('-'))
          if(exclude.indexOf(fid) == -1)
           $(this).attr('href',`http://yrwww${Math.floor(Math.random() * 1000 + 1000)}.eyny.com/forum.php?mod=forumdisplay&fid=${fid}&filter=author&orderby=dateline`)  
        }      
      })
      
      $("span[id*='category']").each(function(){
        $(this).prev().append('<a class="yrExpand" href="javascript: void(0);">Ep</a>')
      })

      $('.yrExpand').click(function(event){ 
        if($(event.target).parent().next().css('display') == 'none')
          $(event.target).parent().next().css('display','inline');
        else
          $(event.target).parent().next().css('display','none');
      })
//})();