modify openhub model

This commit is contained in:
StarLee 2016-04-01 10:33:47 +08:00
parent 4ad9dee4c9
commit 0153eaeeda
3 changed files with 20 additions and 15 deletions

View File

@ -25,7 +25,7 @@ public interface OpenHubProject_Dao {
@Insert("insert into openhub_project"
@Insert("insert into openhub_project_test"
+"(`url_md5`,`source`,`name`,`url`,`user_num`,`description`,`tags`,`organization`,"
+ "`license`,`similar_project`,`manager`,"
+ "`language`,`active_degree`,"

View File

@ -37,8 +37,8 @@ public class openhub_Model implements AfterExtractor, ValidateExtractor {
/////////////////////////////
@ExtractBy("//*[@id='page_contents']/div[3]/div[2]/div/dl/dd[1]/a[1]/@href")
//@ExtractBy("//*[@id='page_contents']/div[3]/div[2]/div/dl/dd[1]/a[1]/@href")
@ExtractBy("//*[@id='projects_show_page']/div[2]/div[3]/div[2]/div/dl/dd[1]/a[1]/@href")
private String homepage ;
///////////////////////////////////
@ -53,7 +53,8 @@ private String homepage ;
private int useCount = 0;
@ExtractBy("//div[@class='span6']/div[@id='project_summary']/p/text()")
// @ExtractBy("//div[@class='span6']/div[@id='project_summary']/p/text()")
@ExtractBy("//div[@id='project_summary']/p/text()")
private String description = "";
private String tags = "";
@ -116,7 +117,8 @@ private String homepage ;
@ExtractBy("//div[@class='proj_community_ratings']/div/span[@style='margin-left: 8px']/allText()")
private String rateInfo = "";
@ExtractBy("//div[@class='proj_community_ratings']/div/div[@class='clear']/span[@class='float_left']/allText()")
// @ExtractBy("//div[@class='proj_community_ratings']/div/div[@class='clear']/span[@class='float_left']/allText()")
@ExtractBy("//*[@id='proj_rating']/div[2]/div[1]/span[2]/allText()")
private String rateLevel = "";
@ExtractBy("//table[@id='recent_committers_table']/tbody/tr/td[@class='recent_committers']/a/allText()")
private List<String> RecenctContributors = new ArrayList<String>();
@ -388,20 +390,23 @@ private String homepage ;
//begin -- 为了区分老版本和新版本的区别
// System.out.println("mange:" +this.managers+";");
// System.out.println("tags:"+this.tags+";");
if(this.managers.isEmpty() && this.tags==null){
page.setResultSkip(this, true);
return;
}
//end -- 为了区分老版本和新版本的区别
// if(this.managers.isEmpty() && this.tags==null){
// page.setResultSkip(this, true);
// System.out.println();
// return;
// }
// //end -- 为了区分老版本和新版本的区别
//System.out.println(this.rateLevel);
if(this.rateLevel == null || this.rateLevel.trim().isEmpty()){
this.rateLevel ="0.0/0.0";
}
this.rateLevel = this.rateLevel.substring(0, this.rateLevel.indexOf("/"));
if (StringHandler.isAtLeastOneBlank(this.name, this.activity/*
* ,this.
* description
* ,
if (StringHandler.isAtLeastOneBlank(this.name, this.activity
,this.
description
,this.homepage
/* ,
* this.licenses
*/)) {
page.setResultSkip(this, true);

View File

@ -1 +1 @@
sourceforge
openhub