A trakt.tv siri proxy plugin

2011-12-04

Hi, Siri

With the siri proxy gem (https://github.com/plamoni/SiriProxy) creating your own fun stuff for iPhone 4s's Siri is pretty straight forward.

Hi, Trakt

Trakt.tv has an amazing API and I wrote a small wrapper (see lib/trakt.tv) in the project) to fetch a users's calendar for that night.

How i did it.

First off make sure you read all the documentation on the proxy github page, setting up the DNS server can be tricky if you don't follow all the steps in the video.

Naming

Naming is very important for the siri proxy so make sure you do it right! The name you set in the siri proxy config should be the classname you extend the plugin from. The name downcased should be the gem name (with siriproxy prepended) It took me a while to figure out and get everything up and running.

Code

The listen_for tells the proxy what words to match with the response from apple, the code in the block gets executed when the words match

In the generate_calendar_response i create a new view and add every episode i get from trakt to it. The whole thing gets returned to your iPhone and siri tells you the results :)

The result

The video below shows the result.

As always the code can be found on GitHub

More from the blog

- Resize images from s3 with AWS Lambda and Rust

My site contains a lot of images and resizing them for different devices (mobile phone, tabled, desktop etc.) takes a lot of time and (upload) bandwidth. This is especially annoying on Hotel Wi-Fi in a far-away country. With the help of AWS Lambda and Rust I made this into a smooth process.

- Taming our MongoDB database size.

Not so long ago we noticed that our MongoDB servers were running out of disk space at an alarming rate. Because we host our database on SSD enabled servers at DigitalOcean, scaling up could cost us a lot of money.