Skip to content

Commit

Permalink
Merge pull request #15 from spences10/107/abstract-out-quotesjson
Browse files Browse the repository at this point in the history
107/abstract out quotesjson
  • Loading branch information
spences10 committed Nov 28, 2017
2 parents d96f710 + 9bed31f commit 4a66fd4
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 84 deletions.
8 changes: 8 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Expand Up @@ -37,6 +37,7 @@
"level": "2.0.1",
"moment": "2.19.2",
"node-schedule": "1.2.1",
"positivity-api": "1.2.0",
"retext-english": "^3.0.0",
"retext-sentiment": "^4.1.0",
"snyk": "1.51.0",
Expand Down
5 changes: 3 additions & 2 deletions src/api/sentiment.js
Expand Up @@ -3,7 +3,8 @@ const config = require('../config')

const bot = new Twit(config.twitterKeys)

const randomQuote = require('../helpers/randomQuote')
const quote = require('positivity-api')

const db = require('../helpers/db')

// sentiment deps
Expand Down Expand Up @@ -38,7 +39,7 @@ const sentimentBot = event => {
// if polarity is negative and polarity is <= -2
if (valence == 'negative' && polarity <= -2) {
// get a random quote
const phrase = randomQuote()
const phrase = quote.random()
const screen_name = event.user.screen_name
const tweetId = event.id_str

Expand Down
56 changes: 0 additions & 56 deletions src/helpers/quotes.json

This file was deleted.

8 changes: 0 additions & 8 deletions src/helpers/random.js

This file was deleted.

18 changes: 0 additions & 18 deletions src/helpers/randomQuote.js

This file was deleted.

0 comments on commit 4a66fd4

Please sign in to comment.