add column type

This commit is contained in:
Lukas Mehl 2019-06-17 18:02:17 +02:00
parent 40397d2172
commit baf200098d
2 changed files with 11 additions and 9 deletions

View file

@ -30,6 +30,7 @@
<thead>
<tr>
<th>Typ</th>
<th>Level</th>
<th>Land</th>
<th>Kreis</th>
<th>Stadt</th>
@ -54,17 +55,17 @@
$.each(this, function(idx , v) {
var cell = tbl_row.insertCell();
txt = v.toString();
if(idx == 4 && txt != "--"){
if(idx == 5 && txt != "--"){
var a = document.createElement('a');
a.appendChild(document.createTextNode(txt));
a.href = "https://www.facebook.com/" + txt;
cell.appendChild(a);
} else if (idx == 6 && txt != "--") {
} else if (idx == 7 && txt != "--") {
var a = document.createElement('a');
a.appendChild(document.createTextNode(txt));
a.href = "https://www.twitter.com/" + txt;
cell.appendChild(a);
} else if (idx == 8 && txt != "--") {
} else if (idx == 9 && txt != "--") {
var a = document.createElement('a');
a.appendChild(document.createTextNode(txt));
a.href = "https://www.instagram.com/" + txt;
@ -77,7 +78,7 @@
$("#datatable").append(tbl_body);
$('#datatable').DataTable( {
paging: false,
"order" : [[ 5, "desc"]]
"order" : [[ 6, "desc"]]
} );
});
</script>

View file

@ -126,7 +126,7 @@ def main():
print("FACEBOOK ERROR for", url["url"], "--", fbname, file=sys.stderr)
print(e, file=sys.stderr)
continue
print("FB", fbname, fbLikes)
print(" FB", fbname, fbLikes)
fbcount += 1
elif url["type"] == "TWITTER":
@ -139,7 +139,7 @@ def main():
print(e, file=sys.stderr)
continue
twtcount += 1
print("TWITTER", twtname, twtFollower)
print(" TWITTER", twtname, twtFollower)
elif url["type"] == "INSTAGRAM":
instaName = getInstagramName(url["url"])
@ -153,16 +153,17 @@ def main():
print(e, file=sys.stderr)
continue
instacount += 1
print("INSTA", instaName, instaFollower)
print(" INSTA", instaName, instaFollower)
typ = entry.get("level").split(":")[1]
typ = entry.get("type")
level = entry.get("level", "")
land = entry.get("state", "")
kreis = entry.get("district", "")
stadt = entry.get("city", "")
if fbname is None:
fbname = "--"
if fbLikes + twtFollower + instaFollower > 0:
result.update({str(idx): [typ, land, kreis, stadt, fbname, fbLikes, twtname, twtFollower, instaName, instaFollower]})
result.update({str(idx): [typ, level, land, kreis, stadt, fbname, fbLikes, twtname, twtFollower, instaName, instaFollower]})
idx += 1
with open("docs/result.json", "w") as f: