Level 3 还差8天

简单摸了一个油猴脚本,请看

规则来自【新人请看】了解Discourse信任度

因为没办法获取到百天内的统计数据,所以用30天的代替

因为没办法获取到百天内的统计数据,所以用30天的代替

因为没办法获取到百天内的统计数据,所以用30天的代替

不要再吐槽数据不准确了 :smiling_face_with_tear:

数据来自 about
企业微信截图_1709780529380

V 50

脚本奉上,希望大佬们赶紧C个管理号出来

// ==UserScript==
// @name         Level 3 我来了
// @namespace    http://tampermonkey.net/
// @version      2024-03-06
// @description  try to take over the world!
// @author       wen
// @match        https://linux.do/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=linux.do
// @grant window.onurlchange
// @require https://scriptcat.org/lib/513/2.0.0/ElementGetter.js



// ==/UserScript==

(function() {
    'use strict';
    async function get_about(){

        let response = await fetch(`https://linux.do/about.json`, {
            "headers": {
                "Accept": "application/json",
                "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36"
            },
            "method": "Get",
        });
        let data =await response.json();
        return data;
    };
    function add_lv3_conditions(){
        elmGetter.get('li.stats-days-visited > div > span > span').then(div => {
            if(div.getAttribute("title")!=null){
                div.innerHTML = div.getAttribute("title") + " / " + need_days_visited;
            }
            else{
                div.setAttribute("title",div.innerHTML);
                div.innerHTML = div.innerHTML + " / " + need_days_visited;
            }
        });
        elmGetter.get('li.stats-posts-read > div > span > span').then(div => {
            console.log(div.getAttribute("title").replace(",",""));

            div.innerHTML = div.getAttribute("title").replace(",","") + " / " + Math.min(parseInt(parseInt(posts_30_days)/4),20000);
        });
        elmGetter.get('li.stats-topics-entered > div > span > span').then(div => {
            console.log(div.getAttribute("title").replace(",",""));
            div.innerHTML = div.getAttribute("title").replace(",","") + " / " + need_topics_read;
        });
        elmGetter.get('li.stats-likes-given>a > div > span > span').then(div => {
            if(div.getAttribute("title")!=null){
                div.innerHTML = div.getAttribute("title") + " / " + need_likes_given;
            }
            else{
                div.setAttribute("title",div.innerHTML);
                div.innerHTML = div.innerHTML + " / " + need_likes_given;
            }
        });
        elmGetter.get('li.stats-likes-received > div > span > span').then(div => {
            console.log(div.innerHTML);
            if(div.getAttribute("title")!=null){
                div.innerHTML = div.getAttribute("title") + " / " + need_likes_received;
            }
            else{
                div.setAttribute("title",div.innerHTML);
                div.innerHTML = div.innerHTML + " / " + need_likes_received;
            }
            
        });
        elmGetter.get('li.stats-post-count > a > div > span > span').then(div => {
            console.log(div.innerHTML);
            if(div.getAttribute("title")!=null){
                div.innerHTML = div.getAttribute("title") + " / " + need_posts_read;
            }
            else{
                div.setAttribute("title",div.innerHTML);
                div.innerHTML = div.innerHTML + " / " + need_posts_read;
            }
        });
    }
    let need_days_visited = 50;
    let need_topics_reply = 10;
    let need_topics_read = 500;
    let need_topics_read_alltime = 200;
    let need_posts_read = 10;
    let need_posts_read_alltime = 500;
    let need_likes_given = 30;
    let need_likes_received = 20;

    let topics_count,topics_last_day,topics_7_days;
    let posts_30_days;

    get_about().then((res)=>{
        console.log(res);
        posts_30_days = res.about.stats.posts_30_days;
        console.log(posts_30_days);
    });
    if (window.onurlchange === null) {
        // feature is supported

        window.addEventListener('urlchange', (info) => {
            var regex = /^https:\/\/linux\.do\/u\/[^\/]+\/summary$/;
            if(regex.test(info.url)){
                add_lv3_conditions();
            }

        });
    };
    add_lv3_conditions();
})();

修改
1、修复需要刷新才能显示
2、增加上限为20000

有大哥优化了一下样式。

样式优化

71 个赞

大佬好厉害

收到一个安全问题报告,紧急修一下。

22 个赞

水一下,给我爆金币

1 个赞

还是你水啊

1 个赞

你不水,我不水,linux.do 何时能发展

2 个赞

你这个V 50,怎么和我的有异曲同工之妙

5 个赞

:sweat_drops: :sweat_drops:,求求各位大佬点点赞

2 个赞

我还差10天

2 个赞


哦吼

28 个赞

那个已读帖子升三级最多只需要2w,有上限的

6 个赞

没太多细节。达标就好了

2 个赞

还是很容易达标的,主要是时间够就行了

3 个赞


整挺好,自己能看了,在右上方菜单的 总结 里,分子大于分母就能达到了

3 个赞

就在今天!就在今天!

12 个赞

自欺欺人尺.jpg :innocent:

3 个赞

感谢热佬,已经用上

2 个赞

秀哇,哈哈哈

2 个赞

我是多少级?2级把?

2 个赞

借个宝地留个截图用以比较一下楼上的标准:

2 个赞