小编dra*_*pon的帖子

Java google网站管理员热门查询

我一直在抨击这几天,试图弄清楚这是怎么做的.我想从Google网站站长工具中下载CSV,这是我成功完成的.但是,我必须直接传递我希望访问的帐户的用户名和密码.对于网站管理员工具的所有其他方面,我只需要用户登录,然后使用可重复使用的会话令牌从登录中交换令牌.

在获取查询数据时,似乎无法使用此方法.

String next = "http://xyz.domain.com/auth"; //sets page to goto after user log's in so we can pass the token to application
String scope = "http://www.google.com/webmasters/tools/feeds"; // sets the scope of the token
boolean secure = false;
boolean session = true;
String urlFromAuthSub = AuthSubUtil.getRequestUrl(next, scope, secure, session); //generates the URL to forward user to loginto google.
Run Code Online (Sandbox Code Playgroud)

在捕获页面(上面代码中的下一个参数)上,您在成功登录后收到令牌.然后将它换成会话令牌.

String token = "##########################";
String sessionToken = AuthSubUtil.exchangeForSessionToken(token, null);
//store sessionToken for all future use to interact with webmaster for this user. …
Run Code Online (Sandbox Code Playgroud)

java google-webmaster-tools

6
推荐指数
1
解决办法
494
查看次数

标签 统计

google-webmaster-tools ×1

java ×1