Here’s a real simple piece of PHP code that receives an SMS from Textlocal’s service and saves it to a MySQL database. This can be very handy for text-to-screen applications or if you just want to keep a custom database of received messages. Textlocal gives the option to forward incoming messages to a URL and provides sample code to get you going. The code I’ve written code below takes this one step further and will save the messages to a database. Once received SMSs are stored in the database it is really easy to create moderation tools and further analyse the messages.
As I’m a general all-rounder tech guy at my current job, I often find myself needing to learn new stuff pretty quickly. Recently I’ve been working on a jukebox system for our office where anyone can request a song, view the currently playing song etc.
A nice finishing touch I wanted to add was to display the album artwork of the currently playing song. I knew I needed to use the Last FM API but I found it really hard to get pointed in the right direction. I’d never used any kind of API before so was completely in the dark.
To help anyone else that may be in a similar situation, here’s a little guide of how to get started with the Last FM API in PHP.