Skip to content

Commit

Permalink
Merge pull request #1 from selfagency/dev
Browse files Browse the repository at this point in the history
truncate long descriptions + workflow stuff
  • Loading branch information
selfagency authored Mar 16, 2022
2 parents f162f24 + f3a5eb2 commit 01ae228
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/feedbot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ jobs:
rss: 'https://www.latimes.com/rss2.0.xml'
slack_webhook: ${{ secrets.SLACK_WEBHOOK }}
interval: 5
unfurl: true
unfurl: false
- name: WaPo
uses: 'selfagency/feedbot@main'
with:
rss: 'https://feeds.washingtonpost.com/rss/homepage'
slack_webhook: ${{ secrets.SLACK_WEBHOOK }}
interval: 5
unfurl: true
unfurl: false
8 changes: 7 additions & 1 deletion action.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,13 @@ const run = async () => {
text = `<${item.link}|${item.title}> · ${date}`;
} else {
if (item.title) text += `*${item.title}* · ${date}\n`;
if (item.description) text += `${item.description}\n`;
if (item.description) {
if (item.description.length > 255) {
text += `${item.description.substring(0, 254)}...\n`;
} else {
text += `${item.description}\n`;
}
}
if (item.link) text += `<${item.link}|Read more>`;
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "feedbot",
"version": "1.0.6",
"version": "1.0.7",
"main": "action.js",
"author": "Daniel Sieradski <[email protected]>",
"license": "MIT",
Expand Down

0 comments on commit 01ae228

Please sign in to comment.