Skip to content

Commit 238eef2

Browse files
committed
tweaks to README, TODO and example
1 parent 066e284 commit 238eef2

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

.env.example

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
SLACK_SIGNING_SECRET=<secret from https://api.slack.com/apps/<your-slack-app>/general>
2-
PORT=<port you want your public facing bot to run on>
32
SLACK_TOKEN=<token for slacks web api>
4-
SUBMIT_MESSAGE_TEMPLATE=Please follow <{{link}}|this link> to submit
5-
SUBMIT_LINK_TEMPLATE=<http://response.message/including?message={{message}}
3+
PORT=<port you want your public facing bot to run on>
4+
SUBMIT_LINK_TEMPLATE=https://airtable.com/path-to-the-form?prefill_Description={{ogDescription}}&prefill_Featured+Image={{ogImageUrl}}&prefill_Resources={{ogUrl}}&prefill_Project+Title={{ogTitle}}
5+
SUBMIT_MESSAGE_TEMPLATE=Please follow <{{submitLink}}|this link> to submit

README.md

+13-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
# README
22

3-
submit-this is a simple slack bot that can take a slack message, and construct a link (to a website of your choice) with the message included as a query parameter, and send you a slack message including the link. Designed to be useful for prefilling forms.
3+
submit-this is a simple slack bot that can take a slack message, and construct a link (to a website of your choice) with query parameters derived from your message, and send you a slack message including the link. Designed to be useful for prefilling forms.
4+
5+
So, you could send the bot a message
6+
7+
@submitthis here is the data for submission
8+
9+
and the text "here is the data for submission" would be sent to the form. Alternatively the message
10+
11+
@submitthis http://an.intersting.website.com
12+
13+
would result in the opengraph data from the website (title, description, image) being sent to the form
414

515
## Setup
616

@@ -43,6 +53,8 @@ Configure more environment variables (differently in development and production
4353
- SUBMIT_MESSAGE_TEMPLATE - to customise the complete message created by the bot.
4454
- SUBMIT_LINK_TEMPLATE - to customise the link created by the bot.
4555

56+
The message template in [.env.example](.env.example) is a full example of how this could be used with [airtable.com](https://airtable.com/), using opengraph data obtained from a link in the message you send to the bot.
57+
4658
You may find [this formatting guide](https://api.slack.com/reference/surfaces/formatting#linking-urls) useful ... most importantly, it shows how to craft a message with a url linked from alternative text, since this bot will likely be creating long links.
4759

4860
### Start

TODO.md

-8
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,6 @@
1212

1313
## on a slack thread, takes the main message of the thread if no content
1414

15-
## Exploit OpenGraph
16-
17-
possibly using [openGraphScraper](https://github.com/jshemas/openGraphScraper) ( guide [here](https://davidwalsh.name/open-graph-data-nodejs) )
18-
19-
## vscode
20-
21-
test coverage and gutters
22-
2315
## flow
2416

2517
can flow do anything useful (matching parameter lists ?) without needing babel.

0 commit comments

Comments
 (0)