JSFiddle - React, Tailwind, and code Playground
HTML
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<title>testagr.am</title>
<script>
$(document).ready(function(){
jQuery.fn.spectragram.accessData = {
accessToken: '197116726.dd97aa2.900236bda3d742189a302a5fd8a44686',
clientID: 'dd97aa2734a543aeaa1022900970b486'
};
$('.getPopular').spectragram('getPopular', {
size: 'small',
max: 4});
$('.introPics').spectragram('getRecentTagged', {
query: 'converse',
max: 4,
wrapEachWith: '<span></span>'});
});
</script>
</head>
<body>
<div class="container">
<section class="imglist">
<h2 class="title">test</h2>
<div>
<h3>test</h3>
<ul class="getUserFeed">
</ul>
<ul class="introPics">
</ul>
</div>
</section>
</div>
</body>
</html>
JavaScript
/*!
* sextagram.js via "spectagram.js by adrianquevedo"
* an awesome instagram sex app!
*/
if (typeof Object.create !== 'function') {
Object.create = function (obj) {
function F() {};
F.prototype = obj;
return new F()
}
}(function ($, window, document, undefined) {
var Instagram = {
init: function (options, elem) {
var self = this;
self.elem = elem;
self.$elem = $(elem);
self.api = 'https://api.instagram.com/v1', self.accessData = $.fn.spectragram.accessData, self.options = $.extend({}, $.fn.spectragram.options, options)
},
getRecentMedia: function (userID) {
var self = this,
getData = '/users/' + userID + '/media/recent/?' + self.accessData.clientID + '&access_token=' + self.accessData.accessToken + '';
self.fetch(getData).done(function (results) {
self.display(results)
})
},
getUserFeed: function () {
var self = this,
getData = '/users/search?q=' + self.options.query + '&count=' + self.options.max + '&client_id=' + self.accessData.clientID + '';
self.fetch(getData).done(function (results) {
if (results.data.length) {
self.getRecentMedia(results.data[0].id)
} else {
$.error('Spectagram.js - Error: the username ' + self.options.query + ' does not exist.')
}
})
},
getPopular: function () {
var self = this,
getData = '/media/popular?client_id=' + self.accessData.clientID + '&access_token=' + self.accessData.accessToken + '';
self.fetch(getData).done(function (results) {
self.display(results)
})
},
getRecentTagged: function () {
var self = this,
getData = '/tags/' + self.options.query +...