swee / old SweeBot source code
0 likes
0 forks
2 files
Last active 2 months ago
Modified May 16, 2024. I have no idea where the resolver code is.
| 1 | import socket |
| 2 | import sys |
| 3 | import psutil |
| 4 | import subprocess |
| 5 | import requests |
| 6 | import platform |
| 7 | import distro |
| 8 | from time import sleep |
| 9 | busy = False |
| 10 | class bot_irc: |
swee / Image to IRC
0 likes
0 forks
1 files
Last active 2 months ago
Converts an image to half-block ascii art with IRC color codes. Uses some code from SCIFv1
| 1 | from PIL import Image |
| 2 | import requests |
| 3 | from io import BytesIO |
| 4 | imraw = requests.get("https://cdn.swee.codes/charimgs/altsweecat5.png").content |
| 5 | im = Image.open(BytesIO(imraw)).convert("RGBA") |
| 6 | if im.width > 64: |
| 7 | new_height = int((64 / im.width) * im.height) |
| 8 | im = im.resize((64, new_height)) |
| 9 | px = im.load() |
| 10 | sz = im.size |