1.0.0 • Published 4 years ago

editorjs-social-post-plugin v1.0.0

Weekly downloads
45
License
ISC
Repository
-
Last release
4 years ago

npm.io

Social Post Plugin for Editor.js

An Editor.js plugin to add Uploaded Posts from different Social Media Platforms such as:

  • Twitter
  • Facebook
  • Instagram

Screenshots

Twitter ExampleFacebook Example
Twitter ExampleFacebook Example
Instagram Example
Instagram Example

Features

  • Add posts by pasting its URL and selecting the social media platform.
  • Add an optional Caption giving more context about the post.
  • A preview of the uploaded social media post is presented.
  • Error is thrown if post URL is invalid.

Installation

Install via NPM

Get the package

npm i editorjs-social-post-plugin

Include module at your application

import Gist from 'editorjs-social-post-plugin';

Other methods

Manual downloading and connecting

  1. Download folder dist from repository
  2. Add dist folder to your page.
  3. Import main.js file inside the dist folder.

Usage

Add the plugin to the tools property of the Editor.js initial config as a new tool.

import SocialPost from 'editorjs-social-post-plugin';

var editor = EditorJS({
  ...

  tools: {
    ...
    socialPost: SocialPost
  }

  ...
});

Output data

This Plugin/Tool returns data with following format:

FieldTypeDescription
socialMediaPlatformstringselected Social Media Platform
urlstringURL of the Social Media Post added
captionstringCaption for the post

Example:

{
  "type": "socialPost",
  "data": {
    "socialMediaPlatform": "Instagram",
    "url": "https://www.instagram.com/p/fA9uwTtkSN/",
    "caption": "Cats are so cute! <3"
  }
}