Commit 0986bddd by lanrion

clean codes

parent 44882ef5
...@@ -54,7 +54,7 @@ module WeixinAuthorize ...@@ -54,7 +54,7 @@ module WeixinAuthorize
# "media_id":"MEDIA_ID" # "media_id":"MEDIA_ID"
# } # }
# } # }
def send_video_custom(to_user, media_id, options) def send_video_custom(to_user, media_id, options={})
video_options = {media_id: media_id}.merge(options) video_options = {media_id: media_id}.merge(options)
message = default_options(to_user).merge({msgtype: video, video: video_options}) message = default_options(to_user).merge({msgtype: video, video: video_options})
http_post(custom_base_url, MultiJson.dump(message)) http_post(custom_base_url, MultiJson.dump(message))
...@@ -73,7 +73,7 @@ module WeixinAuthorize ...@@ -73,7 +73,7 @@ module WeixinAuthorize
# "thumb_media_id":"THUMB_MEDIA_ID" # "thumb_media_id":"THUMB_MEDIA_ID"
# } # }
# } # }
def send_music_custom(to_user, media_id, musicurl, hqmusicurl, options) def send_music_custom(to_user, media_id, musicurl, hqmusicurl, options={})
music_options = { thumb_media_id: media_id, musicurl: musicurl, music_options = { thumb_media_id: media_id, musicurl: musicurl,
hqmusicurl: hqmusicurl}.merge(options) hqmusicurl: hqmusicurl}.merge(options)
message = default_options(to_user).merge({msgtype: music, music: music_options}) message = default_options(to_user).merge({msgtype: music, music: music_options})
......
...@@ -9,7 +9,6 @@ module WeixinAuthorize ...@@ -9,7 +9,6 @@ module WeixinAuthorize
create_url = "#{group_base_url}/create" create_url = "#{group_base_url}/create"
group = MultiJson.dump({group: {name: group_name}}) group = MultiJson.dump({group: {name: group_name}})
http_post(create_url, group) http_post(create_url, group)
end end
# 查询所有分组 # 查询所有分组
...@@ -25,7 +24,6 @@ module WeixinAuthorize ...@@ -25,7 +24,6 @@ module WeixinAuthorize
group_url = "#{group_base_url}/getid" group_url = "#{group_base_url}/getid"
openid = MultiJson.dump({openid: openid}) openid = MultiJson.dump({openid: openid})
http_post(group_url, openid) http_post(group_url, openid)
end end
# 修改分组名 # 修改分组名
......
...@@ -11,9 +11,9 @@ module WeixinAuthorize ...@@ -11,9 +11,9 @@ module WeixinAuthorize
http_get(user_info_url, {openid: openid, lang: lang}) http_get(user_info_url, {openid: openid, lang: lang})
end end
# https://api.weixin.qq.com/cgi-bin/user/get?access_token=ACCESS_TOKEN&next_openid=NEXT_OPENID
# 获取关注者列表 # 获取关注者列表
def followers(next_openid=nil) # https://api.weixin.qq.com/cgi-bin/user/get?access_token=ACCESS_TOKEN&next_openid=NEXT_OPENID
def followers(next_openid="")
followers_url = "#{user_base_url}/get" followers_url = "#{user_base_url}/get"
http_get(followers_url, {next_openid: next_openid}) http_get(followers_url, {next_openid: next_openid})
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment