-
Notifications
You must be signed in to change notification settings - Fork 0
Configuration
You can either put a file application.properties
next to your
jar file, or you can supply the path to the configuration
via command line argument: --spring.config.location=file:$HOME/.config/zodiacbot.properties
.
Create a config file somewhere (e.g. $HOME/.config/zodiacbot.properties
, see above). Here is a simple template for you:
## Twitter authentication settings (required)
twitter.oauth.consumerKey=xxxxx123XXXxx4XxXXxxxxxXx
twitter.oauth.consumerSecret=0xXxxxXXxxXxXxxX1X2x3xx4Xx56xXXx7x8xx9XXXXXXxXXX0x
twitter.oauth.accessToken=0123456789012345678-9xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
twitter.oauth.accessTokenSecret=xXxxxxxxxxxxxxxxxxxxXXXxxxxxxxxxxxxxxxxxxxxxx
## Scheduling (defaults)
#twitter.scheduler.daily.cron=0 31 5 * * ?
#twitter.scheduler.firstDay.cron=0 31 5 * * ?
#twitter.scheduler.print.cron=0 0 * * * ?
## Tweet content settings (defaults)
#twitter.progressbar.length=18
## set to true to disable image upload
#twitter.image.upload.disabled=false
## Misc
# Setting from twitter library twitter4j.
#twitter.debug=false
## Please note: user.language will not be accepted here!
## user.timezone is not supported officially, but should work at the moment.
- required
- Defaults to: Europe/Berlin
- Type: String
- Via: JVM-Arg (
-Duser.timezone=Europe/Berlin
)
This one should be given via jvm arg (-Duser.timezone=Europe/Berlin
).
It will set the timezone for the bot. It has a massive impact.
First of all, it will be the source for your cron job (when the bot will post).
Furthermore, the timezone will be in effect when calculating days and seconds
between the current day and the next zodiac start, and between the current zodiac
start and the current day. Without the timezone information, the bot would not
be able to address leap days and leap seconds.
Keep your java installation up to date for this.
- optional, but highly recommended
- Defaults to: Your system language / en.
- Type: String (iso2 language code)
- Via: JVM-Arg (
-Duser.language=de
)
This property can only be set via jvm arg, as the application ONLY
relies on Locale.getDefault()
. The idea is not to introduce spring
dependencies on modules which would otherwise not neet spring dependencies.
If you don't set your locale, it will default to your system language. If no translation for this language is available, it will fall back to english.
-
twitter.scheduler.daily.cron
For every day except the first day of a zodiac.
Default:0 31 5 * * ?
(daily at 5:31am) -
twitter.scheduler.firstDay.cron
Will only tweet on the first day of a zodiac sign.
Default:0 31 5 * * ?
(daily at 5:31am) -
twitter.scheduler.print.cron
Will print messages to stdout.
Default:0 0 * * * ?
(every hour).
For debugging purposes, you can set cron expressions to 0 0 0 31 2
(every 31st of February), which will never occur. :-)
- optional
- Defaults to:
18
. - Type: int
- Via:
.properties
file or JVM-arg or program arg.
When it comes down to █████████████████░░░
vs █████████████░░░
.
Because on twitter, length does matter! ;-)
- all 4 of them required
- twitter.oauth.consumerKey
- twitter.oauth.consumerSecret
- twitter.oauth.accessToken
- twitter.oauth.accessTokenSecret
- Defaults to:
null
(i.e. will throw exceptions). - Type: Strings
- Via: config file.
- You could use jvm args or program args, but this would expose your keys to all users on that system!
Go to developer.twitter.com to get your auth information.
- optional
- Defaults to:
false
- Type: boolean
- Via: property file (preferred) or any other means.
- optional
- Defaults to:
false
- Type: boolean
- Via: property file (preferred) or any other means.
If set to true
, no image update will be done on a 1st of zodiac sign.
Some more logging from the twitter library (twitter4j).
- optional
- Defauts to:
false
- Type: boolean
- Via: preferred via program arg / command line.
If given The bot will only run until after 10 seconds and then tweet a single status update. Hint: Any crons may run in those time as well, resulting in more than one tweet.
- optional
- Defaults to:
false
- Type: boolean
- Via: preferred via program arg / command line.