1. 程式人生 > >Want to control something with Siri? Here’s how.

Want to control something with Siri? Here’s how.

1) Firstly, download the scripts from here.

2) Then, open up siricontrol.py and add your username and password of your new Gmail account. This should be self-explanatory.

3) Now, run the script and say to Siri:

“Note the meaning of life”

The answer should be printed out, because of the ‘life’ module in the modules folder. The setup is now complete. ?

Creating your own modules

Here is the default module that comes with SiriControl:

moduleName — This is the name of the module which can be anything you want.

commandWords — This array will have the words which need to be said in order to call the execute() function.

execute(command) — This function is called when all

the words in the commandWords array are said. The ‘command’ parameter is the command said by the user, to Siri.

That’s all there is, to add Siri control to any project you want, whether it is as simple as turning on a LED to controlling your TV with infrared — the possibilities are endless, with the power of Siri behind it! For example, you could ask Siri to take a snapshot of your Raspberry Pi webcam feed and send it as an email, perhaps.

Due to the nature of the hack, you can control your Raspberry Pi from anywhere in the world, as long as you have an internet connection. This opens up many possibilities, including home automation and IoT. Anything is possible.
Featured in Issue 60 ?

Hope you enjoyed this tutorial! Please share your ideas and opinions below — it would great to hear how you used SiriControl! ?