Search for article instead of header

This commit is contained in:
LubuWest 2015-06-05 07:51:04 +02:00
parent 2d821c6014
commit 14df292d0b
2 changed files with 4 additions and 3 deletions

View file

@ -1,5 +1,5 @@
var article = document.getElementsByTagName("article")[0].innerHTML;
var article_name= article.substring(article.indexOf('<h1')+4,article.indexOf('</h1>'));
var article_name= article.substring(article.indexOf('<p>')+3,article.indexOf('<p>')+33);
var search = friendica_domain + "/search?search=" + article_name.replace(/ /gi,'+');
var http, http2 = null;
var ergebnis = "";
@ -14,8 +14,8 @@ if (http !== null) {
function SearchFriendica() {
if (http.readyState == 4 && http.status==200) {
var SearchResult= http.responseText;
var start = SearchResult.indexOf('<div class=\"\">');
var start2 = SearchResult.indexOf('a href',start);
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);
}

View file

@ -3,6 +3,7 @@
padding-top: 15px;
display: table;
margin-left: 60px;
width: calc(100% - 60px);
}
.comment-container {