Commit 835a951
Java RSS Feed (#1037)
* wip: initial commit
* style(spotlessApply): run uncalled task
* fix: register routine in features list
* feat: update config.json.template
* wip(rss-config): change config design
* feat: make targetChannelPattern into a Map
* refactor: don't hardcode number
* feat: improve constructEmbedMessage
* feat: improve the description constructing
* feat: increase MAX_CONTENTS to 300
* wip: changes
* feat(rss-feed): convert polling interval to be configurable
* feat: improve date parsing
Co-authored-by: Ethan McCue <5004262+bowbahdoe@users.noreply.github.com>
* feat: update config.json.template
* feat: improve date handling and add embed timestamp
* fix: malformed `config.json.template`
* fix: now correctly finds the latest date
* feat: improve date handling and add embed timestamp
* fix: now correctly finds the latest date
* feat: you can now optionally declare a specific channel for a feed to go to
* finished javadoc todos
* improved embed
* feat(rss-routine): working version
- Added JavaDocs on most parts
- Simplified the code and cleaned up unused stuff
* feat(rss-routine): increase MAX_CONTENTS to 1000
* refactor(rss-routine): rename to RSSHandlerRoutine
While the original idea was to add a Java news and changes RSS feed,
this was expanded to all types of RSS feeds, so a more appropriate name
makes things more clear.
* docs(rss-routine): add JavaDocs for constructor and class
* feat: add @NotNull annotation
* Update RSSHandlerRoutine.java
* fix: reverse feed so it posts in correct order
* refactor: use variable types instead of var
* feat: use fetchAny() instead of fetch()
* fix(rss-handler): remove redundant empty check
Co-authored-by: Ethan McCue <5004262+bowbahdoe@users.noreply.github.com>
* refactor(rss-handler): remove AtomicReference usage
Co-authored-by: Ethan McCue <5004262+bowbahdoe@users.noreply.github.com>
* resolve a couple issues
* refactor(rss): switch to using a record for the config
* feat: rename to fallbackChannelPattern
* refactor: remove unnecessary throws exception in method signature
* docs: add a few missing parameters and fix typos
* refactor: reduce try-catch scope and added clarifying comment
* perf: use Stream instead of StringBuilder
* refactor: put fallback case into an else statement
* refactor: switch to Map#containsKey() for targetChannelPatterns
* feat: modularize sendRss() method and improve variable names
This also changes the functionality of how new RSS feeds get dealt with
for the first time. Before this commit, all items would get posted as
embeds on Discord, and as a result, that would bombard the target
channel with RSS posts once the routine executes.
This commit changes this behavior by assuming that all RSS posts have
been posted and it should only consider posting posts newer than the
registered date.
* refactor: remove star import
* fix: add Objects#requireNonNull() on rssConfig
* changes
* feat: improvements from code reviews
Co-authored-by: Nathan Weisz <151496498+nateweisz@users.noreply.github.com>
* feat: add DateTimeParseException in signature
* refactor: use .orElseThrow() instead of .get()
* fixed missing coma after rss configuration
Co-authored-by: Tanish <tanishazad03@gmail.com>
* fix(rss): feeds support multiple channels
fix(rss): polling interval is now clear on unit of time
fix(rss): posting messages now uses forEachOrdered
* Optional<List<TextChannel>> -> List<TextChannel>
* extract item post predicate to seperate function
* various changes from null to optional
---------
Co-authored-by: christolis <work@chris-sdogkos.com>
Co-authored-by: Ethan McCue <5004262+bowbahdoe@users.noreply.github.com>
Co-authored-by: Tanish <tanishazad03@gmail.com>1 parent 7490beb commit 835a951
File tree
9 files changed
+524
-2
lines changed- application
- src/main
- java/org/togetherjava/tjbot
- config
- features
- javamail
- resources/db
9 files changed
+524
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
80 | 83 | | |
81 | 84 | | |
82 | 85 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
107 | | - | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
108 | 119 | | |
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| 46 | + | |
45 | 47 | | |
46 | 48 | | |
47 | 49 | | |
| |||
90 | 92 | | |
91 | 93 | | |
92 | 94 | | |
| 95 | + | |
93 | 96 | | |
94 | 97 | | |
95 | 98 | | |
| |||
122 | 125 | | |
123 | 126 | | |
124 | 127 | | |
| 128 | + | |
125 | 129 | | |
126 | 130 | | |
127 | 131 | | |
| |||
405 | 409 | | |
406 | 410 | | |
407 | 411 | | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
408 | 421 | | |
Lines changed: 30 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
Lines changed: 34 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
109 | 110 | | |
110 | 111 | | |
111 | 112 | | |
| 113 | + | |
112 | 114 | | |
113 | 115 | | |
114 | 116 | | |
| |||
0 commit comments