This small tool can do scheduled runs to fetch the newest questions in StackOverflow (with special tags) and put it as message into Slack channels.
- Download
- Set up a webhook for a Slack channel of your choice and take note of the webhook URL.
- Copy the webhooks-example.ini file to webhooks.ini.
- Paste the webhook URL into the webhooks.ini file.
- Run
php PostNewQuestions.php
- Optionally, register an app with Stack App, note the app key, and save it to the key.txt file to bypass StackOverflow API rate limitations.
- Optionally, use the legacy
instead of the latest block Slack
message structure by running:
They differ slightly in appearance.
messagestructure="legacy" php PostNewQuestions.php
- Download
- Run
composer install ./vendor/bin/phpunit --group unit
- Download
- Set up a webhook for a Slack channel of your choice and take note of the webhook URL.
- Run
composer install SLACK_WEBHOOK_URL="<webhook-url>" ./vendor/bin/phpunit --group end-to-end
- Confirm that the StackOverflow question "Neos CMS 7: Newly created node disappears in the document tree until cache cleared" has appeared twice in your Slack channel: The first one is rendered with the block and the second one with the legacy Slack message structure.
- Optionally, register an app with Stack App,
note the app key, and run
to bypass StackOverflow API rate limitations.
composer install SLACK_WEBHOOK_URL="<webhook-url>" STACK_APPS_KEY="<app-key>" ./vendor/bin/phpunit --group end-to-end
- Optionally, restrict end-to-end testing to a specific "block" or "legacy" message structure with
composer install SLACK_MESSAGE_STRUCTURE="<message-structure>" SLACK_WEBHOOK_URL="<webhook-url>" STACK_APPS_KEY="<app-key>" ./vendor/bin/phpunit --group end-to-end