Tags: twitter

4449

sparkline

Thursday, May 26th, 2022

A hand holding a dark cocktail in the foreground while Rich is busy at the grill in the background.

Having an espresso martini and some BBQ on the roof of the @Clearleft HQ with my mate @clagnut to celebrate his 50th birthday!

dConstruct 2022 is happening!

https://2022.dconstruct.org/

September 9th at @DukeOfYorks here in Brighton—squee!

I’m putting the line-up together now and, trust me, you won’t want to miss this one…

Wednesday, May 25th, 2022

Replying to

👏👏👏💉🩸

Tuesday, May 24th, 2022

Heard the sad news of Cathal Coughlan’s passing.

I’ll be spending the rest of the day revisiting a mispent youth moshing at Fatima Mansions gigs in Cork.

https://www.youtube.com/watch?v=FnvsgWD_pAQ

Monday, May 23rd, 2022

Replying to

I would’ve gotten away with it too if I hadn’t attempted to mess with the Keyboard Cat page.

Wednesday, May 18th, 2022

Banjo, whistle, box and fiddle players gathered around a pub table, all playing together.

Playing tunes.

BREAKING: Elon Musk to tell Twitter that in order to close this deal, they must first “Bring me a shrubbery!”

Sunday, May 15th, 2022

Image previews with the FileReader API

I added a “notes” section to this website eight years ago. I set it up so that notes could be syndicated to Twitter. Ever since then, that’s the only way I post to Twitter.

A few months later I added photos to my notes. Again, this would get syndicated to Twitter.

Something’s bothered me for a long time though. I initially thought that if I posted a photo, then the accompanying text would serve as a decription of the image. It could effectively act as the alt text for the image, I thought. But in practice it didn’t work out that way. The text was often a commentary on the image, which isn’t the same as a description of the contents.

I needed a way to store alt text for images. To make it more complicated, it was possible for one note to have multiple images. So even though a note was one line in my database, I somehow needed a separate string of text with the description of each image in a single note.

I eventually settled on using the file system instead of the database. The images themselves are stored in separate folders, so I figured I could have an accompanying alt.txt file in each folder.

Take this note from yesterday as an example. Different sizes of the image are stored in the folder /images/uploaded/19077. Here’s a small version of the image and here’s the original. In that same folder is the alt text.

This means I’m reading a file every time I need the alt text instead of reading from a database, which probably isn’t the most performant way of doing it, but it seems to be working okay.

Here’s another example:

In order to add the alt text to the image, I needed to update my posting interface. By default it’s a little textarea, followed by a file upload input, followed by a toggle (a checkbox under the hood) to choose whether or not to syndicate the note to Twitter.

The interface now updates automatically as soon as I use that input type="file" to choose any images for the note. Using the FileReader API, I show a preview of the selected images right after the file input.

Here’s the code if you ever need to do something similar. I’ve abstracted it somewhat in that gist—you should be able to drop it into any page that includes input type="file" accept="image/*" and it will automatically generate the previews.

I was pleasantly surprised at how easy this was. The FileReader API worked just as expected without any gotchas. I think I always assumed that this would be quite complex to do because once upon a time, it was quite complex (or impossible) to do. But now it’s wonderfully straightforward. Story of the web.

My own version of the script does a little bit more; it also generates another little textarea right after each image preview, which is where I write the accompanying alt text.

I’ve also updated my server-side script that handles the syndication to Twitter. I’m using the /media/metadata/create method to provide the alt text. But for some reason it’s not working. I can’t figure out why. I’ll keep working on it.

In the meantime, if you’re looking at an image I’ve posted on Twitter and you’re judging me for its lack of alt text, my apologies. But each tweet of mine includes a link back to the original note on this site and you will most definitely find the alt text for the image there.

Saturday, May 14th, 2022

Replying to

People sitting around in the dappled sunshine on the green grass in a park with the distinctive Indian-inspired architecture of the Brighton Pavilion in the background, all under a clear blue sky.

Brighton in the sun.

Friday, May 13th, 2022

A close-up of a microphone in a practice room. In the background, a guitar player tunes up and a bass player waits to start.

Time to go play some songs with @SalterCane.

Thursday, May 12th, 2022

Fuzzy blobs of orange light in the shape of ring.

Watching the livestream of @KLBouman introducing us to @EHTelescope’s image of Sagittarius A*—amazing!

Wednesday, May 11th, 2022

A fiddler, a flute player, and a button accordion player playing around a table with pints of beer on it.

Playing tunes.

Monday, May 9th, 2022

Replying to

Ah, memories!

It was 18 years ago that @Clagnut introduced the idea:

https://clagnut.com/blog/348/

(Not that he—or anyone else—would recommend it these days!)

Sunday, May 8th, 2022

Jessica standing under a blue sky a green sea on one side and white chalk cliffs on the other. Jessica sitting on a green hillside under a blue sky.

By land and by sea.

Picture 1 Picture 2 Picture 3 Picture 4

Walking through the countryside to the seaside.

Friday, May 6th, 2022

> I wanna build a spaceship, go to the Moon, salvage all the junk that’s up there, bring it back and sell it. https://twitter.com/reel_geek/status/1521580826537910275

I wanna build a spaceship, go to the Moon, salvage all the junk that’s up there, bring it back and sell it.

https://twitter.com/reel_geek/status/1521580826537910275

Wednesday, May 4th, 2022

Replying to

That tracks with what I wrote about in the sequel to that post:

https://adactio.com/journal/19029

Tuesday, May 3rd, 2022

Giving blood. 💉🩸

https://blood.co.uk

Sunday, May 1st, 2022

Emily F. Gorcenski: Angelheaded Hipsters Burning for the Ancient Heavenly Connection

Twitter is a chatroom, and the problem that Twitter really solved was the discoverability problem. The internet is a big place, and it is shockingly hard to otherwise find people whose thoughts you want to read more of, whether those thoughts are tweets, articles, or research papers. The thing is, I’m not really sure that Twitter ever realized that this is the problem they solved, that this is where their core value lies. Twitter kept experimenting with algorithms and site layouts and Moments and other features to try to foist more discoverability onto the users without realizing that their users were discovering with the platform quite adeptly already. Twitter kept trying to amplify the signal without understanding that what users needed was better tools to cut down the noise.

Twitter, like many technology companies, fell into the classical trap by thinking that they, the technologists, were the innovators. Technologists today are almost never innovators, but rather plumbers who build pipelines to move ideas in the form of data back and forth with varying efficacy. Users are innovators, and its users that made Twitter unique.