-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathindex.js
23 lines (20 loc) · 939 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/*
* Copyright (c) 2019-2024 Bjoern Kimminich & the OWASP Juice Shop contributors.
* SPDX-License-Identifier: MIT
*/
const randomDiscount = require('./lib/randomDiscount')
const currentCoupons = require('./lib/currentCoupons')
const blueSkyPost = require('./lib/blueSkyPost')
const mastodonPost = require('./lib/mastodonPost')
const redditPost = require('./lib/redditPost')
const publishBlueSky = require('./lib/publishBlueSky')
const publishMastodon = require('./lib/publishMastodon')
const publishReddit = require('./lib/publishReddit')
module.exports = () => {
const { expiryDate, discountCodes } = currentCoupons()
const discount = randomDiscount()
const coupon = discountCodes[discount + '%']
publishBlueSky(blueSkyPost(discount, coupon, expiryDate))
publishMastodon(mastodonPost(discount, coupon, expiryDate))
publishReddit(redditPost(discount, coupon, expiryDate), `New coupon code (valid until ${expiryDate})`)
}