Writing a Link Shortener with PHP and Airtable
Over the weekend I was working on a small side project for a meetup I started attending to a few weeks ago. I am printing a QR code (with a link) for a small flyer and adding an NFC tag (with the same link) to it as well. All of the sudden I was thinking 🤔 I need a practical way to update a my link without having to print again my QR code and reprogram the NFC tag.
My initial thinking was to just use one of the many services out there but then I thought why not build a really simple one so I can update it as I need?, I also wanted to have a quick way of updating it without having to republish the code, or jumping into an ssh session to change some file on a server.
The answer 💡 I came up was to write a pretty small, yet effective, PHP script that gets an ID, fetches the real link from Airtable, and ends up redirecting the browser to the real link.