Skip to content

Instantly share code, notes, and snippets.

View purarue's full-sized avatar

purarue

View GitHub Profile
#!/bin/bash
# pass 'manga' as the first arg to the script to scrape manga instead
# requires https://github.com/ericchiang/pup to be installed
sort_by_id() {
sort -n -t= -k 2
}
scrape_type="${1:-anime}"
case "${scrape_type}" in
@purarue
purarue / anilist_413.py
Last active May 17, 2021 07:17
cleans up my MAL export so thats its importable to anilist
#!/usr/bin/env python3
# cleans up my MAL export according to this thread:
# https://anilist.co/forum/thread/3291
# so that its importable
# otherwise the graphql error fails with a 413 request entity too large
# since the anilist page just inlines the XML contents into the gql query
import sys
import typing
from pathlib import Path
/home/username/.config/i3blocks/blocks/b-todo:14:chomp <"${TODO_DIR}/todo.txt" | wc -l
/home/username/.config/yadm/android_bootstrap:82:havecmd chomp || go install github.com/purarue/chomp@latest
/home/username/.config/yadm/package_lists/go_packages.txt:13:chomp github.com/purarue/chomp
/home/username/.local/scripts/linux/colorize_number:7:NUM="${1:-$(chomp | tr -d "\n")}"
/home/username/.local/share/shortcuts/group-and-termgraph:4:chomp | sort | uniq -c | awk '{print $2 " " $1}' | termgraph | chomp | awk '{print $NF,$0}' | sort -n | cut -f2- -d' '
/home/username/.local/share/shortcuts/moviesearch:3:SEARCH_STR=$(input-dialog "Search for a movie > " | chomp | tr " " "+")
/home/username/.local/share/shortcuts/moviesearch-letterboxd:3:[ -z "$SEARCH_STR" ] && SEARCH_STR=$(input-dialog "Search for a movie > " | chomp | tr " " "+")
/home/username/.local/share/shortcuts/moviesearch-trakt:3:[ -z "$SEARCH_STR" ] && SEARCH_STR=$(input-dialog "Search for a movie > " | chomp | tr " " "+")
/home/username/.local/share/shor
diff --git a/my/discord.py b/my/discord.py
index 15730f6..6a7e1f6 100644
--- a/my/discord.py
+++ b/my/discord.py
@@ -3,6 +3,8 @@ Discord Data: messages and events data
"""
REQUIRES = [
"git+https://github.com/purarue/discord_data",
+ "mistletoe",
+ "urlextract",
<li data-sources="promnesia_pura.sources.discord"><div><span id="relative_indicator"><a href="https://myanimelist.net/profile/purplepinapples">➤➤</a></span><span><span class="index" title="index (for easier match against highlights)">5</span><span class="src promnesia_pura_sources.discord">promnesia_pura.sources.discord</span></span><span class="datetime" title="search around"><span class="time">19:23</span><span class="date">21 May 2020</span></span></div><div class="context">any IP I spin up to try and get a request from getts
```
curl '<a href="https://myanimelist.net/profile/purplepinapples">https://myanimelist.net/profile/purplepinapples</a>' -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:77.0) Gecko/20100101 Firefox/77.0' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' -H 'Accept-Language: en-US,en;q=0.5' --compressed -H 'Referer: <a href="https://myanimelist.net/">https://myanimelist.net/</a>' -H 'Connection: keep-alive' -H 'Cookie: MALSESSIONID=MALHLOGSESSI
@purarue
purarue / projects_000001.json
Last active October 29, 2024 22:06
projects_000001.json
[
{
"type": "project",
"url": "https://github.com/purarue/albums/projects/1",
"owner": "https://github.com/purarue/albums",
"creator": "https://github.com/purarue",
"name": "albums",
"body": "",
"number": 1,
"public": true,
@purarue
purarue / hpi_doctor.log
Last active October 29, 2024 22:08
HPI_LOGS=debug
✅ OK : my.body
✅ - stats: {'teeth': {'count': 15}, 'shower': {'count': 1}, 'weight': {'count': 10}}
✅ OK : my.browsing
[D 201021 12:36:37 save_hist:66] backing up /home/username/.mozilla/firefox/lsinsptf.dev-edition-default/places.sqlite to /tmp/tmp_0kp6_x9/places-20201021193637.sqlite
[D 201021 12:36:37 save_hist:70] done!
[D 201021 12:36:37 merge_db:48] merging information from 4 databases...
[D 201021 12:36:37 parse_db:69] Parsing visits from /home/username/data/firefox/dbs/places-20200828223058.sqlite...
[D 201021 12:36:37 parse_db:88] Parsing sitedata from /home/username/data/firefox/dbs/places-20200828223058.sqlite...
[D 201021 12:36:38 parse_db:69] Parsing visits from /home/username/data/firefox/dbs/places-20200919030959.sqlite...
[D 201021 12:36:39 parse_db:88] Parsing sitedata from /home/username/data/firefox/dbs/places-20200919030959.sqlite...
@purarue
purarue / not_in_playlist.bash
Last active October 29, 2024 22:05
Lists abums not in any of my playlists https://github.com/purarue/plaintext-playlist
#!/bin/bash
# lists any songs in my music folder that aren't in any playlists
# https://github.com/purarue/plaintext-playlist
# get list of all songs
ALL_SONGS="$(plainplay listall "$(plainplay playlistdir)"/*)"
# move to my music directory
cd "$PLAINTEXT_PLAYLIST_MUSIC_DIR" || {
echo "Couldn't cd to music directory" 1>&2
@purarue
purarue / httpx.patch
Created October 15, 2020 03:57
ghexport httpx patch
diff --git a/src/ghexport/dal.py b/src/ghexport/dal.py
index 200a432..a3c78d6 100755
--- a/src/ghexport/dal.py
+++ b/src/ghexport/dal.py
@@ -10,7 +10,7 @@ from .exporthelpers import dal_helper, logging_helper
from .exporthelpers.dal_helper import PathIsh, Json
-logger = logging_helper.logger('ghexport')
+logger = logging_helper.logger('ghexport', level='INFO')
@purarue
purarue / hpi_doctor.txt
Last active October 29, 2024 22:09
HPI doctor output after merge
✅ config file: /home/username/.config/my/my/config/__init__.py
✅ mypy config check: success
Success: no issues found in 4 source files
✅ OK : my.body
✅ - stats: {'teeth': {'count': 5}, 'shower': {'count': 1}, 'weight': {'count': 7}}
✅ OK : my.browsing
✅ - stats: {'history': {'count': 120594}}
✅ OK : my.coding
✅ - stats: {'commits': {'count': 5147}, 'repos': {'count': 118}}
✅ OK : my.facebook