fusion_tables_api 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/HISTORY.md +8 -0
- data/README.md +11 -1
- data/lib/fusion_tables_api/authorization.rb +5 -4
- data/lib/fusion_tables_api/table.rb +1 -1
- data/lib/fusion_tables_api/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9c71467be21a143e7c19b44f806a535de32fd489
|
4
|
+
data.tar.gz: 3b22aca19619b5c4fbc5411a9a3d60538e8be892
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9974f795a50164306daaff149005cd3a392f6ab9e3f894a412022c921d913f0ea5a49922e0de2ac225c08f087658ee7435f025115a852212d0000973e7407fea
|
7
|
+
data.tar.gz: 7899818a89b308a9c406e1ac91b9c3aae59b89a16946d01bc19cbec18fb9c6da53427e40a73a80a17eabbe5ac71076a9aba6b63799ce289720791c3225eaa35d
|
data/HISTORY.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
## Version 0.0.5 (05-01-2013)
|
2
|
+
* Initial authorization method for when you need to retrieve access token for the first time
|
3
|
+
|
4
|
+
## Version 0.0.4 (05-01-2013)
|
5
|
+
* Written some basic tests
|
6
|
+
* Fixes fixes and more fixes
|
7
|
+
* Some documentation
|
8
|
+
|
1
9
|
## Version 0.0.3 (04-30-2013)
|
2
10
|
* Basic functionality
|
3
11
|
* Can create table
|
data/README.md
CHANGED
@@ -44,7 +44,17 @@ OR
|
|
44
44
|
|
45
45
|
Generating a table:
|
46
46
|
|
47
|
-
ft.generate_table("the_name_of_csv_file.csv")
|
47
|
+
jj ft.generate_table("the_name_of_csv_file.csv")
|
48
|
+
|
49
|
+
If you need to retrieve your access token and refresh token for the first time utilize the method:
|
50
|
+
ft.initial_authorization
|
51
|
+
|
52
|
+
Customize the GoogleAPIClient by accessing the property `ft.client` for e.g.
|
53
|
+
ft.client.authorization.access_token
|
54
|
+
ft.client.authorization.access_token = "12345"
|
55
|
+
ft.client.authorization.redirect_uri = "http://www.example.com"
|
56
|
+
|
57
|
+
See http://rubydoc.info/github/google/google-api-ruby-client/frames for more info.
|
48
58
|
|
49
59
|
**TODO: Finish this....**
|
50
60
|
|
@@ -10,9 +10,11 @@ class FusionTablesAPI
|
|
10
10
|
@client.authorization.refresh_token = refresh_token
|
11
11
|
end
|
12
12
|
|
13
|
+
# TODO Why not rewrite the oauth tokens file that may be given?
|
13
14
|
def store_new_access_token
|
14
15
|
@authorization_tokens['access_token'] = @client.authorization.access_token
|
15
16
|
File.open(GOOGLE_OAUTH_TOKEN_FILE, 'w+') { |f| f.write(@authorization_tokens.to_yaml)}
|
17
|
+
true
|
16
18
|
end
|
17
19
|
|
18
20
|
# Takes hash or file and loads oauth credentials
|
@@ -43,11 +45,10 @@ class FusionTablesAPI
|
|
43
45
|
end
|
44
46
|
|
45
47
|
# Authorization
|
46
|
-
# TODO Need to test this out
|
47
48
|
def initial_authorization
|
48
49
|
puts "1) Copy and paste the url below into your browser:"
|
49
|
-
|
50
|
-
puts
|
50
|
+
authorize_uri = @client.authorization.authorization_uri
|
51
|
+
puts authorize_uri
|
51
52
|
# Launchy.open authorize
|
52
53
|
puts ""
|
53
54
|
|
@@ -60,7 +61,7 @@ class FusionTablesAPI
|
|
60
61
|
# TODO Need to test this one below
|
61
62
|
@authorization_tokens ||= @client.authorization.fetch_access_token!
|
62
63
|
|
63
|
-
File.open(GOOGLE_OAUTH_TOKEN_FILE, 'w+') { |f| f.write(
|
64
|
+
File.open(GOOGLE_OAUTH_TOKEN_FILE, 'w+') { |f| f.write(@authorization_tokens.to_yaml)}
|
64
65
|
puts "Google OAuth Tokens written to #{GOOGLE_OAUTH_TOKEN_FILE}"
|
65
66
|
true
|
66
67
|
end
|
@@ -41,7 +41,7 @@ class FusionTablesAPI
|
|
41
41
|
params = {
|
42
42
|
tableId: table_id,
|
43
43
|
startLine: start_line,
|
44
|
-
isStrict: false
|
44
|
+
isStrict: false
|
45
45
|
}
|
46
46
|
request_body = File.read(filename)
|
47
47
|
import_row_url = "https://www.googleapis.com/upload/fusiontables/v1/tables/tableId/import"
|