Coder Social home page Coder Social logo

sinapichostingapi's Introduction

新浪图床API

已经停止开发维护,想接入打码平台来着,,,以后有空再弄。。

设计初衷 && 用途:

新入MacBook Air看到了一个感觉不错的markdown编辑器 —— MWeb, 某日发现他竟然有自动上传本地图片到网络的功能!!然而却没有新浪图床,于是就有了这个API。写完API才发现,这功能真·上传图片,并不会替换图片地址,有点鸡肋。卒。 所以你们可以用于MWeb或者其他用途,,我最近在用它做一个Hexo生成静态文件时自动上传图片到新浪的插件,蛤蛤。

用法

  1. git clone https://github.com/J3n5en/sinaPicHostingApi.git 克隆项目
  2. yarn(or npm i) 安装依赖
  3. 修改config.json
  4. node index.js 运行server
  5. 在Mweb中添加发布服务(or 其他用途)

config.json 说明

{
	"auth": {
		"username": "", // 新浪账号
		"password": "" // 新浪密码
	},
	"port": 8088,   // api监听端口
	"url": "/upload",  //api url
	"default": {
		"protocol": "https",  // 默认的协议 ['http','https']
		"size": "large" // 默认的图片大小{'large':'原图','mw690':'中等尺寸':'thumbnail':'缩略图'}
	}
}

POST字段说明

字段名 字段内容 描述
protocol http/https 协议
size large/mw690/thumbnail 大小
file 图片文件 图片文件

说明:POST字段优先级大于config.json中的设置

更新:

写这篇readme的时候发现,直接复制图片,然后在编辑器中cmd + v即可完成上传图片,及添加图片功能,有点爽。

#EOF#

sinapichostingapi's People

Contributors

j3n5en avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

sinapichostingapi's Issues

问一个比较蠢的问题

这个图片怎么上传呢,可以直接传url地址吗,有没有demo看一下 ,node看不懂。。。。。。。。。。。。。

上传文件,然后嗝屁.

(node:13886) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: Cannot read property '1' of null
(node:13886) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
cookies.json空的
微博账户新注册的
启动时不报错,向api提交文件才出错
dalao快修复啊

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.