Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 48 lines (35 sloc) 1.692 kb
0c7ee8d @mislav doc update: README and of getting session tokens
authored
1 == Basic usage instructions
4b04bcc @mislav helper for AuthSub request
authored
2
876ec0d @mislav readme tweaks
authored
3 Fetch users' contact lists from your web application without asking them to
4 provide their passwords.
3bb1fcc @mislav implement and spec out XML feed parsing
authored
5
52b332f @mislav Tested it live; it works, but only for registered domains. I've put up a...
authored
6 First, register[http://code.google.com/apis/accounts/docs/RegistrationForWebAppsAuto.html]
7 your application's domain. Then make users follow this URL:
3bb1fcc @mislav implement and spec out XML feed parsing
authored
8
0c7ee8d @mislav doc update: README and of getting session tokens
authored
9 Contacts::Google.authentication_url('http://mysite.com/invite')
3bb1fcc @mislav implement and spec out XML feed parsing
authored
10
876ec0d @mislav readme tweaks
authored
11 They will authenticate on Google and it will send them back to the URL
12 provided. Google will add a token GET parameter to the query part of the URL.
13 Use that token in the next step:
3bb1fcc @mislav implement and spec out XML feed parsing
authored
14
f33f242 @mislav update Contacts::Google docs
authored
15 gmail = Contacts::Google.new(params[:token])
16 gmail.contacts
17 # => [#<Contact 1>, #<Contact 2>, ...]
18
19 The resulting Contacts::Contact objects have `name` and `email` properties.
3bb1fcc @mislav implement and spec out XML feed parsing
authored
20
0c7ee8d @mislav doc update: README and of getting session tokens
authored
21 Read more in Contacts::Google. I plan to support more APIs (Microsoft Live, for
22 starters); feel free to contribute.
ecf08de @mislav README.rdoc
authored
23
0c7ee8d @mislav doc update: README and of getting session tokens
authored
24 Author: <b>Mislav Marohnić</b> (mislav.marohnic@gmail.com)
ecf08de @mislav README.rdoc
authored
25
0c7ee8d @mislav doc update: README and of getting session tokens
authored
26 == Documentation auto-generated from specifications
3bb1fcc @mislav implement and spec out XML feed parsing
authored
27
0c7ee8d @mislav doc update: README and of getting session tokens
authored
28 Contacts::Google.authentication_url
3bb1fcc @mislav implement and spec out XML feed parsing
authored
29 - generates a URL for target with default parameters
30 - should handle boolean parameters
b817027 @mislav doc love baby
authored
31 - skips parameters that have nil value
0c7ee8d @mislav doc update: README and of getting session tokens
authored
32 - should be able to exchange one-time for session token
3bb1fcc @mislav implement and spec out XML feed parsing
authored
33
0c7ee8d @mislav doc update: README and of getting session tokens
authored
34 Contacts::Google
3bb1fcc @mislav implement and spec out XML feed parsing
authored
35 - fetches contacts feed via HTTP GET
0c7ee8d @mislav doc update: README and of getting session tokens
authored
36 - handles a normal response body
3bb1fcc @mislav implement and spec out XML feed parsing
authored
37 - handles gzipped response
38 - raises a FetchingError when something goes awry
39 - parses the resulting feed into name/email pairs
0c7ee8d @mislav doc update: README and of getting session tokens
authored
40 - parses a complex feed into name/email pairs
3bb1fcc @mislav implement and spec out XML feed parsing
authored
41 - makes modification time available after parsing
b817027 @mislav doc love baby
authored
42
0c7ee8d @mislav doc update: README and of getting session tokens
authored
43 Contacts::Google GET query parameter handling
b817027 @mislav doc love baby
authored
44 - abstracts ugly parameters behind nicer ones
45 - should have implicit :descending with :order
46 - should have default :limit of 200
47 - should skip nil values in parameters
Something went wrong with that request. Please try again.