Created
February 4, 2024 22:50
-
-
Save EllieTheYeen/f3f15a14dc3bbf1ba70d5b7ba3ad5f0e to your computer and use it in GitHub Desktop.
Just a thing to sort profile pictures for the plot thread to track where it last was
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
os.chdir(os.path.split(__file__)[0] or ".") | |
files = os.listdir("pfps") | |
fates = [] | |
for a in files: | |
r = os.stat(os.path.join("pfps", a)) | |
fates.append((a, r.st_mtime)) | |
fates.sort(key=lambda x: x[1]) | |
print(fates) | |
with open("pfplog.txt", "w") as f: | |
f.write("\n".join(f[0].rsplit(".", 1)[0] for f in fates)) | |
f.write("\n") | |
bsky = [] | |
twit = [] | |
mast = [] | |
for name, time in fates: | |
name: str = name.rsplit(".", 1)[0] | |
if name.startswith("@"): | |
mast.append(name) | |
elif name.count(".") > 0: | |
bsky.append(name) | |
else: | |
twit.append(name) | |
with open("pfplog_nast.txt", "w") as f: | |
f.write("\n".join(mast)) | |
f.write("\n") | |
with open("pfplog_bsky.txt", "w") as f: | |
f.write("\n".join(bsky)) | |
f.write("\n") | |
with open("pfplog_twit.txt", "w") as f: | |
f.write("\n".join(twit)) | |
f.write("\n") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment