RosettaCode貢獻記錄計數器

計算 section.mw-pager-body 中特定的 li 元素

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

作者
138 Aspen
今日安裝
0
安裝總數
2
評價
0 0 0
版本
1.0.2.2
建立日期
2024-02-12
更新日期
2025-06-01
尺寸
8.7 KB
授權條款
MIT
腳本執行於

RosettaCode Conribution Records Counter


           

               

Off-topic

Recently(2025-06-02), rosettacode has updated its domain name to rosettacode.miraheze.org

Edit, rosettacode.org domain is back, 2025-06-03.

As far as I know, Extension Proxy Omega can not resolve url redirecting issue.

   

To redirect all URLs from rosettacode.org to rosettacode.miraheze.org in Chrome, you can use a Chrome extension since Chrome doesn’t have built-in redirection features. Here’s how to do it:

Method: Use a Chrome Extension (e.g., Redirector)

  1. Set Up the Redirect Rule:

    • After installation, click the extension icon in Chrome’s toolbar and select “Redirector” or go to its settings via the Extensions menu.
    • In the Redirector interface, click “Create new redirect” or a similar option.
    • Configure the rule as follows:
      • Description: Name it, e.g., “RosettaCode Redirect.”
      • Example URL: Enter a sample URL, like http://rosettacode.org/wiki/Example.
      • Include pattern: Use a regular expression to match all rosettacode.org URLs, e.g.: ^(http|https)://rosettacode\.org/(.*)$ This matches http:// or https:// URLs starting with rosettacode.org and any path.
      • Redirect to: Enter the target URL pattern, e.g.: $1://rosettacode.miraheze.org/$2 Here, $1 keeps the protocol (http or https), and $2 keeps the original path.
      • Pattern type: Select “Regular Expression.”
      • Apply to: Check “Main window” and any other relevant options.
  2. Save and Test:

    • Save the rule, then visit a rosettacode.org URL (e.g., http://rosettacode.org/wiki/Example).
    • Chrome should redirect to rosettacode.miraheze.org/wiki/Example.
    • If it doesn’t work, double-check the regular expression or ensure the extension is enabled.

You can just use Tampermonkey script to do the same thing

// ==UserScript==
// @name              Rosetta Code Redirect
// @description       Auto redirect rosettacode.org to rosettacode.miraheze.org
// @author            aspen138
// @license           MIT
// @match             https://rosettacode.org/*
// @match             http://rosettacode.org/*
// @exclude-match     https://rosettacode.miraheze.org/*
// @exclude-match     http://rosettacode.miraheze.org/*
// @grant             none
// @run-at            document-start
// @icon              https://rosettacode.miraheze.org/favicon.ico
// ==/UserScript==

(() => {
    const currentUrl = window.location.href;

    // Defend in depth - don't redirect if already on miraheze
    if (currentUrl.includes('rosettacode.miraheze.org')) {
        return;
    }

    // Create the new URL by replacing the domain
    const newUrl = currentUrl.replace(
        /^(https?:\/\/)rosettacode\.org(\/.*)?$/,
        '$1rosettacode.miraheze.org$2'
    );

    // Redirect to the new URL
    if (newUrl !== currentUrl) {
        window.location.replace(newUrl);
    }
})();