aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/update_mocks.sh
blob: 5348796d3b9ea590918c2b61ac647e01ab0344f7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh

alias curl_slack="curl -H 'Authorization: Bearer $SLACK_TOKEN'"

api_base="https://api.slack.com/api"

if [ ! -d mock_data ]; then
  echo "The mock_data directory must exist" >&2
  exit 1
fi

curl_slack "$api_base/users.conversations?types=public_channel&exclude_archived=True" | jq . > mock_data/slack_users_conversations_public_channel.json
curl_slack "$api_base/users.conversations?types=private_channel&exclude_archived=True" | jq . > mock_data/slack_users_conversations_private_channel.json
curl_slack "$api_base/users.conversations?types=mpim&exclude_archived=True" | jq . > mock_data/slack_users_conversations_mpim.json
curl_slack "$api_base/users.conversations?types=im&exclude_archived=True" | jq . > mock_data/slack_users_conversations_im.json

curl_slack "$api_base/conversations.info?channel=CK4M8EWJE" | jq . > mock_data/slack_info_channel_public.json
curl_slack "$api_base/conversations.info?channel=CNZQKUU9M" | jq . > mock_data/slack_info_channel_private.json
curl_slack "$api_base/conversations.info?channel=GNLENA84B" | jq . > mock_data/slack_info_channel_group.json
curl_slack "$api_base/conversations.info?channel=C042VL9076F" | jq . > mock_data/slack_info_mpim_channel.json
curl_slack "$api_base/conversations.info?channel=GKHEJUM1N" | jq . > mock_data/slack_info_mpim_group.json
curl_slack "$api_base/conversations.info?channel=D9N2KD0V6" | jq . > mock_data/slack_info_im.json