document.body.innerHTML += `
<style>
body{background:#eee;}
.сard{background:#FFF;position:relative;width:100%;margin-bottom:7px;box-shadow:0px 1px 1px 0px rgba(0,0,0,.2);padding: 0px 0px 16px 0;box-sizing:border-box;color:#333;max-width:500px;margin:5px auto;}
.сard .tr{position: relative;display: block;padding: 16px 16px 0px 16px;font-size:14px}
.сard .image{float:left;margin-right:16px;display:block;position:relative;width:40px;height:40px;border-radius:50px;}
.сard .autor, .сard .title{margin:2px 0px;min-height: 1em;text-overflow: ellipsis;overflow:hidden;}
.сard .autor{font-weight:bold;margin-bottom:0px;font-size:16px;}
</style>
<script type="text/plain" id="tmpl_сard">
<div class="tr primary_title"
onclick='vk.api.messages.send({peer_id:-%id%,message:"Привет"},function(){
kalert.info("Отправленно")},-1);style.opacity=".5"'>
<a target="_blank" href="
https://vk.com/club%id%"><img class="image" src='%photo_100%'/></a>
<div class="autor">%name%</div>
<div class='title'>%description%</div>
</div>
</script>
`;
function push_group(description,data){
var card = document.createElement("div");
card.className = "сard";
data.description = description;
card.innerHTML = document.getElementById("tmpl_сard").innerHTML;
for(var a in data){
card.innerHTML = card.innerHTML.replace(new RegExp("%"+a+"%","gi"),data[a]);
}
document.body.appendChild(card);
}
vk.api.groups.search({fields:"photo_100,last_seen",q:"Бот",count:1000},function (r) {
r.response.items.map(function(f){
git=-f.id;
vk.api.messages.getHistory({peer_id:-f.id,count:10},function(w){
push_group("Сообщений "+w.response.count,f);
});
});
});