JSFiddle - React, Tailwind, and code Playground
HTML
<p><i data-tnick="lirik" class="user-color fa fa-user viewers"></i> <span>Offline</span>
</p>
JavaScript
jQuery(document).ready(function ($) {
$('.viewers').each(function () {
var monstercat = $(this).data('monstercat');
var span = $(this).next();
$.getJSON('https://api.twitch.tv/kraken/streams/' + monstercat, function (data) {
var views = data.viewers;
span.html(views);
});
});
});