文章列表
var makeRequest = function(username, password, savestate) {
var request = {
"entry": me.getEntry(),
"gateway": 1,
"from": me.from,
"savestate": savestate,
"useticket": me.useTicket?1:0
};
if (me.failRedirect) {
me.log ...
新浪微博password授权模式需要申请,否则调用access_token返回HTTP status 400,code方式授权需要用户自己在浏览器输入用户名、密码,烦。http client模拟吧,发现多了一个ticket,sina用加密算法算的。如何直接授权?google了一下,看到网上有几种方案:
1、自己java按照ticket算法生成ticket然后http client模拟提交的;
2、通过js实现授权的;
我发明种新的,用Selenium!
WebDriver driver = new ChromeDriver();
driver.get(url + "?&q ...
通过libAspriseOCR实现图片校验码的分析。
public String recognizeEverythingByUrl(String urlString) {
String str = null;
try {
// URL url = new URL(urlString);
BufferedImage bi = ImageIO.read(new FileInputStream(urlString));
if (bi != null) {
OCR.setLibraryPath("/Users/WH/Documents/wor ...
其它都不重要,重要的response要设置字符集。
//...
response.setContentType("text/html; charset=UTF-8");
Template t = engine.getTemplate("molamola.html", "UTF-8");
VelocityContext context = new VelocityContext();
context.put("selectedTable", selectedTable);
context.put(&quo ...