End Of An Automation Era As Twitter Closes Its Doors To Free API Access

Over the last few months since Elon Musk bought Twitter there has been a lot of comment and reaction, but not much with relevance to Hackaday readers. Today though that has changed, with an announcement from the company that as of February 9th they will end their free API tier. It’s of relevance here because Twitter has become one of those glue items for connected projects and has appeared in many featured works on this site. A week’s notice of a service termination is exceptionally short, so expect to see a lot of the Twitter bots you follow disappearing.

Twitter bot owners have the option of paying to continue with Twitter, or rebuilding their service to use a Mastodon instance such as botsin.space. If the fediverse is new to you, then the web is not short of tutorials on how to do this.

We feel that Twitter will be a poorer place without some of the creative, funny, or interesting bots which have enriched our lives over the years, and we hope that the spam bots don’t remain by paying for API access. We can’t help feeling that this is a misguided step though, because when content is the hook to bring in the users who are the product, throwing out an entire category of content seems short-sighted. We’re not so sure about it as a move towards profitability either, because the payback from a successful social media company is never profit but influence. In short: social media companies don’t make money but the conversation itself, and that can sometimes be worth more than money if you can avoid making a mess of it.

If the bots from our field depart for Mastodon, we look forward to seeing whether the new platform offers any new possibilities. Meanwhile if your projects don’t Toot yet, find out how an ESP32 can do it.

Header: D J Shin, CC BY-SA 3.0.

Punycodes Explained

When you’re restricted to ASCII, how can you represent more complex things like emojis or non-Latin characters? One answer is Punycode, which is a way to represent Unicode characters in ASCII. However, while you could technically encode the raw bits of Unicode into characters, like Base64, there’s a snag. The Domain Name System (DNS) generally requires that hostnames are case-insensitive, so whether you type in HACKADAY.com, HackADay.com, or just hackaday.com, it all goes to the same place.

[A. Costello] at the University of California, Berkley proposed the idea of Punycode in RFC 3492 in March 2003. It outlines a simple algorithm where all regular ASCII characters are pulled out and stuck on one side with a separator in between, in this case, a hyphen. Then the Unicode characters are encoded and stuck on the end of the string.

First, the numeric codepoint and position in the string are multiplied together. Then the number is encoded as a Base-36 (a-z and 0-9) variable-length integer. For example, a greeting and the Greek for thanks, “Hey, ευχαριστώ” becomes “Hey, -mxahn5algcq2″. Similarly, the beautiful city of München becomes mnchen-3ya. Continue reading “Punycodes Explained”

The GitHub Silverware Drawer Dilemma, Or: Finding Active Repository Forks

An fortunate reality of GitHub and similar sites is that projects that are abandoned by the maintainer are often continued by someone else who forked the project. Unfortunately, the ease of forking also means that GitHub projects tend to have a lot of forks, with the popular projects having hundreds of them. Since GitHub has elected to not provide a way to filter or sort these forks, finding the most active fork can be rather harrowing.

In addition, a popular project’s dead repository tends to score higher in search results than replacement forks. For these particular situations a couple of very useful websites and browser add-ons have been developed. The Lovely Forks add-on by [Utkarsh Upadhyay] seeks to insert information on forks that are notable or newer than the repository one is looking at.

Meanwhile, the Active Forks project by [Samar Dhwoj Acharya] provides a sortable list of project forks when provided with a GitHub repository name. This helps enormously when trying to find the freshest forks in a whole list. This is similar to the Useful Forks project that provides a web-based interface in addition to a Chrome extension. Do note that these queries will count towards the GitHub API rate-limits, so you may need to add an access token.

It’s a shame that GitHub doesn’t offer such functionality by default, but thanks to these projects the times of clicking through a hundred forks to find the freshest one is at least over. For now.

Virtual Yule Log Brings Old Tradition To The Web

Yule Log broadcasts are a bit of an American tradition, though similar content has also been broadcast around the world. They consist of a video of a log burning in a fireplace, ideally merrily so, and often feature Christmas carols or other holiday songs to help create a festive mood. [Joshua Gross] wanted to bring that tradition up to date, and thus built a Yule Log website with the help of some creative technologists.

What are Yule looking at?

WebYuleLog.com, as the project is known, features several web-based recreations of the Yule Log concept. They are charming little creations built with different techniques, from the AI-generated to those hewn from simple, pure HTML and CSS.  They range from cute 8-bit-esque tributes to burning firewood, to the ethereal and unrecognizable thought bubbles of an image-generating neural network. We’re pretty sure one of them is a oblique reference to an old Excel 97 Easter Egg, too.

