Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
weixin_authorize
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ikcrm_common
weixin_authorize
Commits
f579b9b5
Commit
f579b9b5
authored
May 02, 2014
by
lanrion
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added #upload_mass_news and #upload_mass_video
parent
bce2a6e5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
1 deletions
+21
-1
lib/weixin_authorize/api/media.rb
+21
-1
No files found.
lib/weixin_authorize/api/media.rb
View file @
f579b9b5
...
...
@@ -43,11 +43,31 @@ module WeixinAuthorize
# }
# ]
# }
def
upload_news
(
news
)
# Option: author, content_source_url
def
upload_mass_news
(
news
=
[])
upload_news_url
=
"
#{
media_base_url
}
/uploadnews"
http_post
(
upload_news_url
,
{
articles:
news
})
end
# media_id: 需通过基础支持中的上传下载多媒体文件来得到
# https://file.api.weixin.qq.com/cgi-bin/media/uploadvideo?access_token=ACCESS_TOKEN
# return:
# {
# "type":"video",
# "media_id":"IhdaAQXuvJtGzwwc0abfXnzeezfO0NgPK6AQYShD8RQYMTtfzbLdBIQkQziv2XJc",
# "created_at":1398848981
# }
def
upload_mass_video
(
media_id
,
title
=
""
,
desc
=
""
)
video_msg
=
{
"media_id"
=>
media_id
,
"title"
=>
title
,
"description"
=>
desc
}
http_post
(
"
#{
media_base_url
}
/uploadvideo"
,
video_msg
)
end
private
def
process_file
(
media
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment