1window.addEventListener("load", function () { 2 // Previously: "https://" + mastodon_server + "/api/v1/timelines/public?local=true&limit=1" 3 var mastodon_server = "mastodon.dbatley.com"; 4 var mastodon_account_id = "2"; 5 6 // var mastodon_server = "mastodon.me.uk"; 7 // var mastodon_account_id = "111114997464476934"; 8 9 fetch("https://" + mastodon_server + "/api/v1/accounts/" + mastodon_account_id + "/statuses?exclude_reblogs=true&limit=1") 10 .then(function(response) { 11 return response.json(); 12 }) 13 .then(function(myJson) { 14 var most_recent_toot = myJson[0]; 15 16 var status_elem = document.createElement("span"); 17 status_elem.setAttribute("class", "status"); 18 status_elem.innerHTML = most_recent_toot.content; 19 20 var person_elem = document.createElement("a"); 21 person_elem.setAttribute("class", "person"); 22 person_elem.setAttribute("href", most_recent_toot.account.url); 23 person_elem.innerText = most_recent_toot.account.username + " at " + mastodon_server; 24 25 var placeholder = document.getElementById("mastodon") 26 placeholder.appendChild(status_elem); 27 placeholder.appendChild(person_elem); 28 placeholder.style.visibility = "visible"; 29 }); 30});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.