mirror of https://github.com/perkeep/perkeep.git
nodeattr: fix up comment style
And use nodeattr.Title in twitter.
This commit is contained in:
parent
bc2b485656
commit
f2b9657be6
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue