Skip to content

Instantly share code, notes, and snippets.

@kitce
kitce / bot.js
Created August 24, 2021 18:26
Popcat Bot
const app = document.querySelector('#app').__vue__;
let jwt, popCount = parseInt(localStorage.getItem('popCount') || 0);
// Maximum 800 pops in 30 seconds (limited by server-side)
async function send () {
try {
const recaptcha = await app.$recaptcha('pop');
jwt = jwt ? '&token=' + jwt : '';
const popURL = `https://stats.popcat.click/pop?pop_count=800&captcha_token=${recaptcha}${jwt}`;
const response = await fetch(popURL, { method: 'POST', mode: 'cors' });
@kitce
kitce / lihkg-show-quoted-message-info.user.js
Last active February 6, 2021 19:59
LIHKG - Show the information of the quoted message
// ==UserScript==
// @name LIHKG Show Quoted Message Info
// @namespace https://gist.github.com/kitce
// @version 0.7
// @description Show the information (e.g. message number, user, message time) of the quoted message on LIHKG
// @author kitce
// @include https://lihkg.com/*
// @require https://openuserjs.org/src/libs/sizzle/GM_config.js
// @grant GM_getValue
// @grant GM_setValue
@kitce
kitce / lihkg-text-to-image.user.js
Last active December 30, 2020 17:58
LIHKG - Convert text to image
// ==UserScript==
// @name LIHKG Text to Image
// @namespace https://gist.github.com/kitce
// @version 0.4
// @description Convert text to image on LIHKG
// @author kitce
// @include https://lihkg.com/*
// @grant none
// @run-at document-end
// ==/UserScript==
@kitce
kitce / install-chromium-widevine-cdm.sh
Created April 17, 2020 19:14
Chromium Widevine CDM Installer
#!/bin/bash -eux
# Replace with current Chromium version
_chrome_ver=$(chromium --version | grep -E -o "[0-9]+.*[0-9]+")
# Debian's Chromium has a patch to read libwidevinecdm.so in ~/.local/lib
# However, in 79 and newer, you must use the WidevineCdm directory instead of
# the libwidevinecdm.so file
#_target_dir=~/.local/lib/WidevineCdm
#_move_type=user_directory
# To have it accessible by all users, uncomment the below instead
@kitce
kitce / crx-unpack.sh
Last active April 17, 2020 19:16
Chrome extension unpacker
#!/usr/bin/bash
# Usage: crx-unpack.sh [extension]
#
# Dependencies:
# - crx-dl (https://gist.github.com/kitce/0f3ce27ddfa52b53f7532365235eaf99)
id=$1
crx-dl $1
@kitce
kitce / lihkg-label-users.user.js
Last active May 9, 2021 01:54
LIHKG - Label users
// ==UserScript==
// @name LIHKG Label Users
// @namespace https://gist.github.com/kitce
// @version 0.18
// @description Label users on LIHKG
// @author kitce
// @include https://lihkg.com/*
// @grant none
// @run-at document-start
// ==/UserScript==
@kitce
kitce / lihkg-post-templates.user.js
Last active December 30, 2020 17:57
LIHKG - Save/load post templates
// ==UserScript==
// @name LIHKG Post Templates
// @namespace https://gist.github.com/kitce
// @version 0.10
// @description Save/load LIHKG post templates
// @author kitce
// @include https://lihkg.com/*
// @grant none
// @run-at document-start
// ==/UserScript==
@kitce
kitce / lihkg-dont-push-post-reply-submit-button.user.js
Last active August 28, 2019 04:04
LIHKG - Make a "Don't-Push-Post-Reply Submit" button besides the "Submit" button
// ==UserScript==
// @name LIHKG Don't-Push-Post-Reply Submit Button
// @namespace https://gist.github.com/kitce
// @version 0.3
// @description Make a "Don't-Push-Post-Reply Submit" button besides the "Submit" button
// @author kitce
// @include https://lihkg.com/*
// @grant none
// @run-at document-end
// ==/UserScript==
@kitce
kitce / lihkg-show-user-info.user.js
Last active October 30, 2022 16:54
LIHKG - Show user information (e.g. user ID, registration time)
// ==UserScript==
// @name LIHKG Show User Info
// @namespace https://gist.github.com/kitce
// @version 0.16.0
// @description Show the user information (e.g. user ID, registration date) in each reply
// @author kitce
// @include https://lihkg.com/*
// @grant none
// @run-at document-end
// ==/UserScript==
@kitce
kitce / crx-dl.sh
Last active May 26, 2021 17:01
Chrome extension downloader
#!/bin/zsh
# Usage: crx-dl [extension]
#
# Dependencies:
# - chromium
id=$1
version=$(chromium --version | grep -E -o "[0-9]+.*[0-9]+")