From afd756821870d91d797207f90508f4b7bc8f770f Mon Sep 17 00:00:00 2001 From: "Randell S. Hynes" Date: Fri, 17 Jul 2015 08:15:57 -0700 Subject: [PATCH 1/8] SmugMug Module Proposed module previously tested in HynesIP fork that is 462 commits behind. --- src/modules/smugmug.js | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 src/modules/smugmug.js diff --git a/src/modules/smugmug.js b/src/modules/smugmug.js new file mode 100644 index 00000000..c66912fd --- /dev/null +++ b/src/modules/smugmug.js @@ -0,0 +1,40 @@ +// SmugMug services +(function(hello) { + + hello.init({ + + smugmug: { + name: 'SmugMug', + + oauth : { + version : "1.0a", + auth : "http://api.smugmug.com/services/oauth/1.0a/authorize?Access=Full&Permissions=Modify", + //http://api.smugmug.com/services/oauth/1.0a/authorize?Access=Full&Permissions=Modify&allowThirdPartyLogin=0&showSignUpButton=false&viewportScale=1.0 + request : "http://api.smugmug.com/services/oauth/1.0a/getRequestToken?oauth_callback=http://localhost:3000/redirect.html", + token : "http://api.smugmug.com/services/oauth/1.0a/getAccessToken" + }, + refresh: true, + + scope: { + basic: '' + }, + + scope_delim: ' ', + + login: function(p) { + p.options.window_width = 710; + }, + + base: 'https://api.smugmug.com/api/v2', + + get: { + me: 'user/profile' + }, + wrap: { + me: function(o, headers) {} + }, + xhr: true + } + }); + +})(hello); From 6893abe7816cd152b6c54fb0f419e60c484541a3 Mon Sep 17 00:00:00 2001 From: "Randell S. Hynes" Date: Sat, 18 Jul 2015 07:57:08 -0700 Subject: [PATCH 2/8] Removed oauth_callback parameter Removed oauth_callback parameter Local testing produces same results. Popup stays open on URL http://localhost:3000/redirect.html?Access=Full&Permissions=Modify&oauth_token=4f0964e2beeaacca3948ba3a8f7d91a0&oauth_verifier=100103 --- src/modules/smugmug.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/smugmug.js b/src/modules/smugmug.js index c66912fd..dae697f1 100644 --- a/src/modules/smugmug.js +++ b/src/modules/smugmug.js @@ -10,7 +10,7 @@ version : "1.0a", auth : "http://api.smugmug.com/services/oauth/1.0a/authorize?Access=Full&Permissions=Modify", //http://api.smugmug.com/services/oauth/1.0a/authorize?Access=Full&Permissions=Modify&allowThirdPartyLogin=0&showSignUpButton=false&viewportScale=1.0 - request : "http://api.smugmug.com/services/oauth/1.0a/getRequestToken?oauth_callback=http://localhost:3000/redirect.html", + request : "http://api.smugmug.com/services/oauth/1.0a/getRequestToken", token : "http://api.smugmug.com/services/oauth/1.0a/getAccessToken" }, refresh: true, From 8ccf8ec2a2f98c88de8b41613b784944dd31a106 Mon Sep 17 00:00:00 2001 From: "Randell S. Hynes" Date: Mon, 20 Jul 2015 10:54:33 -0700 Subject: [PATCH 3/8] Update syntax errors from test. --- src/modules/smugmug.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/modules/smugmug.js b/src/modules/smugmug.js index dae697f1..a23fc675 100644 --- a/src/modules/smugmug.js +++ b/src/modules/smugmug.js @@ -6,12 +6,11 @@ smugmug: { name: 'SmugMug', - oauth : { - version : "1.0a", - auth : "http://api.smugmug.com/services/oauth/1.0a/authorize?Access=Full&Permissions=Modify", - //http://api.smugmug.com/services/oauth/1.0a/authorize?Access=Full&Permissions=Modify&allowThirdPartyLogin=0&showSignUpButton=false&viewportScale=1.0 - request : "http://api.smugmug.com/services/oauth/1.0a/getRequestToken", - token : "http://api.smugmug.com/services/oauth/1.0a/getAccessToken" + oauth: { + version: "1.0a", + auth: 'http://api.smugmug.com/services/oauth/1.0a/authorize', + request: 'http://api.smugmug.com/services/oauth/1.0a/getRequestToken', + token: 'http://api.smugmug.com/services/oauth/1.0a/getAccessToken' }, refresh: true, From 1b4a1ce94f805da767920a9e5330069d2d721a11 Mon Sep 17 00:00:00 2001 From: "Randell S. Hynes" Date: Mon, 20 Jul 2015 10:56:13 -0700 Subject: [PATCH 4/8] Missed double quotes. --- src/modules/smugmug.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/smugmug.js b/src/modules/smugmug.js index a23fc675..15aeb0d7 100644 --- a/src/modules/smugmug.js +++ b/src/modules/smugmug.js @@ -7,7 +7,7 @@ name: 'SmugMug', oauth: { - version: "1.0a", + version: '1.0a', auth: 'http://api.smugmug.com/services/oauth/1.0a/authorize', request: 'http://api.smugmug.com/services/oauth/1.0a/getRequestToken', token: 'http://api.smugmug.com/services/oauth/1.0a/getAccessToken' From 9cc71ff843c729e0a880d2c3094ca8cd1d7eb353 Mon Sep 17 00:00:00 2001 From: "Randell S. Hynes" Date: Wed, 22 Jul 2015 07:32:05 -0700 Subject: [PATCH 5/8] Update module to match wiki conventions Bare minimum to get Access Token. This doesn't change the results, however. --- src/modules/smugmug.js | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/src/modules/smugmug.js b/src/modules/smugmug.js index 15aeb0d7..258f425d 100644 --- a/src/modules/smugmug.js +++ b/src/modules/smugmug.js @@ -8,17 +8,10 @@ oauth: { version: '1.0a', - auth: 'http://api.smugmug.com/services/oauth/1.0a/authorize', request: 'http://api.smugmug.com/services/oauth/1.0a/getRequestToken', + auth: 'http://api.smugmug.com/services/oauth/1.0a/authorize?access=Full&permissions=Modify', token: 'http://api.smugmug.com/services/oauth/1.0a/getAccessToken' }, - refresh: true, - - scope: { - basic: '' - }, - - scope_delim: ' ', login: function(p) { p.options.window_width = 710; @@ -26,13 +19,6 @@ base: 'https://api.smugmug.com/api/v2', - get: { - me: 'user/profile' - }, - wrap: { - me: function(o, headers) {} - }, - xhr: true } }); From 0e69d6198e723e74e5da696a1021203f4307a9ed Mon Sep 17 00:00:00 2001 From: "Randell S. Hynes" Date: Wed, 22 Jul 2015 10:26:24 -0700 Subject: [PATCH 6/8] Remove comma. (sigh) --- src/modules/smugmug.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/smugmug.js b/src/modules/smugmug.js index 258f425d..a86d7f0b 100644 --- a/src/modules/smugmug.js +++ b/src/modules/smugmug.js @@ -17,7 +17,7 @@ p.options.window_width = 710; }, - base: 'https://api.smugmug.com/api/v2', + base: 'https://api.smugmug.com/api/v2' } }); From e77484d5e30b691e10c121f896675aea4fc790b9 Mon Sep 17 00:00:00 2001 From: "Randell S. Hynes" Date: Wed, 22 Jul 2015 13:56:16 -0700 Subject: [PATCH 7/8] Add SmugMug to test. --- tests/index.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/index.html b/tests/index.html index a4d35516..ed00189f 100644 --- a/tests/index.html +++ b/tests/index.html @@ -41,7 +41,8 @@ 'foursquare.js', 'github.js', 'soundcloud.js', - 'joinme.js' + 'joinme.js', + 'smugmug.js' ]); @@ -93,4 +94,4 @@

hello( x ).api( path [, method ][, data ][, callback ] )

- \ No newline at end of file + From 6642712ec1d360f2952babcd6e642da70ced38ae Mon Sep 17 00:00:00 2001 From: "Randell S. Hynes" Date: Wed, 22 Jul 2015 14:00:42 -0700 Subject: [PATCH 8/8] Add CLIENT_ID and CLIENT_IDS_ALL obj Add CLIENT_ID and add variable to CLIENT_IDS_ALL obj --- demos/client_ids.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/demos/client_ids.js b/demos/client_ids.js index 4bfe4138..3442ecf6 100644 --- a/demos/client_ids.js +++ b/demos/client_ids.js @@ -81,6 +81,8 @@ var FLICKR_CLIENT_ID = { // join.me Register - https://developer.join.me var JOINME_CLIENT_ID = 'myenm7aw34dbgejhuw4sv8zz'; +var SMUGMUG_CLIENT_ID = 'NFfNfAK47ZfnkMl4EjO48pgEQQWCMFJu'; + // To make it a little easier var CLIENT_IDS_ALL = { windows : WINDOWS_CLIENT_ID, @@ -94,7 +96,8 @@ var CLIENT_IDS_ALL = { soundcloud : SOUNDCLOUD_CLIENT_ID, foursquare : FOURSQUARE_CLIENT_ID, github : GITHUB_CLIENT_ID, - flickr: FLICKR_CLIENT_ID + flickr: FLICKR_CLIENT_ID, + smugmug: SMUGMUG_CLIENT_ID }; var TUMBLR_CLIENT_ID = { @@ -109,4 +112,4 @@ var TUMBLR_CLIENT_ID = { // var OAUTH_PROXY_URL = { 'local.knarly.com' : 'http://local.knarly.com:5500/proxy' -}[window.location.hostname] || 'https://auth-server.herokuapp.com/proxy'; \ No newline at end of file +}[window.location.hostname] || 'https://auth-server.herokuapp.com/proxy';