wechat 0.12.3 → 0.12.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4f3b96f4a7e2cd18a4a2407f550cf0437fefa8766e26e1356692918932f6441a
4
- data.tar.gz: 024176770cbb290d9fa7039dbb395a6d60d0a64dd6ad20777928771be5feb93d
3
+ metadata.gz: 761a53485d1170176263ef051a032606c7ae1c5533c6ec9c3f4808a4aeb5cd66
4
+ data.tar.gz: be822b26ee8bc46bcc548190d8f7082e0424d9214ed88a26e3846be39c7fcde2
5
5
  SHA512:
6
- metadata.gz: 51d9e9ede2d8479c81e9b389e3bcfb3ffcf96a4daee330998d30fcde88cb35f7b36b2cf92754e537720781475105ac59e974047b81bc5c12b462b8a0cf156fa1
7
- data.tar.gz: '09fa4efec1ba2843ac564f1ef97b71728d91439849175767416abf67263916c1214b434ea542d85ccb9b1f45e3d3a9538f4555eebfe6acfd6ee85e77fb18c3a1'
6
+ metadata.gz: 261f379c71351cf41d93e4bc3953c66f62d11c2f136111f2642379e78cde736e2e2667817c71f3001fec80d4432f83dcde2f4ac5d6f380b67daa55d6477252e4
7
+ data.tar.gz: b57190737963d214a9e644334ead4af99e68b774b3973f49ae652f6576b8aeb248407062e0ffc0fbb3ac86347b81b6b90942b632090eef6729ce6dc98504f4fe
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## v0.12.4 (released at 4/21/2021)
4
+
5
+ * New material_add_news API, by @zlei1 #300
6
+ * Support open_tag, by @xiajian2019 #299
7
+
3
8
  ## v0.12.3 (released at 3/15/2021)
4
9
 
5
10
  * Fix MpApi initialize bug, by @hardywu #296
data/README-CN.md CHANGED
@@ -362,6 +362,7 @@ Wechat Public Account commands:
362
362
  wechat groups # 查询所有分组
363
363
  wechat material_get [MEDIA_ID, PATH] # 永久媒体下载
364
364
  wechat material_add [MEDIA_TYPE, PATH] # 永久媒体上传
365
+ wechat material_add_news [MPNEWS_YAML_PATH] # 永久图文素材上传
365
366
  wechat material_count # 获取永久素材总数
366
367
  wechat material_delete [MEDIA_ID] # 删除永久素材
367
368
  wechat material_list [TYPE, OFFSET, COUNT] # 获取永久素材列表
data/README.md CHANGED
@@ -391,8 +391,9 @@ Wechat Public Account commands:
391
391
  wechat group_delete [GROUP_ID] # 删除分组
392
392
  wechat group_update [GROUP_ID, NEW_GROUP_NAME] # 修改分组名
393
393
  wechat groups # 查询所有分组
394
- wechat material_get [MEDIA_ID, PATH] # 永久媒体下载
394
+ wechat material_get [MEDIA_ID, PATH] # 永久媒体下载
395
395
  wechat material_add [MEDIA_TYPE, PATH] # 永久媒体上传
396
+ wechat material_add_news [MPNEWS_YAML_PATH] # 永久图文素材上传
396
397
  wechat material_count # 获取永久素材总数
397
398
  wechat material_delete [MEDIA_ID] # 删除永久素材
398
399
  wechat material_list [TYPE, OFFSET, COUNT] # 获取永久素材列表
data/bin/wechat CHANGED
@@ -411,6 +411,12 @@ class App < Thor
411
411
  puts wechat_api.material_add(type, path)
412
412
  end
413
413
 
414
+ desc 'material_add_news [MPNEWS_YAML_PATH]', '永久图文素材上传'
415
+ def material_add_news(mpnews_yaml_path)
416
+ new = YAML.load(File.read(mpnews_yaml_path))
417
+ puts wechat_api.material_add_news(Wechat::Message.new(MsgType: 'mpnews').mpnews(new['articles']))
418
+ end
419
+
414
420
  desc 'material_delete [MEDIA_ID]', '删除永久素材'
415
421
  def material_delete(media_id)
416
422
  puts wechat_api.material_delete(media_id)
@@ -152,6 +152,10 @@ module Wechat
152
152
  post_file 'material/add_material', file, params: { type: type }
153
153
  end
154
154
 
155
+ def material_add_news(mpnews_message)
156
+ post 'material/add_news', mpnews_message.to_json
157
+ end
158
+
155
159
  def material_delete(media_id)
156
160
  post 'material/del_material', JSON.generate(media_id: media_id)
157
161
  end
@@ -34,7 +34,8 @@ module Wechat
34
34
  timestamp: "#{js_hash[:timestamp]}",
35
35
  nonceStr: "#{js_hash[:noncestr]}",
36
36
  signature: "#{js_hash[:signature]}",
37
- jsApiList: ['#{config_options[:api].join("','")}']
37
+ jsApiList: ['#{config_options[:api]&.join("','")}'],
38
+ openTagList: ['#{config_options[:open_tags]&.join("','")}']
38
39
  });
39
40
  WECHAT_CONFIG_JS
40
41
  javascript_tag config_js, type: 'application/javascript'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wechat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.3
4
+ version: 0.12.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Skinnyworm
@@ -35,7 +35,7 @@ cert_chain:
35
35
  spvOK5/LPXWX6ZGc2SR8SH/s7ftYH2EkeM1VUbtemow08NdgCwJ4IG+fRQ9dcrJ+
36
36
  L9TbpLHvVrCe1w8duMqNeUmqj+M1iC/5Zst2vIe14QcOTuAh
37
37
  -----END CERTIFICATE-----
38
- date: 2021-03-15 00:00:00.000000000 Z
38
+ date: 2021-04-21 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: activesupport
@@ -153,14 +153,14 @@ dependencies:
153
153
  requirements:
154
154
  - - "~>"
155
155
  - !ruby/object:Gem::Version
156
- version: '4.0'
156
+ version: '5.0'
157
157
  type: :development
158
158
  prerelease: false
159
159
  version_requirements: !ruby/object:Gem::Requirement
160
160
  requirements:
161
161
  - - "~>"
162
162
  - !ruby/object:Gem::Version
163
- version: '4.0'
163
+ version: '5.0'
164
164
  - !ruby/object:Gem::Dependency
165
165
  name: sqlite3
166
166
  requirement: !ruby/object:Gem::Requirement
@@ -244,7 +244,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
244
244
  - !ruby/object:Gem::Version
245
245
  version: '0'
246
246
  requirements: []
247
- rubygems_version: 3.2.14
247
+ rubygems_version: 3.2.16
248
248
  signing_key:
249
249
  specification_version: 4
250
250
  summary: DSL for wechat message handling and API
metadata.gz.sig CHANGED
Binary file