获取请求页面里的&g_tk参数(非常有用)

阅读更多
/**
* 获取请求页面里的&g_tk参数

*
* @param cookies
* @return
*/
public Integer getGTK(List cookies) {
int gtk = 0;
if (!cookies.isEmpty()) {
for (int i = 0; i < cookies.size(); i++) {
if (cookies.get(i).getName().equalsIgnoreCase("skey")) {
String str = cookies.get(i).getValue();
char[] c = str.toCharArray();
int haha= 32;
for (int a = 0; a < c.length; a++) {
haha+= (haha<< 5) + c[a];
}
gtk = haha& 0x7fffffff;
System.out.println("#haha:" + haha);
}
}
}
System.out.println("##&g_tk=" + gtk);
return gtk;
}

你可能感兴趣的:(g_tk,gtk,QQ,Qzone,cookie)