This project was started as a proof of concept to link two services I use regularly. The aim of the project was to get album data I was listening to and post it to twitter.
Both services provide an api which you can use to get the relevant data it was a simple matter of making them talk to each other.
What my script does:
- Grabs the last track I listened to
- Takes the album info and checks to see if it's been posted (i.e. I'm still listening to the same album)
- Checks to make sure the data is valid, if not then adds dummy data
- Posts it to my twitter account
Problems:
After spending a few hours trying to bug fix my code I found that there was a problem with the last.fm api, it didn't always give me the correct information so it was triggering my error detection when it shouldn't have been. Because it was triggering my error protection it meant that it would post more times than it should (1 post per album). For example:
Album = dredg > Check > Album not posted > Post > Album = dred > Check Fail > Album not posted > Post
A copy of the code can be found here





