Skip to content

Instantly share code, notes, and snippets.

# closedpizza-authorization.rb - mruby handler to check if all clients
# have accounts on closed.pizza, checked via ip address and result kept with lrucache
# there is also a redis class in h2o mruby but it probably isn't worth using
# to change returned status code/response for unauthorized users, see end of call method
# paths:
# /:
# mruby.handler-file: /path/to/closedpizza-authorization.rb
#!/bin/sh
# This script scrapes Crunchyroll to get an m3u8 and caption file.
# It then uses ffmpeg to download + mux it all into a single mp4.
# It uses awk for EVERYTHING. Sorry? I really wanted to use Python or something
# but that would make it into just a Python thing, or Node or whatever.
# This was painful though because I hate awk.
# See if argv has enough params
if [ $# -lt 2 ]; then
package main
import (
// lol kekekekekekkekekek
"github.com/valyala/fasthttp"
// Make an upload signature
"time"
"strconv"
"crypto/sha1"
@ariankordi
ariankordi / arman.py
Last active November 19, 2018 23:15
A script that just creates a post to indigo.cafe, and requires a login token
#!/bin/python3
# requirements: hyper selectolax
from sys import exit
from ssl import CERT_NONE
try:
import hyper
@ariankordi
ariankordi / librespot-download.go
Last active November 19, 2018 22:55
downloads track(s) (plural) from spotify (premium) with librespot LO LOLOLOLOLLO OLOLOLLOLLOLOOLLOLOOLOLOLOOLOLOLOLOLO
package main
// AS OF this being posted, librespot-golang has some deadlocking and you will need to use this fork: https://github.com/benpye/librespot-golang
import (
"Spotify"
"librespot"
"librespot/core"
"librespot/utils"
@ariankordi
ariankordi / closedverse-deadness.go
Last active September 10, 2018 22:58
A Go script that extracts the "x minutes ago", "x hours ago", etc text from Miiverse clones like https://cedar.doctor/titles/1, then averages them out and sees the average seconds between each post. Might be broken if these sites are down or IPs are just dead.
package main
import (
// requests
"github.com/valyala/fasthttp"
// for spltting bytes
"bytes"
// for getting the things from the thing
"regexp"
@ariankordi
ariankordi / adsense.go
Last active September 10, 2018 22:55
A little Go script that gets the AdSense revenue you have this month
package main
import (
"github.com/valyala/fasthttp"
"bytes"
"fmt"
)
package main
import (
// fasthttp doesn't like cookies on the client so we can't use it
"net/http"
"net/http/cookiejar"
"net/url"
"github.com/PuerkitoBio/goquery"
"io/ioutil"
@ariankordi
ariankordi / miiverse.py
Last active August 30, 2017 05:26
Yet another script to get someone's info from Miiverse BUT THEN returning as JSON
#!/usr/bin/python
from lxml import html
import urllib.request, urllib.error, sys, json
if not len(sys.argv) > 1:
print('Usage: %s [username]' % sys.argv[0])
sys.exit(1)
username = sys.argv[1]
try:
req = urllib.request.urlopen('https://miiverse.nintendo.net/users/{}/favorites?locale.lang=en-US'.format(username))
@ariankordi
ariankordi / mii.py
Created July 30, 2017 11:59
Little script to get a Mii from an NNID using miiverse.nintendo.net (and lxml + urllib)
from lxml import html
from urllib.request import urlopen
import sys
if not sys.argv[1]:
print("UsagE: " + sys.argv[0] + " [NNID to get Mii from]")
ftree = html.fromstring(urlopen('https://miiverse.nintendo.net/users/{0}/favorites'.format(sys.argv[1])).read())
miihash = ftree.xpath('//*[@id="sidebar-profile-body"]/div/a/img/@src')[0].split('.net/')[1].split('_n')[0]
screenname = ftree.xpath('//*[@id="sidebar-profile-body"]/a/text()')[0]