From 8af06fa3ff9236c912d2ba5d6934258ea56dc89c Mon Sep 17 00:00:00 2001
From: Brad Fitzpatrick
Date: Fri, 25 Jul 2014 13:37:47 -0700
Subject: [PATCH] picasa: work on making the instructions accurate & work
---
pkg/importer/picasa/picasa.go | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/pkg/importer/picasa/picasa.go b/pkg/importer/picasa/picasa.go
index afcbbd99c..a1d62201c 100644
--- a/pkg/importer/picasa/picasa.go
+++ b/pkg/importer/picasa/picasa.go
@@ -21,6 +21,7 @@ import (
"fmt"
"log"
"net/http"
+ "net/url"
"path/filepath"
"strings"
@@ -89,12 +90,19 @@ func newImporter() *imp {
}
func (im imp) AccountSetupHTML(host *importer.Host) string {
- base := host.ImporterBaseURL() + "picasa"
+ // Picasa doens't allow a path in the origin. Remove it.
+ origin := host.ImporterBaseURL()
+ if u, err := url.Parse(origin); err == nil {
+ u.Path = ""
+ origin = u.String()
+ }
+
+ callback := host.ImporterBaseURL() + "picasa/callback"
return fmt.Sprintf(`
Configuring Picasa
Visit https://console.developers.google.com/
-and click "CREATE PROJECT".
-Then under "APIs & auth" click on "Credentials", then "CREATE NEW CLIENT ID".
+and click "Create Project".
+Then under "APIs & Auth" in the left sidebar, click on "Credentials", then click the button "Create new Client ID".
Use the following settings:
- Web application
@@ -102,7 +110,7 @@ and click "CREATE PROJECT".
- Authorized Redirect URI: %s
Click "Create Client ID". Copy the "Client ID" and "Client Secret" into the boxes above.
-`, base, base+"/callback")
+`, origin, callback)
}
// A run is our state for a given run of the importer.