It’s funny how much can be achieved within a modern browser window. Once upon a time, you were lucky to get a few GIFs and an obnoxious looping MIDI soundtrack.

A 3D printed cat treat dispenser on a table with a laptop in the background and with a treat in it's tray and a cat on the left about to eat the treat.

Local IOT Cat Treat Dispenser

[MostElectronics], like many of us, loves cats, and so wanted to make an internet connected treat dispenser for their most beloved. The result is an ingenious 3D printed mechanism connected to a Raspberry Pi that’s able to serve treats through a locally run web application.

The inside of a 3d printed cat treat dispenser, showing the different compartments, shaft and wires running out the back.

From the software side, the Raspberry Pi uses a RESTful API that one can connect to through a static IP. The API is implemented as a Python Flask application running under a stand alone web server Python script. The web application itself keeps track of the number of treats left and provides a simple interface to dispense treats at the operators leisure. The RpiMotorLib Python library is used to control a 28BYJ-48 stepper motor through its ULN2003 controller module, which is used to rotate the inside shaft of the treat dispenser.

The mechanism to dispense treats is a stacked, compartmentalized drum, with two drum layers for food compartments that turn to drop treats. The bottom drum dispenses treats through a chute connected to the tray for the cat, leaving an empty compartment that the top drum can replenish by dropping its treats into through a staggered opening. Each compartmentalized treat drum layer provides 11 treats, allowing for a total of 22 treats with two layers stacked on top of each other. One could imagine extending the treat dispenser to include more drum layers by adding even more layers.

Source code is available on GitHub and the STL files for the dispenser are available on Thingiverse. We’ve seen cat electronic feeders before, sometimes with escalating consequences that shake us to our core and leave us questioning our superiority.

Video after the break!

Continue reading “Local IOT Cat Treat Dispenser”

The demo toot screenshot, showing a text-only message sent from the ESP32 using the library.

Moved Off Twitter? Make Your ESP32 Toot

Since Twitter was officially taken over by Elon Musk a few days ago, there’s been significant staff cuts, a stream of questionable decisions, and uncertainty about the social media platform’s future. So it’s little surprise that a notable number of people, those in the tech and hacker scenes in particular, have decided to move over to (or at least bridge their accounts with) the distributed and open source Mastodon service.

Of course, the hacks would follow closely, and [Toby] shares a simple ESP32-based Mastodon client library for us to start with. Instead of “tweets”, messages on Mastodon instances are called “toots”, in line with the platform’s mammoth-like mascot. The library, called Luyba, is able to send toots and includes a demo firmware. Built using C++ and with support for Platform.IO, it should fit into quite a few projects out there, letting you easily send toots to whichever instance you find your home, as the library-aided demo toot shows.

What could you do with such a library on your MCU? Turns out, quite a few fun things – a home automation interface, a critter trap, an online BBC Basic interpreter, or, given image support, a camera that tweets whatever it’s pointed at. There’s quite a bit of fun hackers can have given a micro-blogging service API access and a bit of code that works with it. That said, for all the good that Twitter brought us over the years, there’s a lot that Mastodon can easily do better, between easily game-able “Trending” sidebar, bias found in auto-cropping algorithms and disarrayed internal security policies.

Infrastructure diagram of [Stefan]'s network at the end of his fiber optics journey

Say No To Obsolescence, Wire Up Your House With Fiber

These days, if you wire your house with anything less than gigabit, you might end up throttling your Internet connection. If you wired things up using two pairs per device back in 100BASE-T days, however, you’ll want to redo your cabling before you buy new switches. Now, some of us are already starting to equip ourselves with 2.5G hardware — which may require new cabling once again. Would you like to opt out of the Ethernet cabling upgrade rat race, at least for a while? Do like [Stefan Schüller] did, and use fiber optics for your home networking needs!

[Stefan] walks you through everything you’d need to know if you ever choose to look into fiber for your networking needs, and explains the design decisions he’s made — from splicing fiber optics himself, to building a PC to do routing instead of getting a hardware Small Form-factor Pluggable (SFP) equipped router. He also describes pitfalls, like SFP modules requiring reconfiguration to work with different router brands, and having to buy a fiber splicer with an eye-watering pricetag.

In the end, he shows a cost breakdown, and says he’s quite happy with the upgrade. While the costs might seem prohibitive compared to running Ethernet, upgrading to fiber will have your equipment function at top speed whenever you need it – who knows, perhaps in a few years time, 2.5G will no longer suffice for new advancements in home technology needs, and we’ll see more SFP modules in hackers’ hands. After all, modern TVs already use fiber optics for video data transfer.

Continue reading “Say No To Obsolescence, Wire Up Your House With Fiber”