diff --git a/new_osseanextractor/src/main/java/net/trustie/dao/OpenHubProject_Dao.java b/new_osseanextractor/src/main/java/net/trustie/dao/OpenHubProject_Dao.java index 207a02fd0..038e7751f 100644 --- a/new_osseanextractor/src/main/java/net/trustie/dao/OpenHubProject_Dao.java +++ b/new_osseanextractor/src/main/java/net/trustie/dao/OpenHubProject_Dao.java @@ -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`," diff --git a/new_osseanextractor/src/main/java/net/trustie/model/openhub_Model.java b/new_osseanextractor/src/main/java/net/trustie/model/openhub_Model.java index 8896ea60f..c1eecf51a 100644 --- a/new_osseanextractor/src/main/java/net/trustie/model/openhub_Model.java +++ b/new_osseanextractor/src/main/java/net/trustie/model/openhub_Model.java @@ -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 RecenctContributors = new ArrayList(); @@ -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); diff --git a/new_osseanextractor/tasks.txt b/new_osseanextractor/tasks.txt index 613fd57a0..62111bc5f 100644 --- a/new_osseanextractor/tasks.txt +++ b/new_osseanextractor/tasks.txt @@ -1 +1 @@ -sourceforge \ No newline at end of file +openhub \ No newline at end of file