唉 终于还是决定开源这个项目,造福广大wordpress用户。 
项目地址:http://code.google.com/p/jwp/
我的博客地址:http://www.ij2ee.com/ 
Java版wordpress采集器 如果你想流畅的使用这个项目去采集文章,你必须具备网页代码的分析能力。 你还必须会使用以下用具
firebug 或 ie developer tools
 正则表达式
使用方法。
1 编写一个类,它要继承 CommonParser类 并实现两个方法
    getTargetConF 文章所在的元素(比如div,p元素等等)。 这里使用htmlparser的HasAttributeFilter("id","context");方法实现的。主要是要寻找特定的属性,比如class,id,name等等。要求这些元素要唯一。
    getTargetDivF 文章目录所在的元素。 这里使用htmlparser的HasAttributeFilter("id","context");方法实现的。主要是要寻找特定的属性,比如class,id,name等等。要求这些元素要唯一。
 
2 开始在WPMover2\src\com\wpmover2\spring\core.xml 配置相关的类属性。<?xml version="1.0" encoding="UTF-8"?>
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
<bean id="commonP" class="com.wpmover2.parser.CommonParser" abstract="true"></bean>
<bean id="ij2ee" class="com.wpmover2.all.ij2ee.IJ2eeParser" parent="commonP">
<!-- 要采集的域名 -->
<property name="targetDomain" value="http://www.alixixi.com"/>
<!-- 要采集的目录页面url -->
<property name="targetUrl" value="http://www.alixixi.com/program/c/php_{0}.shtml"></property>
<!-- 最大采集的页面数量 这个数字将替代上面的目录页面里的{0}进行采集 -->
<property name="MAX_PAGE" value="140"></property>
<!-- 采集起始页码 同上 会替代{0}进行目录采集 -->
<property name="start_page" value="135"></property>
<!-- 目标采集页的编码格式 -->
<property name="ENCODING" value="gb2312"></property>
<!-- 因为考虑到目录页面里 还有很多其他的网页链接 所以这里请用正则匹配下真正的文章页的url -->
<property name="artUrlMatch" value="http://www.alixixi.com/program/a/\d+.shtml"/>
<!-- 我的域名 -->
<property name="mydomain" value="http://www.ij2ee.com/"></property>
<!-- 因为很多网站在文章后面会追加自己的网站名字 在这里会对采集的文章的title进行文字去除 -->
<property name="targetPlaceTxt" value="_PHP教程_编程技术"></property>
<!-- 采集的内容是采集他的html 还是只是普通的文字,普通的文字将不带有任何图片及样式等等 -->
<!-- 1是按html采集 0是采集文本 -->
<property name="useHtml" value="0"></property>
<!-- 是否是测试,测试会显示抓取的文章url 标题及文章内容,并且不会采集到博客里 -->
<!-- 1是测试  0是正式采集 -->
<property name="isTest" value="0"></property>
<!-- 我的博客的登录名 -->
<property name="user" value=""/>
<!-- 我的博客的密码 -->
<property name="pwd" value=""/>
<!--我的博客的文章标签,这里是要求文章标签和目录的一致,还有就是在采集前请确认标签和目录存不存在 -->
<property name="keyword" value="java"/>
</bean>
</beans>