juicy-coupon-bot
Advanced tools
Comparing version 1.3.0 to 1.3.1
@@ -5,3 +5,3 @@ const randomDiscount = require('./lib/randomDiscount') | ||
const facebookPost = require('./lib/facebookPost') | ||
const redditComment = require('./lib/redditComment') | ||
const redditPost = require('./lib/redditPost') | ||
const publishTweet = require('./lib/publishTweet') | ||
@@ -18,3 +18,3 @@ const publishFacebook = require('./lib/publishFacebook') | ||
publishFacebook(facebookPost(discount, coupon, expiryDate)) | ||
publishReddit(redditComment(discount, coupon, expiryDate), `New coupon code (valid until ${expiryDate})`) | ||
publishReddit(redditPost(discount, coupon, expiryDate), `New coupon code (valid until ${expiryDate})`) | ||
} |
@@ -8,3 +8,3 @@ const logger = require('../lib/logger') | ||
module.exports = (message) => { | ||
if (process.env.TRAVIS_EVENT_TYPE === 'cron') { | ||
if (process.env.PUBLISHING_MODE === true) { | ||
graph.post('owasp.juiceshop/feed', { message }, function (err, res) { | ||
@@ -18,4 +18,4 @@ if (err) { | ||
} else { | ||
logger.info(`[${colors.yellow('❌')}] Skipped Facebook post: ${colors.yellow('Post will only be published when running inside Travis-CI Cron Job')}`) | ||
logger.info(`[${colors.yellow('❌')}] Skipped Facebook post: ${colors.yellow('Post will only be published when PUBLISHING_MODE=true is set as an environment variable')}`) | ||
} | ||
} |
@@ -13,6 +13,6 @@ const logger = require('../lib/logger') | ||
module.exports = (text, title) => { | ||
if (process.env.TRAVIS_EVENT_TYPE === 'cron') { | ||
if (process.env.PUBLISHING_MODE === true) { | ||
R.api.post('/api/submit', { api_type: 'json', sr: 'owasp_juiceshop', kind: 'self', title, text }) | ||
.then(function (response) { | ||
logger.info(`[${colors.green('✔')}] Reddit post published: ${JSON.stringify(response[1].json.data.things[0].data.id)}`) | ||
logger.info(`[${colors.green('✔')}] Reddit post published: ${JSON.stringify(response[1].json.data)}`) | ||
}) | ||
@@ -23,4 +23,4 @@ .catch(function (error) { | ||
} else { | ||
logger.info(`[${colors.yellow('❌')}] Skipped Reddit post: ${colors.yellow('Post will only be published when running inside Travis-CI Cron Job')}`) | ||
logger.info(`[${colors.yellow('❌')}] Skipped Reddit post: ${colors.yellow('Post will only be published when PUBLISHING_MODE=true is set as an environment variable')}`) | ||
} | ||
} |
@@ -12,3 +12,3 @@ const logger = require('../lib/logger') | ||
module.exports = (status) => { | ||
if (process.env.TRAVIS_EVENT_TYPE === 'cron') { | ||
if (process.env.PUBLISHING_MODE === true) { | ||
T.post('statuses/update', { status }) | ||
@@ -22,4 +22,4 @@ .then(function (tweet) { | ||
} else { | ||
logger.info(`[${colors.yellow('❌')}] Skipped Tweet: ${colors.yellow('Status will only be published when running inside Travis-CI Cron Job')}`) | ||
logger.info(`[${colors.yellow('❌')}] Skipped Tweet: ${colors.yellow('Status will only be published when PUBLISHING_MODE=true is set as an environment variable')}`) | ||
} | ||
} |
{ | ||
"name": "juicy-coupon-bot", | ||
"version": "1.3.0", | ||
"version": "1.3.1", | ||
"description": "Coupon code generator and distribution bot for OWASP Juice Shop", | ||
@@ -5,0 +5,0 @@ "homepage": "http://owasp-juice.shop", |
@@ -28,11 +28,11 @@ # ![Juice Shop Logo](https://raw.githubusercontent.com/bkimminich/juicy-coupon-bot/master/JuicyCouponBot_8bit_Avatar.png) Juicy Coupon Bot | ||
> :information_source: You need to set up a | ||
> [Travis-CI Cron Job](https://docs.travis-ci.com/user/cron-jobs/#adding-cron-jobs) | ||
> and a [Twitter App](https://developer.twitter.com/en/apps) and | ||
> obviously provide your own keys and tokens for the environment | ||
> variables `TWITTER_CONSUMER_KEY`, `TWITTER_CONSUMER_SECRET`, | ||
> `TWITTER_ACCESS_TOKEN_KEY` and `TWITTER_ACCESS_TOKEN_SECRET`. For | ||
> Reddit integration you additionally need a | ||
> [Reddit App](https://www.reddit.com/prefs/apps) and have to define the | ||
> environment variables `REDDIT_ACCOUNT_NAME`, | ||
> :information_source: You need to set up a suitable cron job similar to | ||
> [ours](https://github.com/bkimminich/juicy-coupon-bot/actions?query=workflow%3A%22Monthly+Coupon+Distribution%22). | ||
> Next you need a [Twitter App](https://developer.twitter.com/en/apps) | ||
> to which you obviously have to provide your own keys and tokens for | ||
> the environment variables `TWITTER_CONSUMER_KEY`, | ||
> `TWITTER_CONSUMER_SECRET`, `TWITTER_ACCESS_TOKEN_KEY` and | ||
> `TWITTER_ACCESS_TOKEN_SECRET`. For Reddit integration you additionally | ||
> need a [Reddit App](https://www.reddit.com/prefs/apps) and have to | ||
> define the environment variables `REDDIT_ACCOUNT_NAME`, | ||
> `REDDIT_ACCOUNT_PASSWORD`, `REDDIT_APP_ID` and `REDDIT_APP_SECRET`. | ||
@@ -39,0 +39,0 @@ > For Facebook integration you additionally need a |
const chai = require('chai') | ||
const expect = chai.expect | ||
const redditComment = require('../lib/redditComment') | ||
const redditComment = require('../lib/redditPost') | ||
@@ -5,0 +5,0 @@ describe('Reddit comment', () => { |
Sorry, the diff of this file is not supported yet
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
25168