JSFiddle - React, Tailwind, and code Playground

by philderksen

HTML

<script src="https://raw.github.com/padolsey/jQuery-Plugins/master/cross-domain-ajax/jquery.xdomainajax.js"></script>
<span id="num_downloads"></span> downloads

JavaScript

//Uses cross-domain ajax jQuery plugin at:
//https://github.com/padolsey/jQuery-Plugins/tree/master/cross-domain-ajax

$pluginUrl = "http://wordpress.org/extend/plugins/pinterest-pin-it-button/";

$.get($pluginUrl, function(data) {
    // load the response into jquery element
    // form tags are needed to get the entire html,head and body
    $html = $('<form>' + data.responseText + '</form>');
    
    //Get count by splitting text elements by space and "popping" last one out
    $pluginData = $.trim($html.find("div.col-3 p:first").text().trim().split(" ").pop());
    $("#num_downloads").text($pluginData);
});