-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy patholdscript.js
46 lines (38 loc) · 1.03 KB
/
oldscript.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
$(document).ready(function() {
var jsonstring = "";
var htmlToWrite ="";
var toWrite = "";
var pulldata = function() {
$.ajax({
type: "GET",
cache: false,
dataType: "JSON",
url: "http://neapolitan.herokuapp.com/",
success: function(data) {
jsonstring = data;
massageData(jsonstring);
},
error: function (errorT) {
alert(errorT);
}
});
};
function massageData(twstring) {
twstring.statuses.forEach(function(statuses) {
if (typeof statuses.entities.media !== 'undefined') {
toWrite += "<div class='col-md-4 col-sm-6 col-xs-12'>" +
"<div class='thumbnail'>" +
"<div id='outer'><img class = 'img-responsive' src='" +
statuses.entities.media[0].media_url + "'></div>" +
"<div class='caption'>" +
"<h4>" + statuses.user.name + "</h4>" +
"<p>" + statuses.created_at + "</p>" +
"</div></div></div>";
}
});
$("#content").append(
toWrite
);
}
pulldata();
});