1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
Python - Remember the Milk
--------------------------
Look! A bit of code with no comments...
This module makes it easy to connect to the Remember the Milk API from a
Python program.
You'll need to get your API key and shared secret from Remember the milk.
>>> api_key = 'eec4eb91abd9160dbbadea07b1722950'
>>> shared_secret = 'b6b127916a4dacde'
Initially, you'll want to get a new token.
>>> rtmc = RTMClient(api_key, shared_secret)
>>> print rtmc.auth_url
http://www.rememberthemilk.com/services/auth/?perms=delete&frob=740a3c1aaff2a9...
Hang on to your RTMClient, and go to the authorisation URL with a
browser, to grant access to the program. Now, you can get the token,
which you can save for use later on.
>>> token = rtmc.token
When you have a token, you can get new clients without having to
authorise them again.
>>> rtmc = RTMClient(api_key, shared_secret, token)
Now you can use the client to call the RTM API methods.
>>> tasks_data = rtm.tasks.rtm.tasks.getList()
The returned JSON is converted into magic structure that you can access
using dot-notation.
>>> task_id = tasks_data.tasks.list[0]
|