Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name 题单页面 - DS
- // @namespace http://tampermonkey.net/
- // @version 2024-04-23
- // @description try to take over the world!
- // @author You
- // @match https://leetcode.cn/circle/discuss/*
- // @icon https://www.google.com/s2/favicons?sz=64&domain=leetcode.cn
- // @grant none
- // ==/UserScript==
- (function() {
- 'use strict';
- var delayFn = function() {
- const qs = document.querySelectorAll('div[class="e2v1tt3 css-1ayia3m-MarkdownContent"] ul li a');
- const all = [];
- if (qs) {
- qs.forEach(function(v) {
- if (v.href.startsWith('https://leetcode') && /\. /g.test(v.textContent)) {
- all.push({title: v.textContent, src: v.href})
- } else {
- console.log(v.textContent, v.href);
- }
- })
- }
- console.log(JSON.stringify(all, null, 2));
- console.log('总数:', all.length);
- };
- setTimeout(delayFn, 10000);
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement