var article = document.getElementsByTagName("article")[0].innerHTML; var article_name= article.substring(article.indexOf('
')+3,article.indexOf('
')+33); var search = friendica_domain + "/search?search=" + article_name.replace(/ /gi,'+'); var http, http2 = null; var ergebnis = ""; http = new XMLHttpRequest(); if (http !== null) { http.open("GET", search, true); http.onreadystatechange = SearchFriendica; http.send(null); } function SearchFriendica() { if (http.readyState == 4 && http.status==200) { var SearchResult= http.responseText; var start = SearchResult.indexOf('wall-item-bottom'); var start2 = SearchResult.indexOf('a href=\'http',start); var end = SearchResult.indexOf('id',start); ergebnis = SearchResult.substring(start2+8,end-2); } http2 = new XMLHttpRequest(); if (http2 !== null) { http2.open("GET", ergebnis, true); http2.onreadystatechange = SearchComments; http2.send(null); } function SearchComments() { if (http.readyState == 4 && http.status == 200) { var CommentsResult = http2.responseText; var ergebnisse = ("