Code Monkey home page Code Monkey logo

obsidian-image-uploader's Introduction

Obsidian Image Uploader

This plugin could resize(optional) and upload the image in your clipboard to any image hosting automatically when pasting.

Getting started

Settings

  1. Api Endpoint: the Endpoint of the image hosting api.
  2. Upload Header: the header of upload request in json format.
  3. Upload Body: the body of upload request in json format. Don't change it unless you know what you are doing.
  4. Image Url Path: the path to the image url in http response.
  5. Enable Resize: whether resizing images before uploading.
  6. Max Width: images that wider than this will be resized resized by the natural aspect ratio.

Examples

Take Imgur as an example. The upload request is something like this:

curl --location --request POST 'https://api.imgur.com/3/image' \
--header 'Authorization: Client-ID {{clientId}}' \
--form 'image="R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"'

So, Api Endpoint should be https://api.imgur.com/3/image and Upload Header should be {"Authorization": "Client-ID {{clientId}}"}.

The response of the upload request is:

{
	"data": {
		"id": "orunSTu",
		"title": null,
		"description": null,
		"datetime": 1495556889,
		"type": "image/gif",
		"animated": false,
		"width": 1,
		"height": 1,
		"size": 42,
		"views": 0,
		"bandwidth": 0,
		"vote": null,
		"favorite": false,
		"nsfw": null,
		"section": null,
		"account_url": null,
		"account_id": 0,
		"is_ad": false,
		"in_most_viral": false,
		"tags": [],
		"ad_type": 0,
		"ad_url": "",
		"in_gallery": false,
		"deletehash": "x70po4w7BVvSUzZ",
		"name": "",
		"link": "http://i.imgur.com/orunSTu.gif"
	},
	"success": true,
	"status": 200
}

All you need is the image url http://i.imgur.com/orunSTu.gif, so Image Url Path should be data.link.

Thanks

  1. obsidian-imgur-plugin
  2. create-obsidian-plugin

obsidian-image-uploader's People

Contributors

creling avatar

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.