上传图文消息素材 详情请参考 http://mp.weixin.qq.com/wiki/15/5380a4e6f02f2ffdc7981a8ed7a40753.html :param articles: 图文消息数组 :return: 返回的 JSON 数据包
(self, articles)
| 67 | ) |
| 68 | |
| 69 | def upload_articles(self, articles): |
| 70 | """ |
| 71 | 上传图文消息素材 |
| 72 | 详情请参考 |
| 73 | http://mp.weixin.qq.com/wiki/15/5380a4e6f02f2ffdc7981a8ed7a40753.html |
| 74 | |
| 75 | :param articles: 图文消息数组 |
| 76 | :return: 返回的 JSON 数据包 |
| 77 | """ |
| 78 | articles_data = [] |
| 79 | for article in articles: |
| 80 | articles_data.append({ |
| 81 | 'thumb_media_id': article['thumb_media_id'], |
| 82 | 'title': article['title'], |
| 83 | 'content': article['content'], |
| 84 | 'author': article.get('author', ''), |
| 85 | 'content_source_url': article.get('content_source_url', ''), |
| 86 | 'digest': article.get('digest', ''), |
| 87 | 'show_cover_pic': article.get('show_cover_pic', 0) |
| 88 | }) |
| 89 | return self._post( |
| 90 | 'media/uploadnews', |
| 91 | data={ |
| 92 | 'articles': articles_data |
| 93 | } |
| 94 | ) |
| 95 | |
| 96 | def upload_image(self, media_file): |
| 97 | """ |