Skip to content

Commit

Permalink
Fixed Twitter bug
Browse files Browse the repository at this point in the history
  • Loading branch information
alexlitel committed Sep 27, 2017
1 parent 3f8328a commit 68582ae
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/app.js
Expand Up @@ -57,10 +57,14 @@ export class App {
data.tweets = await _.uniqBy(data.tweets.concat(twitterData.tweets.yesterday), 'id')

await new GithubHelper(this.config.GITHUB_TOKEN, this.config.GITHUB_CONFIG).run(data)
// eslint-disable-next-line no-console
console.log(`Updated Github repo with new dataset of ${data.tweets.length} for ${data.time.yesterdayDate}`)
newData.lastUpdate = data.time.todayDate
}

newData.lastRun = data.time.now
// eslint-disable-next-line no-console
console.log(`Successful run process, collected ${(twitterData.tweets.yesterday || twitterData.tweets).length} new tweets`)
await this.redisClient.hmsetAsync('app', serializeObj(newData))
return true
} catch (e) {
Expand Down
2 changes: 1 addition & 1 deletion src/twitter.js
Expand Up @@ -290,7 +290,7 @@ export class TwitterHelper {

if (isMaintenance) await this.switchAuthType()
while (count < queries.length) {
const tweets = await this.searchIterate(queries[count], sinceId, maxId, time)
const tweets = await this.searchIterate(decodeURIComponent(queries[count]), sinceId, maxId, time)
if (tweets.length) {
if (!isMaintenance && !newSinceId) newSinceId = tweets[0].id
if (time.yesterdayDate) {
Expand Down
1 change: 0 additions & 1 deletion test/twitter.test.js
Expand Up @@ -9,7 +9,6 @@ import {
import {
nativeClone,
extractAccounts,
prettyPrint,
buildQueries,
} from '../src/util'
import {
Expand Down

0 comments on commit 68582ae

Please sign in to comment.