Viber统计信息收集

人们对如何获取氛围中的聊天统计数据很感兴趣。根据viber.com网站上的信息,仅提供至少有1000名成员的社区的统计信息。

接下来,我将描述有关如何使用备份文件获取有关viber聊天统计信息的说明。



1.该帐户的备份副本具有viber.db数据库格式,对于PC版本,该路径位于以下路径:C:\ Users \ <用户名> \ AppData \ Roaming \ ViberPC \ <电话号码>。



2.我使用SQL Lite浏览器读取数据库文件。



3.在SQL Lite浏览器中打开viber.db文件。数据库如下所示:







4.主表为“事件”,氛围中的所有事件(按帐户)均已编号(EventID)。其他表具有称为EventID的外键关系。有关消息的信息存储在“消息”表中,有关用户的信息存储在“联系人”表中。我只用了这三个表。



5.为了获得有关聊天的统计信息,首先,您需要找到所需聊天ChatID的标识符。为此,请为ChatInfo表选择上下文菜单中的“数据视图”项,然后转到“数据”选项卡进行查看。







6.通过聊天名称(属性名称),我们查找所需的聊天内容,并查看其ID(属性ChatID)。



7.同样,您可以通过Name属性(因为用户记录在电话中)或ClientName(用户名由他的帐户)在Contact表中获取用户标识符(ContactID)。我使用ClientName属性是因为我的手机笔记本中没有所有用户。



8.接下来,我们通过在SQL选项卡上形成Select查询来获取所需的数据。做什么属性取决于需求,为此有必要提出适当的要求。对于我自己,我提出了表1中所示的请求。



表1.已使用请求的列表

P / p号 要求文字 描述
1个 从消息,事件中选择计数(Messages.EventID),其中Messages.EventID = Events.EventID和Events.ChatID = 46 聊天消息数
2 从消息,事件,联系人中选择计数(Messages.EventID),Contact.ClientName,其中Messages.EventID = Events.EventID和Events.ChatID = 46和Events.ContactID = Contact.ContactID按事件分组。ContactID按Contact.ContactID排序。 用户的帖子数(返回每个用户的事件数)
3 Select Contact.ContactID, Contact.ClientName from Messages, Events, Contact where Messages.EventID=Events.EventID and Events.ChatID=46 and Events.ContactID=Contact.ContactID group by Events.ContactID order by Contact.ContactID
4 Select * from Messages, Events, Contact where Messages.EventID=Events.EventID and Events.ContactID=Contact.ContactID and Events.ChatID=46 and Events.ContactID=465
5 Select count(Messages.EventID), Messages.Type from Messages, Events where Messages.EventID=Events.EventID and Events.ChatID=46 group by Messages.Type order by Messages.Type (. 2)
6 Select Count(Messages.Type), Messages.Type from Messages, Events, Contact where Messages.EventID=Events.EventID and Events.ContactID=Contact.ContactID and Events.ChatID=46 and Events.ContactID=482 group by Messages.Type
7 Select Count(Messages.PGIsLiked), Contact.ClientName from Messages, Events, Contact where Messages.EventID=Events.EventID and Events.ChatID=46 and Messages.Type=0 and Messages.PGIsLiked=1 and Events.ContactID=Contact.ContactID group by Contact.ClientName order by Contact.ContactID
8 Select Sum(Messages.PGLikeCount), Contact.ClientName from Messages, Events, Contact where Messages.EventID=Events.EventID and Events.ChatID=46 and Events.ContactID=Contact.ContactID group by Contact.ClientName order by Contact.ContactID
9 Select Events.TimeStamp from Messages, Events, Contact where Messages.EventID=Events.EventID and Events.ContactID=Contact.ContactID and Events.ChatID=46 and Events.ContactID=460 order by Events.TimeStamp (. . 11)


2.



№ /
1 EventID . , .. ,
2 Type ( , , ):

0 – : ,

1 –

2 —

3 —

4 –

9 –

11 –

12 —

15 – ,

65 –

66 –

67 –

68 –

69 —

72 –

77 —

3 ContactID
4 ClientName
5 ChatID
6 TimeStamp UNIX- POSIX- (. Unix time) — , UNIX POSIX- .

( UTC) 31 1969 1 1970, .



9.执行查询后,我先将结果导出到PDF,然后导出到excel(对我来说更容易):







10.之后,我使用数据在excel中构建了图表,例如,在请求#5(请参阅表1)上:







注1.数据。不同,因为聊天正在进行,数据库正在更新。



注意2。已经在excel中,我将65 ... 77的类型合并为常规(服务)。



11.如何使用时间属性(TimeStamp)。在数据库中,UNIX时间用于将事件绑定到时间,并获取与绑定日期和时间相关的数据,因此有必要进一步处理它们。下面是我做到了在Excel中的例子:







一。将查询9(请参阅表1)的结果保存在excel(列A)中。

b。在B列中,我们舍弃了最后3个字符(我不知道它们的作用)来获取UNIX格式的时间。我们使用公式= LEFT(A2; DLSTR(A2)-3)进行此操作。在整个行范围内拉伸公式。

C。C列中填充了单位(消息计数器)。

d。在D列中,使用公式=(B2 / 86400)+ 25569将日期转换为易于理解的日期。在整个行范围内扩展公式。

e。要计算每月的消息数(单元格E2:R2),请使用公式= SUMIF($ C $ 2:$ C $ 1434; $ D $ 2:$ D $ 1434;“> =”&E $ 1; $ D $ 2:2 D $ 1434;“ <= “&EONMONTHS(E $ 1; 0))。将公式扩展到列E1:R1的整个范围。

F。我们根据单元格E1:R2的范围构建直方图。



结论



这种收集统计信息的方法是在手动模式下执行的,这是资源密集型的(至少在花费的时间方面),但效率至少很高。可以说缺少更好的一种。此方法不仅可以用于获取聊天统计信息,还可以用于整个Viber帐户。我没有附上消息来源,tk。我在包含用户个人数据的真实聊天中执行了所有操作,而且我懒于为测试创建单独的聊天。感谢您的关注。



All Articles