Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Remove unused oauth_google_client module.

  • Loading branch information...
commit b986b11f6329ebfddf585ebd84b24057181357be 1 parent ebfd399
Tim Fletcher tim authored

Showing 1 changed file with 0 additions and 54 deletions. Show diff stats Hide diff stats

  1. +0 54 src/oauth_google_client.erl
54 src/oauth_google_client.erl
... ... @@ -1,54 +0,0 @@
1   --module(oauth_google_client).
2   -
3   --compile(export_all).
4   -
5   --include_lib("xmerl/include/xmerl.hrl").
6   -
7   --define(REQUEST_TOKEN_URL, "https://www.google.com/accounts/OAuthGetRequestToken").
8   -
9   --define(AUTHORIZE_TOKEN_URL, "https://www.google.com/accounts/OAuthAuthorizeToken").
10   -
11   --define(ACCESS_TOKEN_URL, "https://www.google.com/accounts/OAuthGetAccessToken").
12   -
13   -
14   -titles(Feed) ->
15   - [Node#xmlText.value || Node <- xmerl_xpath:string("//feed/entry/title/text()", Feed)].
16   -
17   -get_request_token(Consumer) ->
18   - get_request_token(Consumer, []).
19   -
20   -get_request_token(Consumer, Scope) ->
21   - oauth_client:get(?REQUEST_TOKEN_URL, [{"scope", Scope}], Consumer, "", "", fun(Response) ->
22   - RParams = oauth_http:response_params(Response),
23   - URL = oauth:uri(?AUTHORIZE_TOKEN_URL, [{"oauth_token", oauth:token(RParams)}]),
24   - put(oauth_google_consumer, Consumer),
25   - put(oauth_google_request_token_response_params, RParams),
26   - io:format("~nPlease authorize the token at the following address:~n~s~n~n", [URL]),
27   - ok
28   - end).
29   -
30   -get_access_token() ->
31   - oauth_client:get(?ACCESS_TOKEN_URL, [], consumer(), request_token_response_params(), fun(Response) ->
32   - Params = oauth_http:response_params(Response),
33   - put(oauth_google_access_token_response_params, Params),
34   - ok
35   - end).
36   -
37   -consumer() ->
38   - get(oauth_google_consumer).
39   -
40   -request_token_response_params() ->
41   - get(oauth_google_request_token_response_params).
42   -
43   -access_token_response_params() ->
44   - get(oauth_google_access_token_response_params).
45   -
46   -get_feed(URL) ->
47   - get_feed(URL, []).
48   -
49   -get_feed(URL, Params) ->
50   - oauth_client:get(URL, Params, consumer(), access_token_response_params(), fun(Response) ->
51   - Body = oauth_http:response_body(Response),
52   - {XML, _} = xmerl_scan:string(Body),
53   - {ok, XML}
54   - end).

0 comments on commit b986b11

Please sign in to comment.
Something went wrong with that request. Please try again.