slackgetter 0.1.0 → 0.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6c60b52b8e67de77e91dda57072b1399df1ce7d4
4
- data.tar.gz: 3f4fcad0595069522287392ca6849a21d20f7da0
3
+ metadata.gz: 85f36d5df650326a921ce38ed9593f81d3312ebe
4
+ data.tar.gz: af8e46920a17a630434226d22cfd70da65abab5c
5
5
  SHA512:
6
- metadata.gz: 635753a312ca5972cbfd655ac7aa460a6a01bb52cf25d834184dcace008a5dc068a927ab4fbc569ed2c08e9246c55d2a8f9c7661cf8fdd6aa09836cd25b7d02a
7
- data.tar.gz: f2759d813fa7116a608f83e0c71485c577405516c3e43e4644234ba8d2188c0028c2a49ea38be10e52bac3d31e60b6270c20ef154626a2db4d7303a0c8f6a51c
6
+ metadata.gz: abc315f739696811fb70869b23b0f5dea25b145fb6365ecf3edf564f0e0241118cd5b29b1bc4b9c5070ea435b38148a423f7a4a100ac2c5557e749cadc727183
7
+ data.tar.gz: a03f1ec3f6b755d0300bb09c42bb0d1244d22051145f5c822a8dbcae147db31b47033351b3bb7afc29e0e48254808a12e070bb1de84b81981afed6c141be99d5
data/README.md CHANGED
@@ -22,7 +22,41 @@ Or install it yourself as:
22
22
 
23
23
  ## Usage
24
24
 
25
- TODO: Write usage instructions here
25
+ ### Setting environment variable
26
+
27
+ Generate token with [legacy token generator](https://api.slack.com/custom-integrations/legacy-tokens).
28
+
29
+ Edit `~/.bash_profile` (or `~/.zshrc` if you use Zsh) to set `SLACK_TOKEN` environment variable:
30
+
31
+ ```
32
+ export SLACK_TOKEN=<generated-token>
33
+ ```
34
+
35
+ ### Examples to get messages
36
+
37
+ Getting messages in `general` channel from just one day ago to now:
38
+
39
+ ```
40
+ $ slackgetter time general
41
+ ```
42
+
43
+ Getting messages in `general` channel from `2017-04-01 12:34:56` to now:
44
+
45
+ ```
46
+ $ slackgetter time general `2017-04-01 12:34:56`
47
+ ```
48
+
49
+ Getting messages in `general` channel from `2017-04-01 0:00` to `2017-04-01 9:00`:
50
+
51
+ ```
52
+ $ slackgetter time general 2017-04-01 '2017-04-01 9:00'
53
+ ```
54
+
55
+ Getting messages with URL in `general` channel from `https://t-okuaki.slack.com/archives/XXXXXXXXX/p1492065698851926` to `https://t-okuaki.slack.com/archives/XXXXXXXXX/p1492095485531747`:
56
+
57
+ ```
58
+ $ slackgetter url general https://t-okuaki.slack.com/archives/XXXXXXXXX/p1492065698851926 https://t-okuaki.slack.com/archives/XXXXXXXXX/p1492095485531747
59
+ ```
26
60
 
27
61
  ## Development
28
62
 
@@ -32,10 +66,9 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
32
66
 
33
67
  ## Contributing
34
68
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/slackgetter. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
69
+ Bug reports and pull requests are welcome on GitHub at https://github.com/t-okuaki/slackgetter. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
36
70
 
37
71
 
38
72
  ## License
39
73
 
40
74
  The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
41
-
@@ -22,7 +22,7 @@ module Slackgetter
22
22
  end
23
23
 
24
24
  def self.url_to_time(url)
25
- Time.at url.gsub(/.+\/archives\/.+\/p(.+)/){$1}.insert(10, ".").to_f
25
+ Time.at url.gsub(/.+\/p(.+)\z/){$1}.insert(10, ".").to_f
26
26
  end
27
27
 
28
28
  def self.channel_id(channel_name)
@@ -1,3 +1,3 @@
1
1
  module Slackgetter
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slackgetter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - t-okuaki
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-04-19 00:00:00.000000000 Z
11
+ date: 2017-04-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler