Working through a book on modding Minecraft with the kiddo. It knows its target audience: the first few lessons are all about explosions!

It’s written for 1.8, which is a problem because a lot of the structure has changed between then and 1.12, but a decent IDE with auto complete and a sense of common naming schemes has made it relatively easy to adapt the simple lessons so far. We’ll see how well that works as they get more complicated.

Back when I was comparing social media archives, I considered resurrecting my old LOLspam project as a Mastodon bot. I never quite got around to it, partly because I was able to do most of what I wanted to automate using IFTTT, so I stopped investigating that last 5%.

Last night, I threw together a quick and dirty bot to post a random item from a text file in about 20 minutes.

Then I spent three hours going through the Twitter archive for @LOL_Spam, pulling out jokes that are too dated or cringeworthy. (I hope I didn’t miss any. It was midnight by the time I finished, and I was really tired!)

This morning I modified the script to take a second file as a queue for new items.

  • I can add new items to the queue file as I find them.
  • It’ll post from the queue on a schedule (using cron).
  • When it uses up the queue, it returns to posting random posts from the archive.

If you’re interested in funny/odd spam subjects (and you’re OK with swearing and occasional lewdness), check out @LOLspam@BotsIn.Space. You can follow from any Mastodon or other Fediverse account.

The script itself is called fedbotrandom. I wrote it in Perl, using text files, so I could just put it in cron on any *nix box instead of worrying about language/database support or installing a runtime or DB engine. I’ve made it really simple on purpose, and while I do plan on writing some better error handling when I have time, it’s already more complex than I wanted it to be!

Kiddo’s been wanting to learn programming, with the ultimate goal of modding Minecraft. We’ve done some Ruby, but he’s impatient, so last night I we started Java with a simple program that repeats a println X times.

He wanted to pass it the integer limit.

After a few minutes, I suggested we watch a movie and check back later.

After dinner, he decided to stop it and we timed some shorter runs.

I think he has a better understanding of scale now!

It’s a trending topic, but there’s a lot of misunderstanding about the Twitpocalypse. Here’s what’s going on, in layman’s terms (I hope).

What’s happening?

  1. Every Twitter post has an ID number that goes up by 1 each time.
  2. When a computer program stores a number, it sets aside a certain amount of space for it. Bigger numbers take more space because they have more digits.
  3. One common format is called a “signed integer.” It has 32 binary digits (1 or 0 only) with one digit set aside to indicate a minus sign. The biggest number it can store is 2,147,483,647.
  4. Twitter’s status IDs are approaching that number.

So what’s the likely impact?

  • Twitter itself can handle bigger numbers and will be fine.
  • Third-party apps that store the ID in a bigger format will be fine.
  • Third-party apps that store the ID as text instead of a number will be fine.
  • Third-party apps that store the ID in this particular format will end up with bad IDs as they try to cram a big number into a small space.

If I were to guess, the most likely breakage would be that replies might be attached to the wrong previous post — but again, only with apps that use this particular format for numbers.

Twitter itself will probably sail through cleanly (and has been planning to move up the schedule so that affected app developers don’t have to fix things in the middle of the night), so don’t expect any fail whales. Unless so many clients have problems that lots of people switch to the website.

Update: Not surprisingly, most Twitter clients are unaffected by the Twitpocalypse. I’ve used both Twidroid and Twhirl with no problems since Twitter passed the mark. I figured a few would get tripped up, but the real surprise is that it hit Twitterrific. One of the most popular clients on the iPhone? They do have an update, but a lot of people are unable to connect.