summaryrefslogtreecommitdiff
path: root/docs/random/xkcdbot.md
blob: 48d75ff85154ac87af6499423e0fda1804f677be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# xkcdbot

First version 2022-11-29

Updated 2023-12-15

![A Mastodon post with comic number, title, title text, xkcd.com URL and
explainxkcd URL; a reply below reads "Heads-up for my subscribers:" then
a bunch of users](img/xkcdbot/post.png)

## Birth

Back in 2019, I signed up for a Mastodon account on mastodon.technology.
Soon I began looking around for xkcd bots. There were several, but most of
them were defunct. I would soon make up my mind to create my own.

I have little memory, but per the
[git log](https://github.com/fakefred/xkcdbot/commits/master) I finished
it in 9 days. It ran on Node.js, which unfortunately was my favorite tech
stack back then.

I registered [@xkcdbot@botsin.space](https://botsin.space/@xkcdbot), then
daemonized the bot on the same server I hosted my comics (which, for which
I apologize, was also on a Node.js server). I wrote this bio:

>I'm an xkcd bot who shows up at Randall's house at 3.3 millihertz and
>asks "Hello, did you publish a new comic?" I occasionally dress like
>a velociraptor just to freak him out.

>If he admits he has drawn a new comic, I seize it and post it right here
>before Randall shoots me down with a drone.

## Rise

The bot account was created on 2019-08-19.

On 2022-10-28, xkcdbot gained 1k followers. It took 1166 days.

On 2022-11-23, the number grew to 2k. It only took 26 more days.

Of course, the surge owes to Elon Musk for pissing off so many people off
Twitter, but I'm sure there are two more reasons as well:

### Killer features

- 5 minute polling interval
- explainxkcd link
- DM for "subscribers"
- Comic thumbnail is focused on top left, so no spoilers

![Only the left-hand side of the comic is shown in the preview](img/xkcdbot/thumbnail.png)

### Administration

The bot lives by a few simple rules. It:

- does its damn job
- has near-perfect uptime
- never solicits followers
- never interacts with people unless asked to
- has no new features for three years

## Accidents

My code broke in production exactly once. There were other accidents, but
they were all due to botsin.space downtime or Randall uploading the wrong
comic.

## Conclusion

I believe this resolves all remaining questions on this topic. No further
research is needed.

## Update (2023-10-22)

It turns out this does not resolve all remaining questions on this topic,
and further research is needed.

The problem is accessibility. On xkcd.com, if you hover your mouse on the
comic, a tooltip shows up. This is known as "hover text" or "title text",
which uses the "title" HTML attribute. In 2019 I wanted to create
a similar experience, so I put it in the alt text.

However it wasn't the intended purpose. The alt text is meant for:

- A replacement when the image cannot be displayed
- Assistive technology such as screen readers

On the fediverse it's mostly the latter. Right now, the awesome [Sam
Levine](https://botsin.space/@SRLevine@urbanists.social) is doing the
noble work of replying to every post with a captioned version of the same
comic.

But it is a workaround. Around my reluctance to touch my rotten codebase,
my incompetence as a developer, and my lack of interest to caption the
comics myself. Whenever I post on my main handle, I make sure to caption
my images and audio. But sadly xkcdbot cannot do that right now.

> Why not?

Because Randall doesn't caption comics when they are posted.

> Can't you fetch the caption from explainxkcd?

That might take hours before it's ready. Plus, caption might be incomplete
and susceptible to vandals.

> Just delay the post until the caption is ready!

We don't know how long it will take. Also, I created the bot in order to
read xkcd as soon as possible. I cannot accept the delay.

> Just edit the post!

I made the bot in 2019, when "edit" wasn't a thing. I _could_ make this
feature right now, but I haven't touched my codebase for 4 years, and
I don't use Node.js anymore.

## Conclusion

Accessibility for a bot is not an easy task. It's not a tech problem; it's
a matter of community. I admit I cannot solve it by myself. Therefore,
I am going to ask for the community for help.

To be continued.

## Update (2023-10-25)

This is fire! I reached out to Sam Levine, who agreed to co-maintain
xkcdbot and provide alt text with Mastodon's edit feature.

I had intended to send a PGP-encrypted email, but Sam does not have that
or any E2EE. So after consideration, I committed the cardinal sin of
cybersecurity: I sent him* the password in plaintext via email.

_i realized later that he/him might not be the best pronoun but they said
they're okay with any. i really oughtta be careful next time_

Say what you will but a bot that posts comics is just too trivial for
a lecture on asymmetric key cryptography. Like sure a hacker could get
access to the bot. Now what? They lock me and Sam out of it?

- If they violate the TOS, we can certainly report it
- If they make it obvious that the account's been hacked, people would
  know
- If they don't, they are impersonating us, which is pretty impressive
  given they are doing two people's jobs in one

I will now contact botsin.space's admin to know if we can recover the bot
in case that happens, but I doubt it ever will.

Update same day: Colin (botsin.space admin) said yes 🔥