{"id":28565746,"url":"https://github.com/postlight/slash-mercury-parser","last_synced_at":"2026-03-10T14:04:38.289Z","repository":{"id":74654613,"uuid":"174321079","full_name":"postlight/slash-mercury-parser","owner":"postlight","description":"🤖 Slack slash command that turns a link to an article into a readable post within a channel","archived":false,"fork":false,"pushed_at":"2023-02-08T11:08:59.000Z","size":179,"stargazers_count":11,"open_issues_count":0,"forks_count":3,"subscribers_count":29,"default_branch":"master","last_synced_at":"2025-06-10T14:50:15.221Z","etag":null,"topics":["aws-lambda","labs","mercury","mercury-parser","serverless","slack","slackbot"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/postlight.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-03-07T10:15:34.000Z","updated_at":"2025-04-27T18:17:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"2e4dc2bb-912b-4d2a-919f-db3d2e8488af","html_url":"https://github.com/postlight/slash-mercury-parser","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/postlight/slash-mercury-parser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/postlight%2Fslash-mercury-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/postlight%2Fslash-mercury-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/postlight%2Fslash-mercury-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/postlight%2Fslash-mercury-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/postlight","download_url":"https://codeload.github.com/postlight/slash-mercury-parser/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/postlight%2Fslash-mercury-parser/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30336106,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T12:41:07.687Z","status":"ssl_error","status_checked_at":"2026-03-10T12:41:06.728Z","response_time":106,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws-lambda","labs","mercury","mercury-parser","serverless","slack","slackbot"],"created_at":"2025-06-10T14:40:16.782Z","updated_at":"2026-03-10T14:04:38.277Z","avatar_url":"https://github.com/postlight.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Parser\n\nThis is a [serverless](https://serverless.com/) Slack Bot that uses Postlight's [mercury parser](https://github.com/postlight/mercury-parser) to display the parsed content directly in your slack channel! So instead of sending a link to a certain article that will open in a new browser window, you will be sending the article as a readable post directly.\n\nOnce everything is set, use it as follows:\n\n```bash\n/parser \u003curl\u003e\n```\n\n![bot-demo](https://user-images.githubusercontent.com/32297675/54197472-b740b880-44cc-11e9-9d5a-f413ca3cff52.gif)\n\n## Development\n\nThis repo is based on Postlight's [serverless-babel-starter](https://github.com/postlight/serverless-babel-starter). You can refer to it for serverless development documentation.\n\n### Setting up the workspace\n\nclone this repo:\n\n```bash\ngit clone https://github.com/postlight/slash-mercury-parser.git\n```\n\nInstall dependencies:\n\n```bash\nyarn install\n```\n\n### Creating your Slack Bot\n\nCreate a new slack app [here](https://api.slack.com/apps?new_app=1) and link it to your development slack workspace.\n\nUnder `Add feature and functionality`:\n\n- Add a bot:\n\n  - Click on `Bots`\n  - Click on `Add a bot User`\n  - Enter a `Display name` and `Default username`\n  - Click on `Add bot User`\n    \u0026nbsp;\n\n- Add a slash command\n  - Click on `Slash Commands`\n  - Click on `Create New Command`\n  - Enter `/parser`, `https://example.com/invoke`, and `Renders the parsed content` for `Command`, `Request URL`, and `Short Description`\n  - Click on `Save`\n\n**NOTE:** you will fill in a correct `Request URL` once you deploy your functions. You can leave it as is for now.\n\n### Environment variables\n\nAfter you've installed the bot in your slack workspace, navigate to `Install App` under `Settings` and copy your `Bot User OAuth Access Token`. This token will be used to verify the slack API call.\n\nCreate a `secrets.json` file in the project root and add the following:\n\n```json\n{\n  \"SLACK_AUTH_TOKEN\": \"xxxx-YOUR-ACCESS-TOKEN\"\n}\n```\n\n### Deploying the functions\n\n```bash\nyarn deploy:env\n```\n\nWindows users should modify the `deploy` scripts as follows:\n\n```json\n{\n  \"deploy:dev\": \"sls deploy --stage dev\",\n  \"deploy:stage\": \"sls deploy --stage stage\",\n  \"deploy:production\": \"sls deploy --stage production\"\n}\n```\n\n**NOTE:** save your `/post` URL when the deployment is complete. It looks like this: `https://xxxxxxx.execute-api.region.amazonaws.com/env/invoke` and replace your `Request URL` with it.\n\n### Testing the bot\n\nInside a `public` channel in your slack workspace, invoke the bot using:\n\n```bash\n/parser \u003curl\u003e\n```\n\nYou should see a `Parsing your article ..` message which is only visible to you, followed by a bot response of the parsed content as a post.\n\n## The logic behind a slack bot\n\n- Whenever the slash command is executed, slack makes a `POST` request to your app via the `Request URL` that was set.\n- Your logic will get executed and will invoke a slack API call.\n- Slack expects a response within 3 seconds\n- [Slack API Documentation](https://api.slack.com/web)\n\n## The logic behind the parser bot\n\nSince Slack expects an `OK` response within 3 seconds, the first lambda function `./src/invoke.js` checks for any errors in the URL, fetches the content from mercury, and invokes the second function `./src/uploadPost.js`. The second function is responsible for hitting the slack API and sending the post. If an error occurs, the user will be notified.\n\nFor example, `/parser blabla` will result in this error:\n\n![image](https://user-images.githubusercontent.com/32297675/54199202-ff61da00-44d0-11e9-8161-288152b424c9.png)\n\n## Contributing\n\nUnless it is explicitly stated otherwise, any contribution intentionally submitted for inclusion in the work, as defined in the Apache-2.0 license, shall be dual licensed as above without any additional terms or conditions.\n\n---\n\n🔬 A Labs project from your friends at [Postlight](https://postlight.com/labs)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpostlight%2Fslash-mercury-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpostlight%2Fslash-mercury-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpostlight%2Fslash-mercury-parser/lists"}