Skip to content

Commit 116b9e2

Browse files
authored
moar (#28)
* strip tags Signed-off-by: Daniel Sieradski <daniel@self.agency> * hrm Signed-off-by: Daniel Sieradski <daniel@self.agency> * cache bust Signed-off-by: Daniel Sieradski <daniel@self.agency> * and again Signed-off-by: Daniel Sieradski <daniel@self.agency> * cache bust Signed-off-by: Daniel Sieradski <daniel@self.agency> * formatting stuff Signed-off-by: Daniel Sieradski <daniel@self.agency> * again Signed-off-by: Daniel Sieradski <daniel@self.agency> * nothing older than one day + formatting Signed-off-by: Daniel Sieradski <daniel@self.agency> * cache bust Signed-off-by: Daniel Sieradski <daniel@self.agency> * formatting and timing Signed-off-by: Daniel Sieradski <daniel@self.agency> * more options and styling Signed-off-by: Daniel Sieradski <daniel@self.agency> * revalidate Signed-off-by: Daniel Sieradski <daniel@self.agency> * add internal docs Signed-off-by: Daniel Sieradski <daniel@self.agency> * debug Signed-off-by: Daniel Sieradski <daniel@self.agency> * fix validation Signed-off-by: Daniel Sieradski <daniel@self.agency> * Derp Signed-off-by: Daniel Sieradski <daniel@self.agency> * more debugging Signed-off-by: Daniel Sieradski <daniel@self.agency> * more formatting stuff Signed-off-by: Daniel Sieradski <daniel@self.agency> * move date block Signed-off-by: Daniel Sieradski <daniel@self.agency> * add showimg Signed-off-by: Daniel Sieradski <daniel@self.agency> * Update docs Signed-off-by: Daniel Sieradski <daniel@self.agency> * add utc mark Signed-off-by: Daniel Sieradski <daniel@self.agency> * 1.2.7
1 parent 95ee5bd commit 116b9e2

File tree

14 files changed

+460
-140
lines changed

14 files changed

+460
-140
lines changed

.github/workflows/feedbot.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ jobs:
1717
uses: actions/cache@v2
1818
with:
1919
path: ./slackfeedbot-cache
20-
key: feed-cache-e-${{ steps.generate-key.outputs.cache-key }}
21-
restore-keys: feed-cache-e-
20+
key: feed-cache-i-${{ steps.generate-key.outputs.cache-key }}
21+
restore-keys: feed-cache-i-
2222
- name: LAT
2323
uses: 'selfagency/slackfeedbot@dev'
2424
with:

README.md

Lines changed: 15 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,21 @@ Push RSS feed updates to Slack via GitHub Actions
1414

1515
4. Create a new workflow in your desired repository (e.g. `.github/workflows/slackfeedbot.yml`) and drop in the follwing, where:
1616

17-
- `rss` is an RSS feed URL.
18-
- `slack_webhook` is the URL of your Slack webhook (this can and probably
17+
- `rss`: An RSS feed URL.
18+
- `slack_webhook`: The URL of your Slack webhook (this can and probably
1919
should be a repository or organization secret).
20-
- `cache_dir` is the folder in which you want to cache RSS data to prevent
20+
- `cache_dir`: The folder in which you want to cache RSS data to prevent
2121
publishing duplicates (e.g., `./slackfeedbot-cache`), or alternately...
22-
- `interval` is the number of minutes between runs of the parent workflow, as
22+
- `interval`: The number of minutes between runs of the parent workflow, as
2323
specified in the `cron` section of the `schedule` workflow trigger (may
2424
publish duplicates due to post pinning).
25-
- `unfurl` tells Slack to show the [Open Graph](https://ogp.me/) preview. If
26-
set to `false` the title, date, short description, and a link to the feed item
27-
will be posted. Defaults to `false` because it's kind of flaky.
25+
- `unfurl`: Tells Slack to show the [Open Graph](https://ogp.me/) preview.
26+
Defaults to `false` because it's kind of flaky. Not customizable. Use
27+
the below settings for customizd display.
28+
- `show_desc`: Whether to show the post description. Defaults to `true`.
29+
- `show_img`: Whether to show the post image. Defaults to `true`.
30+
- `show_date`: Whether to show the post date. Defaults to `true`.
31+
- `show_link`: Whether to show the Read more link, linking back to the post. Defaults to `true`.
2832

2933
## Examples
3034

@@ -54,7 +58,7 @@ jobs:
5458
key: feed-cache-${{ steps.generate-key.outputs.cache-key }}
5559
restore-keys: feed-cache-
5660
- name: NYT
57-
uses: 'selfagency/slackfeedbot@v1.2.6'
61+
uses: 'selfagency/slackfeedbot@v1.2.7'
5862
with:
5963
rss: 'https://rss.nytimes.com/services/xml/rss/nyt/HomePage.xml'
6064
slack_webhook: ${{ secrets.SLACK_WEBHOOK }}
@@ -75,45 +79,13 @@ jobs:
7579
runs-on: ubuntu-latest
7680
steps:
7781
- name: NYT
78-
uses: 'selfagency/slackfeedbot@v1.2.6'
82+
uses: 'selfagency/slackfeedbot@v1.2.7'
7983
with:
8084
rss: 'https://rss.nytimes.com/services/xml/rss/nyt/HomePage.xml'
8185
slack_webhook: ${{ secrets.SLACK_WEBHOOK }}
8286
interval: 15
8387
```
8488

85-
### Unfurl URLs
86-
87-
```
88-
name: FeedBot
89-
on:
90-
schedule:
91-
- cron: '*/15 * * * *'
92-
jobs:
93-
rss-to-slack:
94-
runs-on: ubuntu-latest
95-
steps:
96-
- name: Generate cache key
97-
uses: actions/github-script@v6
98-
id: generate-key
99-
with:
100-
script: |
101-
core.setOutput('cache-key', new Date().valueOf())
102-
- name: Retrieve cache
103-
uses: actions/cache@v2
104-
with:
105-
path: ./slackfeedbot-cache
106-
key: feed-cache-${{ steps.generate-key.outputs.cache-key }}
107-
restore-keys: feed-cache-
108-
- name: NYT
109-
uses: 'selfagency/slackfeedbot@v1.2.6'
110-
with:
111-
rss: 'https://rss.nytimes.com/services/xml/rss/nyt/HomePage.xml'
112-
slack_webhook: ${{ secrets.SLACK_WEBHOOK }}
113-
cache_dir: './slackfeedbot-cache'
114-
unfurl: true
115-
```
116-
11789
### Multiple feeds
11890

11991
```
@@ -138,13 +110,13 @@ jobs:
138110
key: feed-cache-${{ steps.generate-key.outputs.cache-key }}
139111
restore-keys: feed-cache-
140112
- name: LAT
141-
uses: 'selfagency/slackfeedbot@v1.2.6'
113+
uses: 'selfagency/slackfeedbot@v1.2.7'
142114
with:
143115
rss: 'https://www.latimes.com/rss2.0.xml'
144116
slack_webhook: ${{ secrets.SLACK_WEBHOOK }}
145117
cache_dir: './slackfeedbot-cache'
146118
- name: WaPo
147-
uses: 'selfagency/slackfeedbot@v1.2.6'
119+
uses: 'selfagency/slackfeedbot@v1.2.7'
148120
with:
149121
rss: 'https://feeds.washingtonpost.com/rss/homepage'
150122
slack_webhook: ${{ secrets.SLACK_WEBHOOK }}

action.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@ inputs:
1717
interval:
1818
description: 'Minutes between workflow runs'
1919
required: false
20+
show_date:
21+
description: 'Show date in output'
22+
required: false
23+
show_link:
24+
description: 'Show link in output'
25+
required: false
26+
show_description:
27+
description: 'Show description in output'
28+
required: false
2029
unfurl:
2130
description: 'Unfurl links'
2231
required: false

0 commit comments

Comments
 (0)