twitter-beautifier
A short library used to beautify a raw Twitter API json response to a usable html snippet
var Twitter = ;var TwitterBeautifier = ; var client = consumer_key: '' consumer_secret: '' access_token_key: '' access_token_secret: ''; var params = screen_name: 'nodejs';client;
Installation
npm install twitter-beautifier
Quick start
Use twitter node to use it : https://www.npmjs.com/package/twitter
Examples
hashtags
var TwitterBeautifier = ;var tweet = text: 'hello world #javascript' entities: hashtags: text: 'javascript' ;;/** hello world <a href="https://www.twitter.com/hashtag/javascript?&src=hash" target="_blank">#javascript</a> */
User mentions
var TwitterBeautifier = ;var tweet = text: 'hello @herzuull' entities: user_mentions: screen_name: 'herzuull' ;;/** hello <a href="https://www.twitter.com/herzuull" target="_blank">@herzuull</a> */
URLS transformation
var TwitterBeautifier = ;var tweet = text: 'hello world to https://t.co/2Prjsq8uck' entities: urls: url: 'https://t.co/2Prjsq8uck' expanded_url: 'http://bit.ly/1RYcbV7' display_url: 'bit.ly/1RYcbV7' ;;/** hello world to <a href="http://bit.ly/1RYcbV7" target="_blank">bit.ly/1RYcbV7</a>*/
URLS with images
var TwitterBeautifier = ;var tweet = text: 'Here is an image https://t.co/qYKfvzeEb6' entities: media: url: 'https://t.co/qYKfvzeEb6' expanded_url: 'http://twitter.com/RNC_France/status/754966450087927808/photo/1' display_url: 'pic.twitter.com/qYKfvzeEb6' media_url_https: 'https://pbs.twimg.com/media/Cnot-5fVUAAnaHv.jpg' ;;/** Here is an image <img src="https://pbs.twimg.com/media/Cnot-5fVUAAnaHv.jpg" /> */
Contributors
Maintained by @herzuull