PT 站自动签到

PT 站自动签到-

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         PT 站自动签到
// @namespace    http://tampermonkey.net/
// @version      1.0.8
// @description  PT 站自动签到-
// @author       iuroc
// @match        *://1ptba.com/*
// @match        *://52pt.site/*
// @match        *://pt.soulvoice.club/*
// @match        *://www.pttime.org/*
// @match        *://rousi.zip/*
// @match        *://hdpt.xyz/*
// @match        *://carpt.net/*
// @match        *://ptvicomo.net/*
// @match        *://hdfans.org/*
// @match        *://www.hdkyl.in/*
// @match        *://hdhome.org/*
// @match        *://raingfh.top/*
// @match        *://hdchina.org/*
// @match        *://pterclub.com/*
// @match        *://lemonhd.org/*
// @match        *://www.pthome.net/*
// @match        *://pt.btschool.club/*
// @match        *://www.hddolby.com/*
// @match        *://hdzone.me/*
// @match        *://hddisk.life/*
// @match        *://discfan.net/*
// @match        *://www.hdarea.co/*
// @match        *://hdcity.city/*
// @match        *://dhcmusic.xyz/*
// @match        *://totheglory.im/*
// @match        *://www.nicept.net/*
// @match        *://yingk.com/*
// @match        *://hdstreet.club/*
// @match        *://moecat.best/*
// @match        *://pt.hd4fans.org/*
// @match        *://www.haidan.video/*
// @match        *://hdtime.org/*
// @match        *://audiences.me/*
// @match        *://*.tjupt.org/*
// @match        *://*.oshen.win/*
// @match        *://*.sharkpt.net/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=1ptba.com
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    // 当日最新的键名
    const date = new Date()
    const key = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}-qiandao`
    // 象岛专属,判断当日是否已经签到
    if (localStorage.getItem(key) == 'true' && location.hostname == 'ptvicomo.net') return
    // 52 PT 专属,防止多次刷新
    if (location.pathname == '/bakatest.php') return
    // 象岛专属,添加当日最新签到记录
    if (location.hostname == 'ptvicomo.net') {
        // 清除往日签到记录,准备添加当日最新签到记录
        for (let i = 0; i < localStorage.length; i++) {
            const key = localStorage.key(i)
            if (key.match(/^\d{4}-\d{1,2}-\d{1,2}-qiandao$/)) localStorage.removeItem(key)
        }
        localStorage.setItem(key, true)
    }
    [...document.querySelectorAll('a')].filter(e => e.textContent.match(/签到.魔力|每日签到/) && (!!(e.offsetParent) || location.hostname == 'ptvicomo.net')).forEach(e => e.click())
})();