java RSS ʵÏÖ£¨ÁÐ×Ó£©
Ò»£º RSS½éÉÜ
¸ù¾Ýά»ù°Ù¿Æ(http://zh.wikipedia.org/wiki/RSS)µÄ¶¨Ò壬“RSSÊÇÒ»ÖÖÓÃÓÚ¹²ÏíÐÂÎźÍÆäËûWebÄÚÈݵÄÊý¾Ý½»»»¹æ·¶ ”£¬ËüÊÇһϵÁеĹ淶µÄ×éºÏ£¬²ÉÓÃXML¸ñʽ¡£Ä¿Ç°¹úÄÚRSSÓ¦ÓÃ×î¶àµÄÊÇÔÚÐÂÎÅÍøÕ¾ºÍ²©¿ÍÍøÕ¾ÉÏ¡£
Ðí¶àÍøÕ¾¿ÉÒÔÓÃRSSÔĶÁÆ÷À´¸öÐÔ»¯×Ô¼ºµÄÍøÒ³£¬±ÈÈçÏÔʾ×îеÄÐÂÀËÐÂÎÅ£¬ÏÔʾ×Ô¼ººÃÅóÓÑ×îеIJ©¿ÍÎÄÕ£¬ÏÔʾ×îеÄGoogleÂÛ̳ÄÚÈÝ¡£³ý´ËÖ®Í⣬ÀûÓÃRSSÔĶÁÆ÷»¹¿ÉÒÔʵÏÖÆäËüÓÃ;£¬±ÈÈ磺
»ñµÃÌìÆøÔ¤±¨
½ÓÊÕÓʼþ£¬±ÈÈçGmail¾ÍÌṩRSS feed
»ñÈ¡×îйÉƱÐÐÇé
»ñÈ¡ÒôÀÖ£¬µç̨½ÚÄ¿ºÍÊÓƵ¼ô¼µÈµÈ
¶þ£ºRome½éÉÜ
ÕâƪÎÄÕ²ÉÓÃRomeÕâ¸ö¿ªÔ´¹¤¾ßÀ´ÊµÏÖRSSÔĶÁÆ÷¡£RomeÖ§³ÖµÄ¸ñʽºÜ¶à£¬ÓÐRSS 0.90, RSS 0.91 Netscape, RSS 0.91 Userland, RSS 0.92, RSS 0.93, RSS 0.94, RSS 1.0, RSS 2.0, Atom 0.3, Atom 1.0 µÈµÈ£¬¼¸ºõÄÒÀ¨ÁËÄ¿Ç°ËùÓеÄRSS ºÍatom°æ±¾¡£×îеÄRome°æ±¾¿ÉÒÔ´Óhttp://wiki.java.net/bin/view/Javawsxml/RomeÉϵõ½¡£
ʵÏÖRSSÔĶÁÆ÷£¬Ö÷Òª²ÉÓÃRomeµÄ½âÎö¹¦ÄÜ£¬¾ÍÊÇ´ÓXMLÎļþÖжÁ³öÏàÓ¦µÄÄÚÈÝ¡£ÎÒÓÃһЩ¼òµ¥´úÂëÀ´ËµÃ÷ÈçºÎʹÓÃRomeÖеÄÀàºÍ·½·¨¡£
URL feedUrl = new URL("http://rss.sina.com.cn/news/marquee/ddt.xml");
SyndFeedInput input = new SyndFeedInput();
SyndFeed feed = input.build(new XmlReader(feedUrl));
±íÒ»: µÃµ½RSS Feed
“http://rss.sina.com.cn/news/marquee/ddt.xml“ÊÇÐÂÀËÐÂÎŵÄÒ»¸öRSS µØÖ·¡£Í¨¹ýÈýÐдúÂ룬¾Í¿ÉÒԵõ½Ò»¸ö¶ÔÓ¦Õâ¸öµØÖ·µÄRSS Feed¶ÔÏó¡£Õâ¸ö¶ÔÏó°üº¬ÎÒÃÇËùÐèÒªµÄËùÓÐRSSÄÚÈÝ¡£Èç¹ûÓÃSystem.out.println(feed)£¬»áµÃµ½±í¶þÖеĽá¹û¡£´ÓÖпÉÒÔÇå³þµØ¿´µ½ SyndFeedÀàµÄ½á¹¹¡£
SyndFeedImpl.contributors=null
SyndFeedImpl.title=ÐÂÎÅÖÐÐÄ-ÐÂÎÅÒªÎÅ
SyndFeedImpl.categories[0].name=
SyndFeedImpl.categories[0].taxonomyUri=null
SyndFeedImpl.link=http://news.sina.com.cn/iframe/o/allnews/input/index.htm
SyndFeedImpl.publishedDate=Thu Jun 22 13:20:01 CST 2006
SyndFeedImpl.entries[0].updatedDate=null
SyndFeedImpl.entries[0].contributors=null
SyndFeedImpl.entries[0].title=ÔúÍߺÕÀïÔÚ¼Ïñ´øÖкôÓõ°¢¸»º¹È˵ֿ¹Íâ¹úÇÖÂÔ
SyndFeedImpl.entries[0].categories[0].name=
SyndFeedImpl.entries[0].categories[0].taxonomyUri=null
SyndFeedImpl.entries[0].link=http://news.sina.com.cn/w/2006-06-22/11
Ïà¹ØÎĵµ£º
1.¼ÆËãijһÔ·ݵÄ×î´óÌìÊý
1Calendar time=Calendar.getInstance();
2time.clear();
3time.set(Calendar.YEAR,year); //year Ϊ int
4time.set(Calendar.MONTH,i-1);//×¢Òâ,Calendar¶ÔÏóĬÈÏÒ»ÔÂΪ0
5int day=time.getActualMaximum(Calendar.DAY_OF_MONTH);//±¾Ô·ݵÄÌìÊý
×¢£ºÔÚʹÓÃset·½·¨Ö®Ç°£¬±ØÐë ......
¶¨ÒåÔÚÒ»¸öÀàÄÚ²¿µÄÀà½ÐÄÚ²¿À࣬°üº¬ÄÚ²¿ÀàµÄÀà³ÆΪÍⲿÀà¡£ÄÚ²¿Àà¿ÉÒÔÉùÃ÷public¡¢protected¡¢privateµÈ·ÃÎÊÏÞÖÆ£¬¿ÉÒÔÉùÃ÷ΪabstractµÄ¹©ÆäËûÄÚ²¿Àà»òÍⲿÀà¼Ì³ÐÓëÀ©Õ¹£¬»òÕßÉùÃ÷Ϊstatic¡¢finalµÄ£¬Ò²¿ÉÒÔʵÏÖÌض¨µÄ½Ó¿Ú¡£staticµÄÄÚ²¿ÀàÐÐΪÉÏÏóÒ»¸ö¶ÀÁ¢µÄÀ࣬·ÇstaticÔÚÐÐΪÉÏÀàËÆÀàµÄÊôÐÔ»ò·½·¨ÇÒ½ûÖ¹ÉùÃ÷staticµÄ·½· ......
private PreparedStatement pstmt;
String sql="INSERT INTO TABLE(id,Ãû³Æ,Óû§id,Stbid,MAC,Óû§×´Ì¬,×Ü´ÎÊý,IpµØÖ·,×ÊÁϸüÐÂʱ¼ä) " +
"VALUES(?,?,?,?,?,?,?,?,?)";
pstmt=connection.prepareStatement(sql);
pstmt.setString(1,array[0]);
......
JAVA¿ª·¢Õß×ȥµÄ20¸öÓ¢ÎÄÍøÕ¾
1.[http://www.javaalmanac.com] – Java¿ª·¢ÕßÄê¼øÒ»ÊéµÄÔÚÏß°æ±¾. ÒªÏë¿ìËٲ鵽ijÖÖJava¼¼ÇɵÄÓ÷¨¼°Ê¾Àý´úÂë, ÕâÊÇÒ»¸ö²»´íµÄÈ¥´¦.
2.[http://www.onjava.com] – O’ReillyµÄJavaÍøÕ¾. ÿÖܶ¼ÓÐÐÂÎÄÕÂ.
3.[http://java.sun.com] – ¹Ù·½µÄJava¿ª·¢ÕßÍøÕ¾ ......