pymedium非官方媒体api
PyMedium的Python项目详细描述
pymedium
pymedium是一个用python烧瓶编写的非官方媒体api。它 提供开发人员访问用户、帖子列表和详细信息的权限 来自Medium网站。这是一个只读api 要从媒体访问公共信息,可以将此api自定义为 满足您的需求并部署到您自己的服务器上。
现在我们提供另一种方法:python客户端sdk 你的申请。更多详细信息请转到wiki page。
安装
在运行pymedium api之前,必须从 存储库,首先安装需求。
$ git clone git@github.com:enginebai/PyMedium.git
$ cd PyMedium
$ pip install -r requirements.txt
然后从下载web驱动程序到driver文件夹 Selenium或通过 带有curl(用最新版本更新{VERSION})的命令行 使用服务器操作系统编写代码和{OS}。
$ mkdir driver |cd driver $ curl -O https://chromedriver.storage.googleapis.com/{VERSION}/chromedriver_{OS}.zip $ unzip chromedriver_{OS}.zip
用法
要运行此api应用程序,请使用与Flask Quickstart相同的flask命令
$ exportFLASK_APP=./pymedium/api.py $ exportFLASK_DEBUG=1## if you run in debug mode. $ flask run * Running on http://localhost:5000/
文档
用户
- GET /@{username}-获取用户配置文件
响应
{"avatar":"1*Y7zH0UM975YmchIO86uIGA.jpeg","bio":"Mixtape of developer, designer and startup. Cofounder and developer of DualCores Studio. Follow my technical blog: http://enginebai.logdown.com/","display_name":"Engine Bai","facebook":"789985027713671","followedby_count":445,"following_count":238,"publications":[{"creator_user_id":"3301d32a6bba","description":"Stories from the mix of designer and developer. 設計與工程的交織,混搭激盪出不同的想像。","display_name":"DualCores Studio","follower_count":302,"image":{"image_id":"1*DLixNgsMpK5B74na3EDucQ.png","original_height":591,"original_width":591},"logo":{"image_id":"1*DLixNgsMpK5B74na3EDucQ.png","original_height":591,"original_width":591},"name":"dualcores-studio","post_count":0,"publication_id":"275e26e7c1b2","url":"https://medium.com/dualcores-studio"},...more],"twitter":"enginebai","user_id":"3301d32a6bba","username":"enginebai"}
出版
- GET /{publication_name}-获取发布配置文件
{"creator_user_id":"3301d32a6bba","description":"Stories from the mix of designer and developer. 設計與工程的交織,混搭激盪出不同的想像。","display_name":"DualCores Studio","follower_count":302,"image":{"image_id":"1*DLixNgsMpK5B74na3EDucQ.png","original_height":591,"original_width":591},"logo":{"image_id":"1*DLixNgsMpK5B74na3EDucQ.png","original_height":591,"original_width":591},"name":"dualcores-studio","post_count":0,"publication_id":"275e26e7c1b2","url":"https://medium.com/dualcores-studio"}
后
- GET /@{username}/posts-获取用户最新帖子
- GET /{publication_name}/posts-获取出版物的最新文章
- GET /top-获取最受欢迎的今日帖子
- GET /tag/{tag}-在热门帖子中添加标签
- GET /tag/{tag}/latest-在最新帖子中添加标签
参数
Name | Type | Description |
---|---|---|
n | integer | The count of posts to return. Default is 10. |
响应
[{"image_count":14,"post_date":1478533474858,"post_id":"99a3d86df228","preview_image":{"image_id":"1*zhnQJhNzp-Oal1-GU1EUKw.png","original_height":412,"original_width":608},"read_time":7.74811320754717,"recommend_count":351,"response_count":10,"title":"Make an android custom view, publish and open source.","url":"https://medium.com/dualcores-studio/make-an-android-custom-view-publish-and-open-source-99a3d86df228","word_count":1669},...more]
柱细节
- GET /post-获取文章内容
参数
Name | Type | Desc ript ion |
---|---|---|
u | stri ng | The post url to pars e cont ent. |
form at | stri ng | (opt iona l) The form at of resp onse , the valu e coul d be ^{tt14}$ , ^{tt15}$ , ^{tt16}$ , defa ult is ^{tt14}$ . |
响应
## Simple text, json, html, markdown format
问题
请随时提交错误报告或功能请求,并确保 在发行任何一期之前,请阅读投稿指南。
贡献
- 检查打开/关闭问题或为功能请求打开新问题 或者使用不同标签(feature/bug)的错误报告。
- 把这个repository叉在 github开始在master或new分支上自定义。
- 编写一个测试,显示功能按预期工作,或者 虫子被固定住了。
- 发送请求并等待代码检查。
许可证
版权所有(c)2017引擎BAI根据MIT license授权。