So, I’ve been on a kick gluing together my site with other services using IFTTT to PESOS. Because if I can get away with it, the less code I have to maintain, the better. Let’s do more.

I now have my passive “watch” and “listen” posts syncing to my site using Trakt and Last.FM, but I had to use Zapier this time. The reason being is that both of these implementations depend on using an RSS feed to grab the data, but for some reason, IFTTT keeps not recognizing new items in an RSS feed for me. Perhaps it will work for you to use IFTTT, but I got frustrated and decided to try out Zapier, which worked very well.

Alan Rickman flipping a table over in frustration

Plus, I love that it lets you test actions. The downside is, Zapier isn’t free. πŸ™

Anyway, onto the configs and setup! As always, point the service at your micropub endpoint, and get an Auth token for your site with at least a “create” permission. You can use your software to generate a token if capable, or feel like a hacker by using Gimme A Token.

Trakt

Ah Trakt, I love it. It lets me keep track of and manage all of my shows and movies. Plus it has nifty reports, which if you are a data nerd like me, you’ll love.
First, a warning: you need Trakt premium to get the RSS feed. Go to your dashboard , and scroll down to “Recently Watched”. There is an RSS button there. Grab that URL and head on over to Zapier/IFTTT.

RSS button to the left of the Recently Watched section of the Trakt dashboard

The action should be connecting RSS to Webhook. Both IFTTT and Zapier have these actions. The HTTP method is POST. I used the form data type as I was having some trouble with the JSON format.

Here is my config for Zapier:
Data field in Zapier with the following entries. h and entry. watch-of and link field. syndication and link field. name and 'Watched' plus title field. published and pub date field

You will also want to set up the header near the bottom with: “Authorization” and “Bearer: AUTHTOKEN”. It’s really cool that Zapier allows you to set headers, which IFTTT doesn’t really let you do. πŸ™‚

For IFTTT, the config would probably be something like

access_token=AUTHTOKEN&h=entry&watch-of=<<<{{EntryURL}}>>>&syndication=<<<{{EntryURL}}>>>&name=Watched+<<<{{EntryTitle}}>>>&published={{EntryPublished}}

“watch-of” is the key argument that tells micropub that it’s a watch post type.
“published” tells micropub when you watched it and posts the entry at the time you watched the show or movie. You can omit if accurate times don’t matter to you.
“syndication” tells micropub that the watch is also on Trakt. Again, omit if you don’t care.

Last.FM

Now, this one is tricky. See, Last.FM doesn’t have a feed for scrobbles, just new releases. Which is a problem for us. But thanks to the internet, there are a few options to get around that. The particular site I used is called lastfm-rss. There is another option beside that, or you can roll your own via the Last.FM API.

Since I’m extraordinarily lazy, right now I’m using the link from the github project, which is this. You will want to change the “user” argument in the link to be your own username unless you feel like stalking my scrobbles and putting them on your site. πŸ˜›

After that, it’s basically identical to the Trakt implementation. I literally copied the Trakt one and edited the source RSS feed to be the above link, and “watch-of” becomes “listen-of”. Everything else stays the same.

Issues

If you are on WordPress, like I am, and you use the “published” field, there is a chance that the post won’t actually be posted. Instead, you get a nice shiny red “Missed Schedule” error in your post list. Fun. I’m not entirely sure why that happens, but you have a few options. The first option is to go in and just update and publish the post manually. The second is to use a plugin to check for those errors, and automatically publish them. The plugin I use for this is Scheduled Post Trigger.

One day, when I get around to actually learning why this is happening, I might post an update on how to fix it more natively, but until then, I’ll rely on the existing work of others.

Conclusion

Well, this has been fun, hasn’t it? I would eventually like to evolve this to be more advanced, with backfeed and ratings and such. I’d love to create a service like Bridgy or OwnYourSwarm to handle all of this. Alas, right now I just want things to work before I write a complete solution to a problem I don’t know needs that level of solution yet.

I’d also love to look into an alternative music scrobbling service, like Libre.FM or ListenBrainz. ListenBrainz is especially interesting since you can host it yourself and there are several scrobblers that can access a custom server, such as Pano Scrobbler.

I hope it helps! <3

Leave a Reply

Your email address will not be published.