seBodyAsString();
// System.out.println(responseString);
return responseString;
}
finally {
if (get != null )
get.releaseConnection();
}
}
public String getRedirectURL(String content)
{
if (content != null && content.indexOf( " window.location=\ "" )!=-1){
int begin = content.indexOf( " window.location=\ "" );
int end = content.indexOf( " \ "" , begin+17);
return content.substring(begin + 17 ,end);
}
return null ;
}
}
庁亭嫋泣議徭強鞠村窟愉指鹸(3)
扮寂:2011-01-06 javaeye eimhee
Java旗鷹
/*
6
7/** *//**
8 * 庁亭霞編利嫋?音俶勣刮屬鷹?
9 * 蝕伉利?www.kaixin.com?
*/
public class KaixinSitePost implements ISitePost
{
private static final String LOGON_SITE = "www.kaixin.com";
private static final int LOGON_PORT = 80;
private static final String CHARSET="UTF-8";
private BrowserContext context=null;
//汽倖喘薩鞠村
public String login(Siteusers userinfo, Proxyips ip)
{
if(userinfo!=null)
{
SiteLogin login=new SiteLogin(context,"http://login.kaixin.com/Login.do");
if(ip!=null)
login.getContext().setProxyip(ip);
Map<String,String> params=new HashMap<String,String>();
params.put("ss", "10106");
params.put("loginregFrom", "index");
params.put("origURL", "http://www.kaixin.com/SysHome.do");
params.put("email", userinfo.getUsername());
params.put("password", userinfo.getUserpwd());
login.addRequestParameters(params);
return login.login(userinfo);
}
return null;
}
public List<Siteboards> parseBoard(Siteboards data) {
return null;
}
public String post(Postinfos postinfo,List<Siteboards> siteboards)
{
if(postinfo!=null && siteboards!=null){
SitePost sport=new SitePost(context);
context.getClient().getHostConfiguration().setHost("blog.kaixin.com");
Map<String,String> params=new HashMap<String,String>();
params.put("categoryId", "0");
params.put("blogControl", "1");
params.put("title", postinfo.getTitle());
params.put("body",postinfo.getContent());
sport.addRequestParameters(params);
for(Siteboards sb:siteboards){
sb.setPostUrl("http://blog.kaixin.com/NewEntry.do&quo
|