+
Skip to content

Browser friendly package that converts twitter's API tweet objects text property to HTML. Takes care of all the entities and its links. Handles emoji's.

License

Notifications You must be signed in to change notification settings

coreation/tweet-to-html

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tweet-to-html

Build Status npm version

Browser friendly package that converts twitter's API tweet objects text property to HTML. Takes care of all the entities and its links. Handles emoji's.

Demo

http://blessanmathew.com/tweet-to-html

Installation

npm install tweet-to-html -S

Usage

There is only one method named parse. You can pass in a tweet object or an array of objects, and an optional config object. The response will be object/array tweet object with a new property named html with the parsed output.

var tweetToHTML = require('tweet-to-html');

var result  = tweetToHTML.parse(tweetObj); //Single tweet object
var results = tweetToHTML.parse(tweetArr); //Multiple tweets in an array

var photoConfig = {
  photoSize: 'large' // Any size supported by the `media` entity (thumb, small, medium...)
};

var result  = tweetToHTML.parse(tweetObj, photoConfig); //Single tweet object with specified image size

//output
console.log(result.html);
console.log(results[0].html);

##Issues Or Contributions

About

Browser friendly package that converts twitter's API tweet objects text property to HTML. Takes care of all the entities and its links. Handles emoji's.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载