Skip to content

Instantly share code, notes, and snippets.

View Sasquire's full-sized avatar
💭
Alive

Sasquire

💭
Alive
View GitHub Profile
@Sasquire
Sasquire / markov_maker.js
Last active February 15, 2019 06:25
Takes a file with a list of sentences that are separated by newlines where words are space delimited. This assumes the file only has characters ` A-z0-9 ` and ` <>~#$%^&()-_=+/ ` and ` ' " `
const fs = require('fs');
const all_lines = fs.readFileSync('./forums_but_nice.txt', 'utf8')
.slice(0, -1)
.split('\n')
.map(e => e.split(' ').map(p => p.toLowerCase()));
const all_words = {};
all_lines.forEach(line => line.forEach(word =>
all_words[word] ? all_words[word]++ : all_words[word] = 1
));
@Sasquire
Sasquire / e621_elo_compare.user.js
Last active July 10, 2019 04:20
A quick something to compare posts with an elo rating to try and find what your favorite is.
// ==UserScript==
// @name e621 elo compare
// @namespace http://tampermonkey.net/
// @version 1.00001
// @description try to take over the world!
// @author Sasquire
// @match https://e621.net/extensions/post_elo
// @match http://e621.net/extensions/post_elo
@Sasquire
Sasquire / e621_post_merger.user.js
Created August 10, 2019 04:26
a quick little program that will add a box and two fields so you can easily merge the tags, sources, description, and flag one as inferior to the other.
// ==UserScript==
// @name e621 post merger
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://e621.net/post/show/*
// @grant GM.setValue
// @grant GM.getValue
// ==/UserScript==
@Sasquire
Sasquire / Identify_from_favorites.js
Created February 14, 2020 17:03
This is a quick program that can be used to identify users based on two or more posts from their favorites.
const request = require('request');
async function find_users(id){
const options = {
url: `https://e621.net/favorite/list_users.json?id=${id}`,
headers: {
'User-Agent': 'Identify users from favorites/v1.0'
}
};
return new Promise((resolve, reject) => {
@Sasquire
Sasquire / User_set_info.js
Created February 14, 2020 17:59
A simple script that will download information about sets and determine the user who owns the most sets.
const fs = require('fs');
const request_main = require('request');
function request(url) {
let options = {url:url, headers: { 'User-Agent': 'Downloading user set information' }};
console.log(options);
return new Promise(function (resolve, reject) {
request_main(options, function (error, res, body) {
console.log(res.statusCode);
if (!error && res.statusCode == 200) {
// ==UserScript==
// @name Highlight blacklist tags
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://e621.net/post/show/*
// @grant none
// ==/UserScript==
@Sasquire
Sasquire / e621_thread_hider.user.js
Created April 14, 2020 21:53
A simple userscript that can hide forum threads.
// ==UserScript==
// @name e621 Thread hider
// @namespace https://github.com/sasquire
// @version 0.00001
// @description Allows the ability to hide forum threads
// @author Sasquire
// @match *://*.e621.net/forum_topics
// @match *://*.e621.net/forum_topics?*
// @grant GM.getValue
// @grant GM.setValue

If you happen to have a large collection of images, tagged with artists, from another site, then it could be possible to search for the image on e621 and potentially apply the artist tag. The same holds for character tags, assuming artists and character owners post images they have made or comissioned on these sites. This fails if other people start uploading the same images, such as a specialized fetish-reposting account.

This repository contains some of the tools needed to do this matching on Furaffinities site.

character_artist_tags_by_post.json is a file produced by the sql

select post_id, tag_name, tag_type from (
	select unnest(tags) as tag_name, post_id, row_number() over (partition by post_id order by change_seq desc)

MD5 Sum

I wanted a public domain md5-sum utility so I could include it in other projects and have them be entirely public domain. To do this I extended code by Luigi Galli and updated much of it to be what I consider more readable.

Some documentation on the MD5 algorithm can be found here.

How to use

const md5_sum = require('./md5.js');

E621 Extensions Setting Page

This is supposed to be a universal settings-page utility for userscripts on e621. Designed to be simple, quick, and useful, I hope that this script can be integrated with other scripts and achieve a unified feel of userscripts on e621.

How to use

You can include this script in your userscript either by (I) copy-pasting it. (II) Using @require in your userscript's header. (III) Compiling this file into your userscript directly.

Once loaded, you can write custom settings like so