Share

Buka Dashboard Blogger > Klik Halaman > Klik Halaman Baru > Klik HTML >

Public

27 June 2019

Views: 253

<script type="text/javascript">
//<![CDATA[
var setting = {
exceptionurl : "twitter.com",
path : "#?o="
};
//]]>
</script>
<script src="https://www.blogger.com/feeds/####/posts/default?alt=json-in-script&amp;max-results=150&amp;callback=showurl"></script>
<script>
//<![CDATA[
$(document).ready(function(){

$("#btngenerate").on("click",function(){
var generateurl = $("#generateurl").val(),
generatelink = $("#generatelink"),
generateloading = $("#generateloading"),
resulturl = $('#resulturl');

if (generateurl == "") {
$("#generateurl").focus();
return false;
}

$("#copytoclipboard").html("<span class='fa fa-floppy-o'></span> Copy URL");
generateloading.removeClass('hidden');
generatelink.addClass('hidden');
$.ajax({
url : '/feeds/posts/summary?alt=json-in-script',
type: 'get',
dataType: 'jsonp',
success: function(data) {
var link = '',
content = data.feed.entry,
links =new Array();
if (content !== undefined) {
for (var i = 0; i < content.length; i++) {
for (var j = 0; j < content[i].link.length; j++) {
if (content[i].link[j].rel == "alternate") {
link = content[i].link[j].href;
break;
}
}
links[i] = link;
var randindex = Math.random() * links.length;
randindex = parseInt(randindex);
}
resultgenerate = links[randindex] + "#?o=" + aesCrypto.encrypt(convertstr(generateurl),convertstr('root'));
generateloading.addClass('hidden');
generatelink.removeClass('hidden');
resulturl.val(resultgenerate);
}else {
resulturl.val('No result!');
}
},
error: function() {
resulturl.val('Error loading feed!');
}
});
});

var clipboard = new ClipboardJS('.copytoclipboard');
clipboard.on('success', function(e) {
$("#copytoclipboard").html("<span class='fa fa-check'></span> Link Copied to Clipboard");
});

})
//]]>
</script>







<h2>
<i class="fa fa-shield">
</i>
<strong>Generate Link</strong>
</h2>





<span class="input-group-addon">
<i class="fa fa-link">
</i>
</span>
<input class="form-control" id="generateurl" placeholder="http://example.com" type="url" />
<span class="input-group-btn">
<button class="btn btn-primary primary-color primary-color-border" id="btngenerate" type="button">
<i class="fa fa-shield">
</i>
<strong>Submit</strong>
</button>
</span>


Advertisement

Disable Third Party Ads