Sunday, November 7, 2021

On IRCCloud

I've known irccloud (or ircclown as some call it) for some time; we've had an on-again, off-again relationship for years. My biggest gripe with it is that, if you don't pay, it disconnects you after a few hours of inactivity (inactivity being described as not having an irccloud tab open: you don't have to talk if you don't want to). Also it doesn't let you connect to more than two servers, and you can't use server passwords, but who needs anything else than passwordless efnet, right?

Keeping the connection alive

I tried writing a script myself. The idea was that every x minutes the script would log in, idle for a few seconds, then disconnect. That should be enough. Well, I tried, and it didn't work. I kept getting disconnected. Obviously I had to work on it a little bit more, but then I found this: https://github.com/osm/icka/

It's neat: it works. You just put it in your crontab and forget about it.

*/30 * * * * ./icka/icka -email 'thisis@myemail.com' -password 'whyyoulittle'

I learnt more about the irccloud protocol than I would've wanted to - it works over websocket and it's not obfuscated or anything. It's quite straightforward. Looking at it made me wonder how easy or hard it would be to write an irc bot that connects through irccloud. Something to try someday.

Styling

Being a web application, we can apply any styles that we want. In my case, I've made a few changes.

As you know, you can use some browser extensions like Stylus to add CSS code to any website, but myself I like to do it using uBlock Origin. Why? Because I already have a uBlock Origin list for my own purposes, which I share with all my computers, so my CSS changes (and blocked elements) are synchronised automatically. Neat.

These are all filters you can add to the "My filters" tab in the uBlock Origin configuration page.

  • Bring back the < and > symbols to nick names:
    irccloud.com##.messageRow .authorWrap > .g:style(display: inline !important; position: unset !important; left: 0 !important; top: 0 !important)
  • Hide automatically generated avatars (the ones with a letter), leaving only the user-set ones:
    irccloud.com##.messageRow .avatar.letterAvatar
  • Change the monospace font from Hack (the default) to anything else:
    irccloud.com##body.font-mono #timeContainer, body.font-mono .buffercontainer, body.font-mono .buffercontainer button.link, body.font-mono .fontChooser__sample, body.font-mono .inputcell textarea, body.font-mono .messageLayout__preview, body.font-mono div.shim:style(font-family: "Consolas" !important)
  • Eliminate the white lines in between irc art without having to use compact mode, which packs all chat lines too tight. (This makes colour blocks a bit too tall - some may not like it and there probably are better options):
    irccloud.com##.messageRow .irccolor:style(padding-bottom: 8px)
    irccloud.com##.messageRow:style(line-height: 17px !important)

Scripting

Theoretically you should be able to automate some things using userscripts. I haven't tried, but I'm leaving the idea here in case someone wants to pick it up. This option is reasonable for itsy-bitsy automations. If you want to write a full-fledged bot, I think you'd be better off using the irccloud protocol, as I suggested above.

Password-protected servers

If you need to connect to a password-protected server, you have to pay. But you should be able to write a script that proxifies all incoming connections and sends the PASS command at the appropriate time. Once again, this is a theory as I haven't actually tried, but I don't see why it shouldn't work.

Other options

You also have the option of using The Lounge. It's something I've considered, but they have no mobile apps. I asked on their irc channel and they told me that I don't need an app because the site itself is a PWA. I couldn't help but scoff at the situation.

irccloud also allows you to upload small files and a link is posted automatically to the channel you're in. It's the kind of thing you didn't know you needed until you had it.

And hey, if irccloud doesn't win you over, you can always go back to irssi on tmux.

No comments:

Post a Comment