This program enables interacting with the Bonusly API from the command line.
It is written in Go using the Cobra library.
-
Configure Bonusly CLI to use your API token. If you don't have a token yet, you can create one here. Then run
bonusly config --set-token <your API token>
. If no errors are returned you sucessfully added your token and are ready to go! -
Try a command. Call
bonusly allowance
to get your current remaining allowance for this month.
Command | Description |
---|---|
allowance |
Lists the amount of Bonuslys you currently have to spend on rewards as well as the amount you can still give away this month. |
award |
Use this command to award Bonuslys to another person. Takes arguments --message , --hashtags , --recipients , --amount . See below for an example. |
makeitrain |
This command spends the entirety of your remaining bonuslys on the specified recipients. |
- Get remaining allowances for this month (for giving away and spending on rewards)
> bonusly allowance
> ...
> You still have 179 Bonusly left to give away this month.
> You still have 956 Bonusly left to spend on rewards this month.
- Send Bonuslys to someone
> bonusly award -m "Here are some bonusly for you! #team" -r "john.doe" -g "awesome, cliIsCool" -a 20
> ...
> Created bonus successfully! Check it out at bonus.ly/bonuses/<bonusPostId>
This can be achieved by defining three (yes, three) cronjobs (if you are on a Unix-based system). They will look like this:
55 23 30 4,6,9,11 bonusly makeitrain -r "john.doe, jane.doe, peter.parker" -m "You are the best #team"
55 23 31 1,3,5,7,8,10,12 bonusly makeitrain -r "john.doe, jane.doe, peter.parker" -m "You are the best #team"
55 23 28 2 bonusly makeitrain -r "john.doe, jane.doe, peter.parker" -m "You are the best #team"
What this will do is run makeitrain
on the 30th of April, June, September, and November; on the 31st of January, March, May, July, August, October, and December; and on the 28th of February.
We have to define three seperate cronjobs since crontabs don't support an easy way to specify the last day of the month.
If you don't have a server on which you can run the script, but only have a Windows workmachine, you can set up a script to trigger whenever the PC shuts down. Personally I haven't tested this yet, but here is some information regarding this.