wx_opendata 0.1.1 → 0.1.2

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: 1699ef3c57e9e4189e2c371b5c47905e9d331321
4
- data.tar.gz: 42749163d3b371025c129d23fb7a93b6e787ab55
3
+ metadata.gz: ad3fbc3ff82de106524e74ce7b06d5aaad71b9b8
4
+ data.tar.gz: 7c5ce04b2714609c3d35babe6c52d18a9dbc32d4
5
5
  SHA512:
6
- metadata.gz: 063d446971c3127d3ff93fff01dac39902c75700eac5d0b031a560009fc35681bff4f297d2e1c75d373906d3c85a4d11ba55c1e0d816b77e474feb2a381e3981
7
- data.tar.gz: 402202ff4258eae20d649c66e47e779b036c79ac3c61a38fc1902cd073dd0fcfde5ef9f15b9a1d760c87a4f6e5a03375a043a01431ecbb8d19e384023bbe3214
6
+ metadata.gz: a3ce36b010105d0dac848d3b680244e178393603a4e54addeb5e73c68024ba6b545686b535a67a919853bcf0997e227cdb1726f0b1c318256be8a144f5d18903
7
+ data.tar.gz: bfbbdd164926bcb336ce20f67436a27f5da741ce26b5d87109ac9897f9c7dcb4fef8af2b250474d16f2e31edd96b0f2bd09ea11b131e5be6d392a93aeccd56a7
@@ -12,3 +12,4 @@ module WxOpendata
12
12
  class<< self
13
13
  end
14
14
  end
15
+
@@ -16,7 +16,7 @@ module WxOpendata
16
16
  form_id = params[:form_id]
17
17
  page = params[:page] || 'pages/index/main'
18
18
  data = params[:data] || { keyword1: { value: 'Test Message Template' } }
19
- emphasis_keyword = params[:emphasis_keyword] || "keyword1.DATA"
19
+ emphasis_keyword = params[:emphasis_keyword] || ""
20
20
  p = { touser: touser, template_id: template_id, form_id: form_id, page: page, data: data, emphasis_keyword: emphasis_keyword }
21
21
  jsondata = post(url, p)
22
22
  begin
@@ -0,0 +1,11 @@
1
+ module WxOpendata
2
+ module Signature
3
+ token = "jxEPPsMsuxw2tnY4_Ss-4moPWh151NsQ"
4
+ def check(signature, timestamp, nonce, encrypt)
5
+ tmp_arr = [token, timestamp, nonce]
6
+ tmp_arr << encrypt unless encrypt.nil?
7
+ sign = tmp_arr.compact.collect(&:to_s).sort.join
8
+ Digest::SHA1.hexdigest sign == signature
9
+ end
10
+ end
11
+ end
@@ -1,3 +1,3 @@
1
1
  module WxOpendata
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wx_opendata
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mot_Wu
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-03-12 00:00:00.000000000 Z
11
+ date: 2019-03-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client
@@ -96,6 +96,7 @@ files:
96
96
  - Rakefile
97
97
  - lib/wx_opendata.rb
98
98
  - lib/wx_opendata/service.rb
99
+ - lib/wx_opendata/signature.rb
99
100
  - lib/wx_opendata/token.rb
100
101
  - lib/wx_opendata/version.rb
101
102
  - spec/spec_helper.rb