Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
This page describes each feature of SiriAPI8.
This example will respond to hello followed by any word with "You said hello to any word"
from SiriAPI8.SiriAPI import * def hello(q, wildcards): #Answer function print ("You said Hello to " + wildcards) SiriAPI = SiriAPI("firstname.lastname@example.org", "Password") #Create SiriAPI8 object SiriAPI.action.add([['hello', '*'], hello) #Add answer function for hello * SiriAPI.connect() #Connect to iCloud input("Press any key...\n") SiriAPI.disconnect() #Close connection
Creates a new object of SiriAPI8. Requires your iCloud Mail and password
Connects to iCloud with the specified email and password
Closes connection to iCloud
Creates a new action based on the search criteria find which will run function call if the spoken text matches. An example for a valid criteria is
[['switch light', '*'], ['switch lamp', '*'], 'exact sentence']. The hole criteria has to be in brackets. Stars (*) mark wildcards. At these points any word is valid and will be passed to the function call as a list in the wildcards parameter. There is no limit for wildcards. They have to be seperated from normal text parts. It is possible to declare multiple statements. Each statement has to be in brackets.
Single keywords must not be in brackets and will only trigger an action if the exact sentence is said.
Returns the ID of the action (int)
SiriAPI.action.modify(id, find, call)
Modifies find and call of the action with the ID id. If find or call are set as -1 the old value will be kept. Changing call of id 0, you can set your own not found function. Changing find does not affect the not found function. Possible values for find are explained for action.add Returns (boolean), True if id was found, otherwise False
Remove action with the ID id Returns (boolean), True if id was found, otherwise False. The error action id 0 can't be deleted. It will return False.
Lists all actions in a list
Changes the keyword from iPhone to any string
Returns the version of SiriAPI8 in a string