Example #1
0
func init() {
	if !env.IsDev() {
		// For this particular example importer, we only
		// register it if we're in "devcam server" mode.
		// Normally you'd avoid this check.
		return
	}

	// This Register call must happen during init.
	//
	// Register only registers an importer site type and not a
	// specific account on a site.
	importer.Register("dummy", &imp{})
}
Example #2
0
func init() {
	importer.Register("picasa", imp{
		newExtendedOAuth2(
			baseOAuthConfig,
			func(ctx *context.Context) (*userInfo, error) {
				u, err := picago.GetUser(ctx.HTTPClient(), "default")
				if err != nil {
					return nil, err
				}
				firstName, lastName := u.Name, ""
				i := strings.LastIndex(u.Name, " ")
				if i >= 0 {
					firstName, lastName = u.Name[:i], u.Name[i+1:]
				}
				return &userInfo{
					ID:        u.ID,
					FirstName: firstName,
					LastName:  lastName,
				}, nil
			}),
	})
}
Example #3
0
func init() {
	importer.Register("flickr", newFromConfig)
}
Example #4
0
func init() {
	importer.Register("feed", &imp{
		urlFileRef: make(map[string]blob.Ref),
	})
}
Example #5
0
func init() {
	importer.Register("twitter", &imp{})
}
Example #6
0
func init() {
	importer.Register("flickr", imp{})
}
Example #7
0
func init() {
	importer.Register("picasa", imp{})
}
Example #8
0
func init() {
	importer.Register("pinboard", imp{})
}
Example #9
0
func init() {
	importer.Register("foursquare", &imp{
		imageFileRef: make(map[string]blob.Ref),
	})
}
Example #10
0
func init() {
	importer.Register("dummy", newFromConfig)
}
Example #11
0
func init() {
	importer.Register("picasa", newFromConfig)
}
Example #12
0
func init() {
	importer.Register("foursquare", newFromConfig)
}
Example #13
0
func init() {
	importer.Register("twitter", newFromConfig)
}