slackcat 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +64 -20
- data/lib/slackcat/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: be3a8e5d238d74351da94bcdedd76868cdb958b2
|
4
|
+
data.tar.gz: 221735b558a336d5ccb5651e15776f03a27aac70
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 760e9bd8afc31213d54e8d852441416d42c252b43d2077b785d0a5bd9991e58af64268fd059bc4dc5e95010d4c028a697e2763804a495f372631c6155b6d20f6
|
7
|
+
data.tar.gz: bc3b251a6b4ecb2cddea9eecc743c5c9c9241c5893c8bc256d742ba3282e0a9976e4bcafec4dd0da950fe5ea321d68ac04f9f59cc9249eb6f4b95a8d3b8ee4d3
|
data/README.md
CHANGED
@@ -8,35 +8,79 @@ command-line.
|
|
8
8
|
Log in to your slack.com account and get your API token from
|
9
9
|
https://api.slack.com/.
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
|
11
|
+
```sh
|
12
|
+
gem install slackcat
|
13
|
+
export SLACK_TOKEN=<your api token>
|
14
|
+
echo 'hello world' | slackcat -c <channel>
|
15
|
+
```
|
14
16
|
|
15
|
-
##
|
17
|
+
## Environment variables
|
16
18
|
|
17
|
-
|
18
|
-
list filenames as arguments. Multiple files will be concatenated.
|
19
|
+
* `SLACK_TOKEN`: your token from https://api.slack.com/.
|
19
20
|
|
20
|
-
|
21
|
+
## Command-line options
|
21
22
|
|
22
|
-
|
23
|
+
```
|
24
|
+
--token, -k <s>: Slack API token
|
25
|
+
--channels, -c <s>: Channels to share
|
26
|
+
--groups, -g <s>: Groups to share
|
27
|
+
--users, -u <s>: Users (DMs) to share
|
28
|
+
--filetype, -t <s>: File type identifier
|
29
|
+
--title, -T <s>: Title of file
|
30
|
+
--filename, -n <s>: Filename of file
|
31
|
+
--initial-comment, -i <s>: Initial comment to add
|
32
|
+
--post, -p: Post instead of upload
|
33
|
+
--multipart, -m: Multipart upload each file
|
34
|
+
--help, -h: Show this message
|
35
|
+
```
|
23
36
|
|
24
|
-
|
37
|
+
## Basic usage: text snippets
|
25
38
|
|
39
|
+
To upload text snippets, `slackcat` is used similarly to unix `cat`:
|
40
|
+
read data from STDIN or list filenames as arguments. Multiple files
|
41
|
+
will be concatenated.
|
42
|
+
|
43
|
+
Examples:
|
44
|
+
|
45
|
+
```sh
|
46
|
+
date | slackcat -c general
|
47
|
+
slackcat -u buddy foo.txt bar.txt
|
26
48
|
```
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
49
|
+
|
50
|
+
Uploads to slack are private by default. If you list channels, groups
|
51
|
+
or usernames, content will be shared to them.
|
52
|
+
|
53
|
+
## Multipart file uploads
|
54
|
+
|
55
|
+
If you wish to upload binary files, for example images, use the `-m`
|
56
|
+
option, which will cause each file to be uploaded separately.
|
57
|
+
|
58
|
+
Example:
|
59
|
+
|
60
|
+
```sh
|
61
|
+
slackcat -c general -m kitten.jpg cat.gif
|
62
|
+
```
|
63
|
+
|
64
|
+
Slack does a good job of setting filetype correctly from mimetype,
|
65
|
+
though you may override this with the `-t` option.
|
66
|
+
|
67
|
+
This mode does not read stdin.
|
68
|
+
|
69
|
+
## Post messages as chat text
|
70
|
+
|
71
|
+
To post text as a normal chat, instead of as a text snippet, use the
|
72
|
+
`-p` option.
|
73
|
+
|
74
|
+
Example:
|
75
|
+
|
76
|
+
```sh
|
77
|
+
date | slackcat -c general -p
|
78
|
+
slackcat -u buddy -p foo.txt bar.txt
|
36
79
|
```
|
37
80
|
|
38
|
-
|
39
|
-
|
81
|
+
Due to a limitation of the slack api, your user icon will not be set,
|
82
|
+
and your username will appear as `username (bot)`. You may also pass
|
83
|
+
only one channel, group or username.
|
40
84
|
|
41
85
|
## Example usage from vim
|
42
86
|
|
data/lib/slackcat/version.rb
CHANGED