Skip to content

Commit

Permalink
autopush@1483031653
Browse files Browse the repository at this point in the history
  • Loading branch information
denkhaus committed Dec 29, 2016
1 parent 07b95b8 commit d126946
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 19 deletions.
2 changes: 1 addition & 1 deletion engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"net/url"

"github.com/ChimeraCoder/anaconda"
"github.com/denkhaus/neoism"
"github.com/jmcvetta/neoism"
"github.com/juju/errors"
"github.com/kurrik/oauth1a"
"github.com/kurrik/twittergo"
Expand Down
2 changes: 1 addition & 1 deletion followers.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"net/http"
"net/url"

"github.com/denkhaus/neoism"
"github.com/jmcvetta/neoism"
"github.com/juju/errors"
)

Expand Down
2 changes: 1 addition & 1 deletion graph.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
// "github.com/davecgh/go-spew/spew"
"strconv"

"github.com/denkhaus/neoism"
"github.com/jmcvetta/neoism"
"github.com/juju/errors"
)

Expand Down
2 changes: 1 addition & 1 deletion mentions.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package main

import (
"github.com/denkhaus/neoism"
"github.com/jmcvetta/neoism"
"github.com/juju/errors"
)

Expand Down
2 changes: 1 addition & 1 deletion tweets.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"net/http"
"net/url"

"github.com/denkhaus/neoism"
"github.com/jmcvetta/neoism"
"github.com/juju/errors"
"github.com/kurrik/twittergo"
)
Expand Down
30 changes: 16 additions & 14 deletions user.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
// "github.com/davecgh/go-spew/spew"
"time"

"github.com/denkhaus/neoism"
"github.com/jmcvetta/neoism"
"github.com/juju/errors"
)

Expand All @@ -17,21 +17,23 @@ func (p *Engine) completeUsers(db *neoism.Database) error {

ids := res.FilterResultsBy("id").ToInt64Slice()

if len(ids) > 0 {
logger.Infof("%d user ids need completion -> fetch", len(ids))
twUsers, err := p.api.GetUsersLookupByIds(ids, nil)
if err != nil {
return errors.Annotate(err, "lookup users by ids")
}
if len(ids) == 0 {
return nil
}

props := neoism.Props{
"users": twUsers,
}
logger.Infof("%d user ids need completion -> fetch", len(ids))
twUsers, err := p.api.GetUsersLookupByIds(ids, nil)
if err != nil {
return errors.Annotate(err, "lookup users by ids")
}

logger.Infof("got data for %d users -> apply", len(twUsers))
if _, err := p.execQuery(db, CYPHER_USERS_UPDATE_BY_ID, props); err != nil {
return errors.Annotate(err, "users update by id")
}
props := neoism.Props{
"users": twUsers,
}

logger.Infof("got data for %d users -> apply", len(twUsers))
if _, err := p.execQuery(db, CYPHER_USERS_UPDATE_BY_ID, props); err != nil {
return errors.Annotate(err, "users update by id")
}

return nil
Expand Down

0 comments on commit d126946

Please sign in to comment.