97d

叮当社区辅助工具

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

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

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

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

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==UserScript==
// @name         97d
// @namespace    叮当社区
// @version      0.1.1
// @description  叮当社区辅助工具
// @author       You
// @match        http*://d66e.com/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=d66e.com
// @require      https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js
// @grant        none
// @license MIT
// ==/UserScript==

jQuery(function() {
    var res = '';
    var urls = jQuery('a.s.xst');
    var s_urls = [];
    var defer = jQuery.Deferred();

    for (i = 0; i < urls.length; i++) {
        console.log(i);
        var url = urls[i].href;
        s_urls.push(url);
    }
    //这一步必须要写,要不然下面的then无法使用
    defer.resolve(jQuery("#content_2015195").append(""));
    jQuery.each(s_urls, function(i, e) { //i 是序列,e是数值
        defer = defer.then(function() {
            return jQuery.ajax({
                url: e,
                method: 'get',
                success: function(data) {
                    res = data.match(/class\=\"zoom\"\ src\=\"(.*?)\"\ onmouseover/i);
                    if (res !== null) {
                        console.log(e + '------' + res[1]);
                   jQuery('a.s.xst').eq(i).append('\n <img src="'+res[1]+'" width=500 />');
                    } else {
                        res = data.match('file="(.*?)" class="zoom" ');
                        if (res !== null) {
                            jQuery('a.s.xst').eq(i).append('\n <img src="'+res[1]+'" width=500 />');
                        }
                    }
                }
            })
        });
    });
    defer.done(function() {
        jQuery("#content_2015195").append("ajax全部执行完成<br/>")
    });
})