我有很多网站,想构建一个仪表板,在单个页面上显示每个网站上的实时访问者数量。(其他人想要这个吗?)现在查看此信息的唯一方法是为每个站点打开一个新选项卡。
谷歌没有实时 API,所以我想知道是否可以抓取这些数据。Eduardo Cereto 发现 Google 通过实时/绑定网络请求传输实时数据。任何更精明的人都知道我应该如何开始?这就是我的想法:
弄清楚如何以编程方式进行身份验证
检查所有实时/绑定请求,看看它们是如何变化的。每个请求都有唯一的密钥吗?那是从哪里来的?以下是我对请求的细分:
https://www.google.com/analytics/realtime/bind?VER=8
&
key
= [这是什么?它从何而来?21 个字符的小写字母数字,每个请求保持相同]&
ds
= [这是什么?它从何而来?21 个字符的小写字母数字,每个请求保持相同]&
pageId
=rt-standard%2Frt-概述&
q
=t%3A0%7C%3A1%3A0%3A%2Ct%3A11%7C%3A1%3A5%3A%2Cot%3A0%3A0%3A4%2Cot%3A0%3A0%3A3%2Ct%3A7%7C%3A1% 3A10%3A6%3D%3DREFERRAL%3B%2Ct%3A10%7C%3A1%3A10%3A%2Ct%3A18%7C%3A1%3A10%3A%2Ct%3A4%7C5%7C2%7C%3A1%3A10%3A2! %3Dzz%3B%2C&f变量 URI 解码为这个
q
(什么?):t:0|:1:0:,t:11|:1:5:,ot:0:0:4,ot:0:0:3,t: 7|:1:10:6==REFERRAL;,t:10|:1:10:,t:18|:1:10:,t:4|5|2|:1:10:2!=zz ;,&F&
RID
=rpc&
SID
= [这是什么?它从何而来?16 个字符的大写字母数字,每次请求保持不变]&
CI
=0&
AID
= [这是什么?它从何而来?整数,从 1 开始,奇怪地递增到 150,然后是 298]&
TYPE
=xmlhttp&
zx
= [这是什么?它从何而来?12 个字符的小写字母数字,每个请求都会更改]&
t
=1检查所有实时/绑定响应以了解它们如何变化。数据是怎么进来的?它看起来像一些改变的 JSON。我需要连接多少次才能获取数据?网站上的活跃访问者在哪里?以下是示例数据的转储:
19
[[151,["noop"]
]
]
388
[[152,["rt",[{"ot:0:0:4":{"timeUnit":"MINUTES","overTimeData":[{"values":[49,53,52,40,42,55,49,41,51,52,47,42,62,82,76,71,81,66,81,86,71,66,65,65,55,51,53,73,71,81],"name":"Total"}]},"ot:0:0:3":{"timeUnit":"SECONDS","overTimeData":[{"values":[0,1,1,1,1,0,1,0,1,1,1,0,2,0,2,2,1,0,0,0,0,0,2,1,1,2,1,2,0,5,1,0,2,1,1,1,2,0,2,1,0,5,1,1,2,0,0,0,0,0,0,0,0,0,1,1,0,3,2,0],"name":"Total"}]}}]]]
]
388
[[153,["rt",[{"ot:0:0:4":{"timeUnit":"MINUTES","overTimeData":[{"values":[52,53,52,40,42,55,49,41,51,52,47,42,62,82,76,71,81,66,81,86,71,66,65,65,55,51,53,73,71,81],"name":"Total"}]},"ot:0:0:3":{"timeUnit":"SECONDS","overTimeData":[{"values":[2,1,1,1,1,1,0,1,0,1,1,1,0,2,0,2,2,1,0,0,0,0,0,2,1,1,2,1,2,0,5,1,0,2,1,1,1,2,0,2,1,0,5,1,1,2,0,0,0,0,0,0,0,0,0,1,1,0,3,2],"name":"Total"}]}}]]]
]
388
[[154,["rt",[{"ot:0:0:4":{"timeUnit":"MINUTES","overTimeData":[{"values":[53,53,52,40,42,55,49,41,51,52,47,42,62,82,76,71,81,66,81,86,71,66,65,65,55,51,53,73,71,81],"name":"Total"}]},"ot:0:0:3":{"timeUnit":"SECONDS","overTimeData":[{"values":[0,3,1,1,1,1,1,0,1,0,1,1,1,0,2,0,2,2,1,0,0,0,0,0,2,1,1,2,1,2,0,5,1,0,2,1,1,1,2,0,2,1,0,5,1,1,2,0,0,0,0,0,0,0,0,0,1,1,0,3],"name":"Total"}]}}]]]
]
让我知道您是否可以帮助解决上述任何问题!