Skip to content

Commit

Permalink
moar (#28)
Browse files Browse the repository at this point in the history
* strip tags

Signed-off-by: Daniel Sieradski <[email protected]>

* hrm

Signed-off-by: Daniel Sieradski <[email protected]>

* cache bust

Signed-off-by: Daniel Sieradski <[email protected]>

* and again

Signed-off-by: Daniel Sieradski <[email protected]>

* cache bust

Signed-off-by: Daniel Sieradski <[email protected]>

* formatting stuff

Signed-off-by: Daniel Sieradski <[email protected]>

* again

Signed-off-by: Daniel Sieradski <[email protected]>

* nothing older than one day + formatting

Signed-off-by: Daniel Sieradski <[email protected]>

* cache bust

Signed-off-by: Daniel Sieradski <[email protected]>

* formatting and timing

Signed-off-by: Daniel Sieradski <[email protected]>

* more options and styling

Signed-off-by: Daniel Sieradski <[email protected]>

* revalidate

Signed-off-by: Daniel Sieradski <[email protected]>

* add internal docs

Signed-off-by: Daniel Sieradski <[email protected]>

* debug

Signed-off-by: Daniel Sieradski <[email protected]>

* fix validation

Signed-off-by: Daniel Sieradski <[email protected]>

* Derp

Signed-off-by: Daniel Sieradski <[email protected]>

* more debugging

Signed-off-by: Daniel Sieradski <[email protected]>

* more formatting stuff

Signed-off-by: Daniel Sieradski <[email protected]>

* move date block

Signed-off-by: Daniel Sieradski <[email protected]>

* add showimg

Signed-off-by: Daniel Sieradski <[email protected]>

* Update docs

Signed-off-by: Daniel Sieradski <[email protected]>

* add utc mark

Signed-off-by: Daniel Sieradski <[email protected]>

* 1.2.7
  • Loading branch information
selfagency authored Mar 19, 2022
1 parent 95ee5bd commit 116b9e2
Show file tree
Hide file tree
Showing 14 changed files with 460 additions and 140 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/feedbot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ jobs:
uses: actions/cache@v2
with:
path: ./slackfeedbot-cache
key: feed-cache-e-${{ steps.generate-key.outputs.cache-key }}
restore-keys: feed-cache-e-
key: feed-cache-i-${{ steps.generate-key.outputs.cache-key }}
restore-keys: feed-cache-i-
- name: LAT
uses: 'selfagency/slackfeedbot@dev'
with:
Expand Down
58 changes: 15 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,21 @@ Push RSS feed updates to Slack via GitHub Actions

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

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

## Examples

Expand Down Expand Up @@ -54,7 +58,7 @@ jobs:
key: feed-cache-${{ steps.generate-key.outputs.cache-key }}
restore-keys: feed-cache-
- name: NYT
uses: 'selfagency/[email protected].6'
uses: 'selfagency/[email protected].7'
with:
rss: 'https://rss.nytimes.com/services/xml/rss/nyt/HomePage.xml'
slack_webhook: ${{ secrets.SLACK_WEBHOOK }}
Expand All @@ -75,45 +79,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: NYT
uses: 'selfagency/[email protected].6'
uses: 'selfagency/[email protected].7'
with:
rss: 'https://rss.nytimes.com/services/xml/rss/nyt/HomePage.xml'
slack_webhook: ${{ secrets.SLACK_WEBHOOK }}
interval: 15
```

### Unfurl URLs

```
name: FeedBot
on:
schedule:
- cron: '*/15 * * * *'
jobs:
rss-to-slack:
runs-on: ubuntu-latest
steps:
- name: Generate cache key
uses: actions/github-script@v6
id: generate-key
with:
script: |
core.setOutput('cache-key', new Date().valueOf())
- name: Retrieve cache
uses: actions/cache@v2
with:
path: ./slackfeedbot-cache
key: feed-cache-${{ steps.generate-key.outputs.cache-key }}
restore-keys: feed-cache-
- name: NYT
uses: 'selfagency/[email protected]'
with:
rss: 'https://rss.nytimes.com/services/xml/rss/nyt/HomePage.xml'
slack_webhook: ${{ secrets.SLACK_WEBHOOK }}
cache_dir: './slackfeedbot-cache'
unfurl: true
```

### Multiple feeds

```
Expand All @@ -138,13 +110,13 @@ jobs:
key: feed-cache-${{ steps.generate-key.outputs.cache-key }}
restore-keys: feed-cache-
- name: LAT
uses: 'selfagency/[email protected].6'
uses: 'selfagency/[email protected].7'
with:
rss: 'https://www.latimes.com/rss2.0.xml'
slack_webhook: ${{ secrets.SLACK_WEBHOOK }}
cache_dir: './slackfeedbot-cache'
- name: WaPo
uses: 'selfagency/[email protected].6'
uses: 'selfagency/[email protected].7'
with:
rss: 'https://feeds.washingtonpost.com/rss/homepage'
slack_webhook: ${{ secrets.SLACK_WEBHOOK }}
Expand Down
9 changes: 9 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ inputs:
interval:
description: 'Minutes between workflow runs'
required: false
show_date:
description: 'Show date in output'
required: false
show_link:
description: 'Show link in output'
required: false
show_description:
description: 'Show description in output'
required: false
unfurl:
description: 'Unfurl links'
required: false
Expand Down
Loading

0 comments on commit 116b9e2

Please sign in to comment.