diff --git a/pkg/importer/twitter/twitter.go b/pkg/importer/twitter/twitter.go index 0a79dcbe8..10b616597 100644 --- a/pkg/importer/twitter/twitter.go +++ b/pkg/importer/twitter/twitter.go @@ -40,6 +40,7 @@ import ( "camlistore.org/pkg/httputil" "camlistore.org/pkg/importer" "camlistore.org/pkg/schema" + "camlistore.org/pkg/schema/nodeattr" "camlistore.org/pkg/syncutil" "camlistore.org/third_party/github.com/garyburd/go-oauth/oauth" ) @@ -187,9 +188,9 @@ func (im *imp) Run(ctx *importer.RunContext) error { } rootNode := r.RootNode() - if rootNode.Attr("title") == "" { + if rootNode.Attr(nodeattr.Title) == "" { screenName := acctNode.Attr(importer.AcctAttrUserName) - rootNode.SetAttr("title", fmt.Sprintf("%s's Tweets", screenName)) + rootNode.SetAttr(nodeattr.Title, fmt.Sprintf("%s's Tweets", screenName)) } userID := acctNode.Attr(importer.AcctAttrUserID) @@ -612,7 +613,7 @@ func (im *imp) ServeCallback(w http.ResponseWriter, r *http.Request, ctx *import importer.AcctAttrUserID, u.ID, importer.AcctAttrName, u.Name, importer.AcctAttrUserName, u.ScreenName, - "title", fmt.Sprintf("%s's Twitter Account", u.ScreenName), + nodeattr.Title, fmt.Sprintf("%s's Twitter Account", u.ScreenName), ); err != nil { httputil.ServeError(w, r, fmt.Errorf("Error setting attribute: %v", err)) return diff --git a/pkg/schema/nodeattr/nodeattr.go b/pkg/schema/nodeattr/nodeattr.go index 8b024087c..a7f5b8572 100644 --- a/pkg/schema/nodeattr/nodeattr.go +++ b/pkg/schema/nodeattr/nodeattr.go @@ -24,9 +24,10 @@ const ( // unknown timezone). DateCreated = "dateCreated" - // http://schema.org/title + // Title is http://schema.org/title Title = "title" - // http://schema.org/description + + // Description is http://schema.org/description // Value is plain text, no HTML, newlines are newlines. Description = "description" )