<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Shane.Hu's Blog</title>
	
	<link>http://huxuan.org</link>
	<description>Sharing of Computer Geek, Recording of College Time &amp; Thinking of Daily Life</description>
	<lastBuildDate>Tue, 17 Jan 2012 06:27:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/huxuan" /><feedburner:info uri="huxuan" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><creativeCommons:license>http://creativecommons.org/licenses/by-nc-nd/3.0/</creativeCommons:license><image><url>http://feeds.feedburner.com/~fc/victorhu?bg=99CCFF&amp;amp;fg=444444&amp;amp;anim=1</url></image><feedburner:emailServiceId>huxuan</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><feedburner:feedFlare href="http://add.my.yahoo.com/rss?url=http%3A%2F%2Ffeeds.feedburner.com%2Fhuxuan" src="http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif">Subscribe with My Yahoo!</feedburner:feedFlare><feedburner:feedFlare href="http://www.newsgator.com/ngs/subscriber/subext.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2Fhuxuan" src="http://www.newsgator.com/images/ngsub1.gif">Subscribe with NewsGator</feedburner:feedFlare><feedburner:feedFlare href="http://feeds.my.aol.com/add.jsp?url=http%3A%2F%2Ffeeds.feedburner.com%2Fhuxuan" src="http://o.aolcdn.com/favorites.my.aol.com/webmaster/ffclient/webroot/locale/en-US/images/myAOLButtonSmall.gif">Subscribe with My AOL</feedburner:feedFlare><feedburner:feedFlare href="http://www.bloglines.com/sub/http://feeds.feedburner.com/huxuan" src="http://www.bloglines.com/images/sub_modern11.gif">Subscribe with Bloglines</feedburner:feedFlare><feedburner:feedFlare href="http://www.netvibes.com/subscribe.php?url=http%3A%2F%2Ffeeds.feedburner.com%2Fhuxuan" src="http://www.netvibes.com/img/add2netvibes.gif">Subscribe with Netvibes</feedburner:feedFlare><feedburner:feedFlare href="http://fusion.google.com/add?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2Fhuxuan" src="http://buttons.googlesyndication.com/fusion/add.gif">Subscribe with Google</feedburner:feedFlare><feedburner:feedFlare href="http://www.pageflakes.com/subscribe.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2Fhuxuan" src="http://www.pageflakes.com/ImageFile.ashx?instanceId=Static_4&amp;fileName=ATP_blu_91x17.gif">Subscribe with Pageflakes</feedburner:feedFlare><feedburner:feedFlare href="http://www.plusmo.com/add?url=http%3A%2F%2Ffeeds.feedburner.com%2Fhuxuan" src="http://plusmo.com/res/graphics/fbplusmo.gif">Subscribe with Plusmo</feedburner:feedFlare><feedburner:feedFlare href="http://www.thefreedictionary.com/_/hp/AddRSS.aspx?http%3A%2F%2Ffeeds.feedburner.com%2Fhuxuan" src="http://img.tfd.com/hp/addToTheFreeDictionary.gif">Subscribe with The Free Dictionary</feedburner:feedFlare><feedburner:feedFlare href="http://www.bitty.com/manual/?contenttype=rssfeed&amp;contentvalue=http%3A%2F%2Ffeeds.feedburner.com%2Fhuxuan" src="http://www.bitty.com/img/bittychicklet_91x17.gif">Subscribe with Bitty Browser</feedburner:feedFlare><feedburner:feedFlare href="http://www.live.com/?add=http%3A%2F%2Ffeeds.feedburner.com%2Fhuxuan" src="http://tkfiles.storage.msn.com/x1piYkpqHC_35nIp1gLE68-wvzLZO8iXl_JMledmJQXP-XTBOLfmQv4zhj4MhcWEJh_GtoBIiAl1Mjh-ndp9k47If7hTaFno0mxW9_i3p_5qQw">Subscribe with Live.com</feedburner:feedFlare><feedburner:feedFlare href="http://mix.excite.eu/add?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2Fhuxuan" src="http://image.excite.co.uk/mix/addtomix.gif">Subscribe with Excite MIX</feedburner:feedFlare><feedburner:feedFlare href="http://www.webwag.com/wwgthis.php?url=http%3A%2F%2Ffeeds.feedburner.com%2Fhuxuan" src="http://www.webwag.com/images/wwgthis.gif">Subscribe with Webwag</feedburner:feedFlare><feedburner:feedFlare href="http://www.podcastready.com/oneclick_bookmark.php?url=http%3A%2F%2Ffeeds.feedburner.com%2Fhuxuan" src="http://www.podcastready.com/images/podcastready_button.gif">Subscribe with Podcast Ready</feedburner:feedFlare><feedburner:feedFlare href="http://www.wikio.com/subscribe?url=http%3A%2F%2Ffeeds.feedburner.com%2Fhuxuan" src="http://www.wikio.com/shared/img/add2wikio.gif">Subscribe with Wikio</feedburner:feedFlare><feedburner:feedFlare href="http://www.dailyrotation.com/index.php?feed=http%3A%2F%2Ffeeds.feedburner.com%2Fhuxuan" src="http://www.dailyrotation.com/rss-dr2.gif">Subscribe with Daily Rotation</feedburner:feedFlare><item>
		<title>Farewell, Jiepang!</title>
		<link>http://feedproxy.google.com/~r/huxuan/~3/RSj5BbOo_m8/</link>
		<comments>http://huxuan.org/20120117/farewell-jiepang/#comments</comments>
		<pubDate>Tue, 17 Jan 2012 06:27:49 +0000</pubDate>
		<dc:creator>Shane.Hu</dc:creator>
				<category><![CDATA[碎碎念]]></category>

		<guid isPermaLink="false">http://huxuan.org/?p=1104</guid>
		<description><![CDATA[今天就要启程回家了，也是我正式离开街旁了，有好多话想说想留下来。 2011年08月——2012年01月，满打满算也不到半年，只能勉强说是一个学期。 一开始就很关注街旁，因为街旁有着很深的北航情缘，从校长yuancheng，到神一般的大牛lqs，再到设计师Catt、Bill。街旁刚成立不久，曾有一次可以邂逅的机会，当时因为恰好刚刚联系了北大的实验室，便擦肩而过了。 刚成为街旁RD组后台工程师团队的一名实习生时我还是一个很烂的python coder，只是看过一两本书，没写过像样的python代码，而街旁的API是用纯Python写的，而且是整个街旁网站和所有平台客户端的基础，这对我来说是一个很大的挑战，也是最吸引我的地方， 除了修了一些小bug，做了一些小功能，留下比较深刻印象的就是同步等相关模块的重构了。一开始连HTTP协议都没有搞明白，一下就被Basic OAuth, OAuth1.0, OAuth2.0这些协议给搞晕了。刚开始重构的时候主要是精简优化了接口的设计，主要的同步代码几乎是照抄过来的，后来正好遇到了开心以及饭否验证方式的变更，才真的开始和这些协议死磕了。除了不知多少次厚着脸皮打扰工作中的lqs，我还在周末特意约lyxint出来去咖啡馆请教。虽然进度很慢很慢，最后还是比较顺利的上线了。 除此之外，应该就是自己犯过的各种大大小小的错误了，什么测试的时候没有重启API，或者重启之前没有pull到最新的代码，还有代码commit没有push的。更有一次，把还有Syntax Error的代码就直接push到了master分支上…… 每天午饭的时候，应该是最欢乐的时候了，可以问lqs很多问题也不至于被无视，可以没事欺负一下izzy，还可以听http://jiepang.com/zakk讲在国外的生活。我是一个生活很宅的人，也正是和RD组的各位Enginners一起，饱餐了很多顿美食。还有那次秋游泡温泉，应该是我大学以来屈指可数的脱离点线生活的记录了。 至于离职，主要是没能处理好实验室和实习的关系。从一开始就是瞒着导师出来干活的，没能做好两边兼顾，锻炼和看书的日程也一直被搁置了。下学期，我想重新规划一下自己的生活，想多下点功夫攻一攻实验室的项目，还想能多一点时间锻炼锻炼身体，多看一点和技术相关或者无关的书。我有点固执，不希望两边都将就着，所以挺突然的就提出了离职的请求。 很高兴能有这段作为Jiepanger的精力，很高兴认识你们，除了已经提到的，还有高高帅帅的芋头，博学多识的jingmi，还有kiwi、wander、wangjian、mingzhou，除了RD组的，还有APP组的Dan、周畅、靴子、大刘、威武、洋洋，此外比较熟悉的还有shawn、扬帆、康乐，很感谢大家对我的关心和照顾。 街旁很cool，街旁的团队也充满了活力。但是街旁也还很年轻，还有很多自己的路要走。我还会继续分享与记录真实生活的，希望以后还有机会成为一名Jiepanger。]]></description>
			<content:encoded><![CDATA[<p>今天就要启程回家了，也是我正式离开街旁了，有好多话想说想留下来。</p>
<p>2011年08月——2012年01月，满打满算也不到半年，只能勉强说是一个学期。</p>
<p>一开始就很关注街旁，因为街旁有着很深的北航情缘，从校长<a href="http://jiepang.com/yc">yuancheng</a>，到神一般的大牛<a href="http://jiepang.com/lqs">lqs</a>，再到设计师<a href="http://jiepang.com/catt">Catt</a>、<a href="http://jiepang.com/bill">Bill</a>。街旁刚成立不久，曾有一次可以邂逅的机会，当时因为恰好刚刚联系了北大的实验室，便擦肩而过了。</p>
<p>刚成为街旁RD组后台工程师团队的一名实习生时我还是一个很烂的python coder，只是看过一两本书，没写过像样的python代码，而街旁的API是用纯Python写的，而且是整个街旁网站和所有平台客户端的基础，这对我来说是一个很大的挑战，也是最吸引我的地方，</p>
<p>除了修了一些小bug，做了一些小功能，留下比较深刻印象的就是同步等相关模块的重构了。一开始连HTTP协议都没有搞明白，一下就被Basic OAuth, OAuth1.0, OAuth2.0这些协议给搞晕了。刚开始重构的时候主要是精简优化了接口的设计，主要的同步代码几乎是照抄过来的，后来正好遇到了开心以及饭否验证方式的变更，才真的开始和这些协议死磕了。除了不知多少次厚着脸皮打扰工作中的lqs，我还在周末特意约lyxint出来去咖啡馆请教。虽然进度很慢很慢，最后还是比较顺利的上线了。</p>
<p>除此之外，应该就是自己犯过的各种大大小小的错误了，什么测试的时候没有重启API，或者重启之前没有pull到最新的代码，还有代码commit没有push的。更有一次，把还有Syntax Error的代码就直接push到了master分支上……</p>
<p>每天午饭的时候，应该是最欢乐的时候了，可以问lqs很多问题也不至于被无视，可以没事欺负一下<a href="http://jiepang.com/izzy">izzy</a>，还可以听http://jiepang.com/zakk讲在国外的生活。我是一个生活很宅的人，也正是和RD组的各位Enginners一起，饱餐了很多顿美食。还有那次秋游泡温泉，应该是我大学以来屈指可数的脱离点线生活的记录了。</p>
<p>至于离职，主要是没能处理好实验室和实习的关系。从一开始就是瞒着导师出来干活的，没能做好两边兼顾，锻炼和看书的日程也一直被搁置了。下学期，我想重新规划一下自己的生活，想多下点功夫攻一攻实验室的项目，还想能多一点时间锻炼锻炼身体，多看一点和技术相关或者无关的书。我有点固执，不希望两边都将就着，所以挺突然的就提出了离职的请求。</p>
<p>很高兴能有这段作为Jiepanger的精力，很高兴认识你们，除了已经提到的，还有高高帅帅的芋头，博学多识的jingmi，还有<a href="http://jiepang.com/user/369982903">kiwi</a>、<a href="http://jiepang.com/wander">wander</a>、wangjian、<a href="http://jiepang.com/user/952767404">mingzhou</a>，除了RD组的，还有APP组的<a href="http://jiepang.com/user/7">Dan</a>、<a href="http://jiepang.com/user/705983395">周畅</a>、<a href="http://jiepang.com/user/30">靴子</a>、<a href="http://jiepang.com/user/567607768">大刘</a>、<a href="http://jiepang.com/user/307201547">威武</a>、洋洋，此外比较熟悉的还有<a href="http://jiepang.com/shawn">shawn</a>、<a href="http://jiepang.com/dongyangfan">扬帆</a>、<a href="http://jiepang.com/kangle">康乐</a>，很感谢大家对我的关心和照顾。</p>
<p>街旁很cool，街旁的团队也充满了活力。但是街旁也还很年轻，还有很多自己的路要走。我还会继续分享与记录真实生活的，希望以后还有机会成为一名Jiepanger。</p>

<p><a href="http://feedads.g.doubleclick.net/~a/FaMBse_19GjfoemqiSVeVSGNAOk/0/da"><img src="http://feedads.g.doubleclick.net/~a/FaMBse_19GjfoemqiSVeVSGNAOk/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/FaMBse_19GjfoemqiSVeVSGNAOk/1/da"><img src="http://feedads.g.doubleclick.net/~a/FaMBse_19GjfoemqiSVeVSGNAOk/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/huxuan?a=RSj5BbOo_m8:P4vfxnOqV2k:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/huxuan?i=RSj5BbOo_m8:P4vfxnOqV2k:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/huxuan/~4/RSj5BbOo_m8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://huxuan.org/20120117/farewell-jiepang/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://huxuan.org/20120117/farewell-jiepang/</feedburner:origLink></item>
		<item>
		<title>虾米自动签到的python脚本</title>
		<link>http://feedproxy.google.com/~r/huxuan/~3/bnJ1ugzSVuI/</link>
		<comments>http://huxuan.org/20111212/a-python-script-implement-xiami-auto-checkin/#comments</comments>
		<pubDate>Sun, 11 Dec 2011 16:56:20 +0000</pubDate>
		<dc:creator>Shane.Hu</dc:creator>
				<category><![CDATA[IT水手]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[xiami_auto_checkin]]></category>

		<guid isPermaLink="false">http://huxuan.org/?p=1095</guid>
		<description><![CDATA[一个练手的小脚本，暂时只是实现了签到，还没有很完备的错误处理，而且在实现“全自动签到”上还没有想出什么合理的方案，先把代码贴上现丑了…… 使用方法很简单 python xiami_auto_checkin.py email password 即把用户名（email）和密码作为参数传进去即可 如果你只是签固定的一个帐号，也可以直接将代码中的读参数改成赋值 这个代码只是最初的版本，你可以在这里看到最新的进展 #!/usr/bin/python # encoding:utf-8 import re import sys import urllib import urllib2 import cookielib def check(response): &#34;&#34;&#34; docstring for check &#34;&#34;&#34; pattern = re.compile(r&#039;&#60;div class=&#34;idh&#34;&#62;(已连续签到\d+天)&#60;/div&#62;&#039;) result = pattern.search(response) if result: return result.group(1) &#8230; <a href="http://huxuan.org/20111212/a-python-script-implement-xiami-auto-checkin/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>一个练手的小脚本，暂时只是实现了签到，还没有很完备的错误处理，而且在实现“全自动签到”上还没有想出什么合理的方案，先把代码贴上现丑了……</p>
<p>使用方法很简单 </p>
<pre>
python xiami_auto_checkin.py email password
</pre>
<p>即把用户名（email）和密码作为参数传进去即可<br />
如果你只是签固定的一个帐号，也可以直接将代码中的读参数改成赋值</p>
<p>这个代码只是最初的版本，你可以在<a href="http://huxuan.org/projects/xiami_auto_checkin/" title="xiami_auto_checkin">这里</a>看到最新的进展</p>
<pre>
#!/usr/bin/python
# encoding:utf-8

import re
import sys
import urllib
import urllib2
import cookielib

def check(response):
    &quot;&quot;&quot;
    docstring for check
    &quot;&quot;&quot;
    pattern = re.compile(r&#039;&lt;div class=&quot;idh&quot;&gt;(已连续签到\d+天)&lt;/div&gt;&#039;)
    result = pattern.search(response)
    if result: return result.group(1)
    return False
    pass

def main():
    &quot;&quot;&quot;
    docstring for main
    &quot;&quot;&quot;

    # Get email and password
    if len(sys.argv) != 3:
        print &#039;[Error] Please input email &amp; password as sys.argv!&#039;
        return
    email = sys.argv[1]
    password = sys.argv[2]

    # Init
    opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cookielib.CookieJar()))
    urllib2.install_opener(opener)

    # Login
    login_url = &#039;http://www.xiami.com/web/login&#039;
    login_data = urllib.urlencode({&#039;email&#039;:email, &#039;password&#039;:password, &#039;LoginButton&#039;:&#039;登陆&#039;,})
    login_headers = {&#039;Referer&#039;:&#039;http://www.xiami.com/web/login&#039;, &#039;User-Agent&#039;:&#039;Opera/9.60&#039;,}
    login_request = urllib2.Request(login_url, login_data, login_headers)
    login_response = urllib2.urlopen(login_request).read()

    # Checkin
    checkin_pattern = re.compile(r&#039;&lt;a class=&quot;check_in&quot; href=&quot;(.*?)&quot;&gt;&#039;)
    checkin_result = checkin_pattern.search(login_response)
    if not checkin_result:
        # Checkin Already | Login Failed
        result = check(login_response)
        if result :
            print &#039;[Succeed] Checkin Already!&#039;, email, result
        else:
            print &#039;[Error] Login Failed!&#039;
        return
    checkin_url = &#039;http://www.xiami.com&#039; + checkin_result.group(1)
    checkin_headers = {&#039;Referer&#039;:&#039;http://www.xiami.com/web&#039;, &#039;User-Agent&#039;:&#039;Opera/9.60&#039;,}
    checkin_request = urllib2.Request(checkin_url, None, checkin_headers)
    checkin_response = urllib2.urlopen(checkin_request).read()

    # Result
    result = check(checkin_response)
    if result:
        print &#039;[Succeed] Checkin Succeed!&#039;, email, result
    else:
        print &#039;[Error] Checkin Failed!&#039;
    pass

if __name__==&#039;__main__&#039;:
    main()
</pre>
<p></a></p>
<p>有任何问题，欢迎批评指正，更多更新信息，请参见<a href="http://huxuan.org/projects/xiami_auto_checkin/">这里</a></p>

<p><a href="http://feedads.g.doubleclick.net/~a/a0tvOViAIWCwZ0R-Qf4VGjLyPdA/0/da"><img src="http://feedads.g.doubleclick.net/~a/a0tvOViAIWCwZ0R-Qf4VGjLyPdA/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/a0tvOViAIWCwZ0R-Qf4VGjLyPdA/1/da"><img src="http://feedads.g.doubleclick.net/~a/a0tvOViAIWCwZ0R-Qf4VGjLyPdA/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/huxuan?a=bnJ1ugzSVuI:y6MBdjsAL5g:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/huxuan?i=bnJ1ugzSVuI:y6MBdjsAL5g:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/huxuan/~4/bnJ1ugzSVuI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://huxuan.org/20111212/a-python-script-implement-xiami-auto-checkin/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://huxuan.org/20111212/a-python-script-implement-xiami-auto-checkin/</feedburner:origLink></item>
		<item>
		<title>用Python处理xml文件中的非法字符</title>
		<link>http://feedproxy.google.com/~r/huxuan/~3/Z2XHjiMu77M/</link>
		<comments>http://huxuan.org/20111013/handle-xml-file-with-invalid-character-via-python/#comments</comments>
		<pubDate>Thu, 13 Oct 2011 11:05:19 +0000</pubDate>
		<dc:creator>Shane.Hu</dc:creator>
				<category><![CDATA[IT水手]]></category>
		<category><![CDATA[pyth]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://huxuan.org/?p=1093</guid>
		<description><![CDATA[用xml.dom.minidom.parse()解析xml文件时遇到非法字符直接报错的问题 最后的方案是把纯文本方式读入文件，然后用字符串来处理 可以得到将非法字符全部剔除的结果 #!/usr/bin/python # -*- coding:utf-8 -*- import string import xml.dom.minidom def parse_xml(file_path): """ Handle xml file with invalid character [input] : path of the xml file [output] : xml.dom.minidom.Document instance """ try: xmldoc = xml.dom.minidom.parse(file_path) except: f = &#8230; <a href="http://huxuan.org/20111013/handle-xml-file-with-invalid-character-via-python/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>用xml.dom.minidom.parse()解析xml文件时遇到非法字符直接报错的问题<br />
最后的方案是把纯文本方式读入文件，然后用字符串来处理<br />
可以得到将非法字符全部剔除的结果</p>
<pre>
#!/usr/bin/python
# -*- coding:utf-8 -*-

import string
import xml.dom.minidom

def parse_xml(file_path):
    """
    Handle xml file with invalid character
    [input] : path of the xml file
    [output] : xml.dom.minidom.Document instance
    """
    try:
        xmldoc = xml.dom.minidom.parse(file_path)
    except:
        f = file(file_path)
        s = f.read()
        f.close()

        ss = s.translate(None, string.printable)
        s = s.translate(None, ss)

        xmldoc = xml.dom.minidom.parseString(s)
    return xmldoc

if __name__ == '__main__':
    pass
</pre>
<p>P.S. 如果有更好的解决方案，欢迎交流</p>

<p><a href="http://feedads.g.doubleclick.net/~a/Nimzj1GQ4AO-f8BZGMoEaZxTITA/0/da"><img src="http://feedads.g.doubleclick.net/~a/Nimzj1GQ4AO-f8BZGMoEaZxTITA/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/Nimzj1GQ4AO-f8BZGMoEaZxTITA/1/da"><img src="http://feedads.g.doubleclick.net/~a/Nimzj1GQ4AO-f8BZGMoEaZxTITA/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/huxuan?a=Z2XHjiMu77M:ByBRg0BMVJ0:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/huxuan?i=Z2XHjiMu77M:ByBRg0BMVJ0:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/huxuan/~4/Z2XHjiMu77M" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://huxuan.org/20111013/handle-xml-file-with-invalid-character-via-python/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://huxuan.org/20111013/handle-xml-file-with-invalid-character-via-python/</feedburner:origLink></item>
		<item>
		<title>两年半</title>
		<link>http://feedproxy.google.com/~r/huxuan/~3/AmybaSVE94U/</link>
		<comments>http://huxuan.org/20110915/two-and-a-half-years/#comments</comments>
		<pubDate>Thu, 15 Sep 2011 04:32:12 +0000</pubDate>
		<dc:creator>Shane.Hu</dc:creator>
				<category><![CDATA[My Love]]></category>
		<category><![CDATA[Love]]></category>
		<category><![CDATA[宝贝]]></category>

		<guid isPermaLink="false">http://huxuan.org/?p=1090</guid>
		<description><![CDATA[现在是两边跑的状态，没啥太惬意的休息时间了。 忙起来就懒得写日志了…… 两年半了，觉得应该留下点什么的，但又不知道说什么好。 2009年3月14日——2011年9月14日 就这么多吧。]]></description>
			<content:encoded><![CDATA[<p>现在是两边跑的状态，没啥太惬意的休息时间了。</p>
<p>忙起来就懒得写日志了……</p>
<p>两年半了，觉得应该留下点什么的，但又不知道说什么好。</p>
<p>2009年3月14日——2011年9月14日</p>
<p>就这么多吧。</p>

<p><a href="http://feedads.g.doubleclick.net/~a/QnB9SskGFgP5mAkfNSrzh3UfpR0/0/da"><img src="http://feedads.g.doubleclick.net/~a/QnB9SskGFgP5mAkfNSrzh3UfpR0/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/QnB9SskGFgP5mAkfNSrzh3UfpR0/1/da"><img src="http://feedads.g.doubleclick.net/~a/QnB9SskGFgP5mAkfNSrzh3UfpR0/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/huxuan?a=AmybaSVE94U:F8hd4zHgi-w:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/huxuan?i=AmybaSVE94U:F8hd4zHgi-w:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/huxuan/~4/AmybaSVE94U" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://huxuan.org/20110915/two-and-a-half-years/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://huxuan.org/20110915/two-and-a-half-years/</feedburner:origLink></item>
		<item>
		<title>为什么?</title>
		<link>http://feedproxy.google.com/~r/huxuan/~3/PeDMjop5OiU/</link>
		<comments>http://huxuan.org/20110913/%e4%b8%ba%e4%bb%80%e4%b9%88/#comments</comments>
		<pubDate>Mon, 12 Sep 2011 16:52:07 +0000</pubDate>
		<dc:creator>Shane.Hu</dc:creator>
				<category><![CDATA[碎碎念]]></category>

		<guid isPermaLink="false">http://huxuan.org/%e4%b8%ba%e4%bb%80%e4%b9%88/</guid>
		<description><![CDATA[为什么善良的人总要受到伤害? 为什么相爱的人总要面对分离? 为什么那些恶人心安理得的活着? 为什么那些坏事不厌其烦的重演? 你这个不公的世界，我要毁灭你!]]></description>
			<content:encoded><![CDATA[<p>为什么善良的人总要受到伤害?<br />
为什么相爱的人总要面对分离?</p>
<p>为什么那些恶人心安理得的活着?<br />
为什么那些坏事不厌其烦的重演?</p>
<p>你这个不公的世界，我要毁灭你!</p>

<p><a href="http://feedads.g.doubleclick.net/~a/_cHZlaeY3v54PzkTDDyj7OEMqnU/0/da"><img src="http://feedads.g.doubleclick.net/~a/_cHZlaeY3v54PzkTDDyj7OEMqnU/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/_cHZlaeY3v54PzkTDDyj7OEMqnU/1/da"><img src="http://feedads.g.doubleclick.net/~a/_cHZlaeY3v54PzkTDDyj7OEMqnU/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/huxuan?a=PeDMjop5OiU:A8Ggilm6wR8:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/huxuan?i=PeDMjop5OiU:A8Ggilm6wR8:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/huxuan/~4/PeDMjop5OiU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://huxuan.org/20110913/%e4%b8%ba%e4%bb%80%e4%b9%88/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		<feedburner:origLink>http://huxuan.org/20110913/%e4%b8%ba%e4%bb%80%e4%b9%88/</feedburner:origLink></item>
		<item>
		<title>要回帝都了</title>
		<link>http://feedproxy.google.com/~r/huxuan/~3/ktsMA7nALec/</link>
		<comments>http://huxuan.org/20110818/back-to-bj-soon/#comments</comments>
		<pubDate>Thu, 18 Aug 2011 08:45:43 +0000</pubDate>
		<dc:creator>Shane.Hu</dc:creator>
				<category><![CDATA[碎碎念]]></category>

		<guid isPermaLink="false">http://huxuan.org/?p=1088</guid>
		<description><![CDATA[终于要回帝都了，回家约莫半个月了。 不知道该怎么说呢，只感觉和家乡越来越不兼容了。 讨厌酒宴，讨厌走亲戚，我只想一个人静静待着，彻底放松下在帝都紧张的生活节奏。我不觉得自己是什么大人物，更不觉得让我吃好的是什么关心我，那些一厢情愿有时真的令我很作呕。大家实际都在做自己想做的，并不关心对方真正需要的是什么。 不管怎样总算离开了，每次都是这样，回家前多么期待，回家之后就会多么期待离开。可能确实是我一个人在外习惯了，不过一个人在外时确实能更加专注的投入到工作和学习中，在家却会被各种事情扰乱了心绪，什么都做不好，只能让自己愈发烦躁。 家家有本难念的经，或许确实如此，我也不想再关心什么大家族中的各种琐事，什么话语权，什么明争暗斗，不是一般的无聊透顶。我还是老老实实做我想做的就好了，那些都和我无关，以后的我也不会走那样的路。 不再抱怨了，还是有一些值得开心的事情的，和她又见面了，相伴了几天，很幸福，很开心，虽然又要分开了，但总会再见面的，我们都在努力。 确实回家几天，已经积压了好多事情没有做，实验室的，街旁的，还有自己想做的，没什么好说的，做就好了。]]></description>
			<content:encoded><![CDATA[<p>终于要回帝都了，回家约莫半个月了。</p>
<p>不知道该怎么说呢，只感觉和家乡越来越不兼容了。</p>
<p>讨厌酒宴，讨厌走亲戚，我只想一个人静静待着，彻底放松下在帝都紧张的生活节奏。我不觉得自己是什么大人物，更不觉得让我吃好的是什么关心我，那些一厢情愿有时真的令我很作呕。大家实际都在做自己想做的，并不关心对方真正需要的是什么。</p>
<p>不管怎样总算离开了，每次都是这样，回家前多么期待，回家之后就会多么期待离开。可能确实是我一个人在外习惯了，不过一个人在外时确实能更加专注的投入到工作和学习中，在家却会被各种事情扰乱了心绪，什么都做不好，只能让自己愈发烦躁。</p>
<p>家家有本难念的经，或许确实如此，我也不想再关心什么大家族中的各种琐事，什么话语权，什么明争暗斗，不是一般的无聊透顶。我还是老老实实做我想做的就好了，那些都和我无关，以后的我也不会走那样的路。</p>
<p>不再抱怨了，还是有一些值得开心的事情的，和她又见面了，相伴了几天，很幸福，很开心，虽然又要分开了，但总会再见面的，我们都在努力。</p>
<p>确实回家几天，已经积压了好多事情没有做，实验室的，街旁的，还有自己想做的，没什么好说的，做就好了。</p>

<p><a href="http://feedads.g.doubleclick.net/~a/06ewZebz9rE8ml8PJY8-zU_x9nQ/0/da"><img src="http://feedads.g.doubleclick.net/~a/06ewZebz9rE8ml8PJY8-zU_x9nQ/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/06ewZebz9rE8ml8PJY8-zU_x9nQ/1/da"><img src="http://feedads.g.doubleclick.net/~a/06ewZebz9rE8ml8PJY8-zU_x9nQ/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/huxuan?a=ktsMA7nALec:trrT6bekO-c:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/huxuan?i=ktsMA7nALec:trrT6bekO-c:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/huxuan/~4/ktsMA7nALec" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://huxuan.org/20110818/back-to-bj-soon/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://huxuan.org/20110818/back-to-bj-soon/</feedburner:origLink></item>
		<item>
		<title>街旁第一天</title>
		<link>http://feedproxy.google.com/~r/huxuan/~3/ldMsn-WTjd0/</link>
		<comments>http://huxuan.org/20110801/first-day-in-jiepang/#comments</comments>
		<pubDate>Mon, 01 Aug 2011 15:56:21 +0000</pubDate>
		<dc:creator>Shane.Hu</dc:creator>
				<category><![CDATA[碎碎念]]></category>
		<category><![CDATA[街旁]]></category>

		<guid isPermaLink="false">http://huxuan.org/?p=1086</guid>
		<description><![CDATA[在街旁的第一天结束了，一大早很兴奋的早早赶去建国门，却遭遇同为上班族的同伴阻击，在地铁里饱受压迫之苦…… 作为新人，第一天去主要就是大致熟悉了一些开发项目的代码，认识了组里的同事，还有座位之类的杂事，事情不是很多。我是跟在 @lqs 学长后面的，很幸运，下午还在lqs学长的指导下，成功修复了一个小bug，很开心。 要好好加油呢，要努力学习好多好多东西才行。 8月开始了，在街旁的日子也开始了，还有很多很多的开始，他们都是努力的起点。 P.S.小鱼鱼要乖乖等我回去。]]></description>
			<content:encoded><![CDATA[<p>在街旁的第一天结束了，一大早很兴奋的早早赶去建国门，却遭遇同为上班族的同伴阻击，在地铁里饱受压迫之苦……</p>
<p>作为新人，第一天去主要就是大致熟悉了一些开发项目的代码，认识了组里的同事，还有座位之类的杂事，事情不是很多。我是跟在 @lqs 学长后面的，很幸运，下午还在lqs学长的指导下，成功修复了一个小bug，很开心。</p>
<p>要好好加油呢，要努力学习好多好多东西才行。</p>
<p>8月开始了，在街旁的日子也开始了，还有很多很多的开始，他们都是努力的起点。</p>
<p>P.S.小鱼鱼要乖乖等我回去。</p>

<p><a href="http://feedads.g.doubleclick.net/~a/cuQXNbyAej_-Ag2djlQ0kpidPmk/0/da"><img src="http://feedads.g.doubleclick.net/~a/cuQXNbyAej_-Ag2djlQ0kpidPmk/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/cuQXNbyAej_-Ag2djlQ0kpidPmk/1/da"><img src="http://feedads.g.doubleclick.net/~a/cuQXNbyAej_-Ag2djlQ0kpidPmk/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/huxuan?a=ldMsn-WTjd0:UIaApY7jAsk:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/huxuan?i=ldMsn-WTjd0:UIaApY7jAsk:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/huxuan/~4/ldMsn-WTjd0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://huxuan.org/20110801/first-day-in-jiepang/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://huxuan.org/20110801/first-day-in-jiepang/</feedburner:origLink></item>
		<item>
		<title>终于快要回家了</title>
		<link>http://feedproxy.google.com/~r/huxuan/~3/REHYlA6z05E/</link>
		<comments>http://huxuan.org/20110730/back-home-soon/#comments</comments>
		<pubDate>Sat, 30 Jul 2011 13:06:23 +0000</pubDate>
		<dc:creator>Shane.Hu</dc:creator>
				<category><![CDATA[碎碎念]]></category>
		<category><![CDATA[Life]]></category>

		<guid isPermaLink="false">http://huxuan.org/?p=1084</guid>
		<description><![CDATA[DRR的论文投稿结束了，终于可以稍微休整一下，虽然不知道结果怎样，但是已经无所谓了。 明天还有组内的一个小会，下午去一趟就行，上午可以睡个安心觉。 后天就要去街旁了，如此难得的机会要好好珍惜才行，谢谢yuancheng师兄，也谢谢lqs学长，还有zakk和芋头，期待更多的交流和合作。 4号晚上的火车票，5号就可以见到她了，很期待，很思念。 没有和爸妈说火车票的时间，他们也没多问，心照不宣吧，谢谢你们的理解。 我知道我在做什么，我会努力做到最好的，谢谢你们，我的朋友。]]></description>
			<content:encoded><![CDATA[<p>DRR的论文投稿结束了，终于可以稍微休整一下，虽然不知道结果怎样，但是已经无所谓了。</p>
<p>明天还有组内的一个小会，下午去一趟就行，上午可以睡个安心觉。</p>
<p>后天就要去街旁了，如此难得的机会要好好珍惜才行，谢谢yuancheng师兄，也谢谢lqs学长，还有zakk和芋头，期待更多的交流和合作。</p>
<p>4号晚上的火车票，5号就可以见到她了，很期待，很思念。</p>
<p>没有和爸妈说火车票的时间，他们也没多问，心照不宣吧，谢谢你们的理解。</p>
<p>我知道我在做什么，我会努力做到最好的，谢谢你们，我的朋友。</p>

<p><a href="http://feedads.g.doubleclick.net/~a/RWDx4unnQ0qk1ZEA-S8Mfrjbx0g/0/da"><img src="http://feedads.g.doubleclick.net/~a/RWDx4unnQ0qk1ZEA-S8Mfrjbx0g/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/RWDx4unnQ0qk1ZEA-S8Mfrjbx0g/1/da"><img src="http://feedads.g.doubleclick.net/~a/RWDx4unnQ0qk1ZEA-S8Mfrjbx0g/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/huxuan?a=REHYlA6z05E:0z36OnFa2fY:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/huxuan?i=REHYlA6z05E:0z36OnFa2fY:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/huxuan/~4/REHYlA6z05E" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://huxuan.org/20110730/back-home-soon/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://huxuan.org/20110730/back-home-soon/</feedburner:origLink></item>
		<item>
		<title>在Eclipse中运行pdfbox</title>
		<link>http://feedproxy.google.com/~r/huxuan/~3/ZxMeEUSE2-Q/</link>
		<comments>http://huxuan.org/20110722/run-pdfbox-in-eclipse/#comments</comments>
		<pubDate>Fri, 22 Jul 2011 09:27:56 +0000</pubDate>
		<dc:creator>Shane.Hu</dc:creator>
				<category><![CDATA[IT水手]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[ICST]]></category>
		<category><![CDATA[maven]]></category>
		<category><![CDATA[pdfbox]]></category>

		<guid isPermaLink="false">http://huxuan.org/?p=1083</guid>
		<description><![CDATA[【前言】pdfbox是实验室做文档识别需要了解的开源项目，可是官网doc过于简略，网上资料很多只是调用jar并非在Eclipse中配置运行源代码，仅以此文祭奠我两天的折腾时间…… 0) Environment Specification OS:Windows 7 IDE:Eclipse SDK 3.7.0 JDK:Version 6 Update 26 1) This post will not involve the configuration of Java, but you need to confirm JAVA_HOME is in your &#8220;Environment Variable&#8221; which we will need later on. &#8230; <a href="http://huxuan.org/20110722/run-pdfbox-in-eclipse/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>【前言】pdfbox是实验室做文档识别需要了解的开源项目，可是官网doc过于简略，网上资料很多只是调用jar并非在Eclipse中配置运行源代码，仅以此文祭奠我两天的折腾时间……</p>
<p>0) Environment Specification<br />
OS:Windows 7<br />
IDE:Eclipse SDK 3.7.0<br />
JDK:Version 6 Update 26</p>
<p>1) This post will not involve the configuration of Java, but you need to confirm JAVA_HOME is in your &#8220;<a href="http://en.wikipedia.org/wiki/Environment_variable">Environment Variable</a>&#8221; which we will need later on.<br />
The key should be &#8220;JAVA_HOME&#8221; and the value is the path of JDK, for me is &#8220;D:\Program Files\Java\jdk1.6.0_26&#8243;</p>
<p>2) Download and extract pdfbox, pdfbox-*.*.*-src.zip, for me is &#8220;pdfbox-1.6.0-src.zip&#8221; and the extact location is &#8220;E:\Code\JAVA\pdfbox-1.6.0&#8243;<br />
<a href="http://pdfbox.apache.org/download.html">http://pdfbox.apache.org/download.html</a></p>
<p>3) Download and Extract Maven2, apache-maven-*.*.*-bin.zip, for me is &#8220;apache-maven-3.0.3-bin.zip&#8221; and the extract location is &#8220;D:\Program Files\apache-maven-3.0.3&#8243;<br />
<a href="http://maven.apache.org/download.html">http://maven.apache.org/download.html</a></p>
<p>4) Configure the &#8220;Environment Variable&#8221; for Maven2 / Install Maven2<br />
4.1) Add key &#8220;M2_HOME&#8221; and the value is path you extact Maven2, for me is &#8220;D:\Program iles\apache-maven-3.0.3&#8243;<br />
4.2) Add &#8220;%M2_HOME%\bin&#8221; to the key &#8220;Path&#8221;.<br />
4.3) Open a new command prompt and run &#8220;mvn &#8211;version&#8221; to verify correct installation.</p>
<p>5) Install and configure the pdfbox via Maven2<br />
5.1) Open a new command prompt and change directory to the extract location of pdfbox<br />
5.2) Run &#8220;mvn clean install&#8221; to install the pdfbox<br />
5.3) Run &#8220;mvn eclipse:eclipse&#8221; to make it a eclipse project.<br />
5.4) Run &#8220;mvn -Declipse.workspace=&#8221;PATH OF THE WORKSPACE&#8221; eclipse:configure-workspace&#8221; to add M2_REPO classpath variable to Eclipse.<br />
Note : 5.3 &#038; 5.4 is the MOST IMPORTANT part.</p>
<p>6) Import the project into Eclipse with the root directory of pdfbox (for me is E:\Code\JAVA\pdfbox-1.6.0) then there should be no errors in all the projects.</p>
<p>7) Edit the &#8220;Run Configurations&#8221; and enter the command line arguments in the &#8220;Arguments&#8221; tab and then everything should run correctly.</p>
<p>Reference:<br />
1) <a href="http://pdfbox.apache.org/userguide/building_pdfbox.html">http://pdfbox.apache.org/userguide/building_pdfbox.html</a><br />
2) <a href="http://maven.apache.org/download.html#Installation">http://maven.apache.org/download.html#Installation</a><br />
3) <a href="http://maven.apache.org/guides/getting-started/index.html">http://maven.apache.org/guides/getting-started/index.html</a><br />
4) <a href="http://www.mkyong.com/maven/how-to-configure-m2_repo-variable-in-eclipse-ide/">http://www.mkyong.com/maven/how-to-configure-m2_repo-variable-in-eclipse-ide/</a></p>

<p><a href="http://feedads.g.doubleclick.net/~a/jidcyfbIiceKHXhR_Zr-XNS6AWU/0/da"><img src="http://feedads.g.doubleclick.net/~a/jidcyfbIiceKHXhR_Zr-XNS6AWU/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/jidcyfbIiceKHXhR_Zr-XNS6AWU/1/da"><img src="http://feedads.g.doubleclick.net/~a/jidcyfbIiceKHXhR_Zr-XNS6AWU/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/huxuan?a=ZxMeEUSE2-Q:rGxgU-JQpXs:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/huxuan?i=ZxMeEUSE2-Q:rGxgU-JQpXs:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/huxuan/~4/ZxMeEUSE2-Q" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://huxuan.org/20110722/run-pdfbox-in-eclipse/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		<feedburner:origLink>http://huxuan.org/20110722/run-pdfbox-in-eclipse/</feedburner:origLink></item>
		<item>
		<title>21岁祭</title>
		<link>http://feedproxy.google.com/~r/huxuan/~3/tnYvDRBeizE/</link>
		<comments>http://huxuan.org/20110720/memory-for-21-years-old/#comments</comments>
		<pubDate>Wed, 20 Jul 2011 06:53:25 +0000</pubDate>
		<dc:creator>Shane.Hu</dc:creator>
				<category><![CDATA[碎碎念]]></category>

		<guid isPermaLink="false">http://huxuan.org/?p=1066</guid>
		<description><![CDATA[不知不觉已经在Very Hard模式下存活了21年了，我俨然升级成为了超级小强，坚强的证明着景德镇工人阶级的生命之伟大，以下省略1WW字…… P大的事基本搞定了，没啥好担心的了，虽然之前差点纠结致死。总觉得自己有一点犯Jian的味道，总是担心这担心那，显得蹑手蹑脚的，可能还是缺少历练吧。组织的事也算比较圆满的结束了，作为一分子我都积极了近三年了，终于……你懂得。 彻底把硬盘格了，全盘Linux，一开始折腾的是Arch，觉得有些过于激进，稳定性不够，然后又转向Gentoo了，现在是Gentoo+(VirtualBox+XP)，目前使用良好。Sina2WordPress有了雏形，但是又将折腾系统作为借口好久没碰代码了。眼看着假期过去1/3了，看看当初的那些计划，甚感自己的效率低下啊，要好好动手了呢，不能再说那么多空话了。 英文名改了，也不记得当初为啥选Victor了，一学弟说有点功利，其实我也一直想改的。现在叫Shane了，虽然又有一学弟说是太像Shame了，shame就shame好了，没啥好丢人的……以后我就叫Shane.Hu了，当然你还可以叫我胡旭安。 怎么说呢，还是觉得自己有点变化的，特别是最近看了几部电影和几本书之后，对古典音乐越来越有感了，但是总觉得自己知识很欠缺了，还望高人指点。 和她的关系也趋于平稳了，主要也是我不像以前那样瞎纠结了，就这样一起好好走下去吧。 想找个实习的，但是突然觉得自己好弱啊，各种迷茫…… 想不起来说啥了，我又老了一岁，谢谢没有忘记我生日的人，其他的就不俗套了，就这样。]]></description>
			<content:encoded><![CDATA[<p>不知不觉已经在Very Hard模式下存活了21年了，我俨然升级成为了超级小强，坚强的证明着景德镇工人阶级的生命之伟大，以下省略1WW字……</p>
<p>P大的事基本搞定了，没啥好担心的了，虽然之前差点纠结致死。总觉得自己有一点犯Jian的味道，总是担心这担心那，显得蹑手蹑脚的，可能还是缺少历练吧。组织的事也算比较圆满的结束了，作为一分子我都积极了近三年了，终于……你懂得。</p>
<p>彻底把硬盘格了，全盘Linux，一开始折腾的是Arch，觉得有些过于激进，稳定性不够，然后又转向Gentoo了，现在是Gentoo+(VirtualBox+XP)，目前使用良好。<a href="http://huxuan.org/projects/sina2wordpress/" title="Sina2WordPress">Sina2WordPress</a>有了雏形，但是又将折腾系统作为借口好久没碰代码了。眼看着假期过去1/3了，看看<a href="http://huxuan.org/some-thoughts/" title="一点闲思">当初的那些计划</a>，甚感自己的效率低下啊，要好好动手了呢，不能再说那么多空话了。</p>
<p>英文名改了，也不记得当初为啥选Victor了，一学弟说有点功利，其实我也一直想改的。现在叫Shane了，虽然又有一学弟说是太像Shame了，shame就shame好了，没啥好丢人的……以后我就叫Shane.Hu了，当然你还可以叫我胡旭安。</p>
<p>怎么说呢，还是觉得自己有点变化的，特别是最近看了几部电影和几本书之后，对古典音乐越来越有感了，但是总觉得自己知识很欠缺了，还望高人指点。</p>
<p>和她的关系也趋于平稳了，主要也是我不像以前那样瞎纠结了，就这样一起好好走下去吧。</p>
<p>想找个实习的，但是突然觉得自己好弱啊，各种迷茫……</p>
<p>想不起来说啥了，我又老了一岁，谢谢没有忘记我生日的人，其他的就不俗套了，就这样。</p>

<p><a href="http://feedads.g.doubleclick.net/~a/ZlVHGTd27o1Od_NR-gtFdByVItg/0/da"><img src="http://feedads.g.doubleclick.net/~a/ZlVHGTd27o1Od_NR-gtFdByVItg/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/ZlVHGTd27o1Od_NR-gtFdByVItg/1/da"><img src="http://feedads.g.doubleclick.net/~a/ZlVHGTd27o1Od_NR-gtFdByVItg/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/huxuan?a=tnYvDRBeizE:vU2U3eL52XQ:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/huxuan?i=tnYvDRBeizE:vU2U3eL52XQ:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/huxuan/~4/tnYvDRBeizE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://huxuan.org/20110720/memory-for-21-years-old/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		<feedburner:origLink>http://huxuan.org/20110720/memory-for-21-years-old/</feedburner:origLink></item>
		<item>
		<title>利用Python解析新浪博客javascript生成的评论</title>
		<link>http://feedproxy.google.com/~r/huxuan/~3/ltr6RSeyGrk/</link>
		<comments>http://huxuan.org/20110708/using-python-to-decode-the-sina-blog-s-comments-generated-by-javascript/#comments</comments>
		<pubDate>Fri, 08 Jul 2011 02:21:04 +0000</pubDate>
		<dc:creator>Shane.Hu</dc:creator>
				<category><![CDATA[IT水手]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[Sina2WordPress]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://huxuan.org/?p=1060</guid>
		<description><![CDATA[【前言】sina2wordpress终于有一个大概模样了，目前版本号为0.1 这是本站项目地址，这是代码托管地址 言归正传，目前新浪博客的评论是用JavaScript生成的，直接用urllib2读取的信息中没有评论信息 通过Firefox下的firebug或者Chrome自带的Develop Tools，都可以找到js脚本在运行时GET的数据，具体方法是：打开之后选择“Network”标签，并选择“XHR”分类项，刷新页面并等待加载完成，稍等一会就会看到GET了一条以“comment”开头的html页面。 主要规律是，例如韩寒同学的这篇日志地址是 “http://blog.sina.com.cn/s/blog_4701280b0101854o.html”，那么打开日志页面时GET的就会是 &#8220;comment_4701280b0101854o_1.html&#8221;，规律不难发现，后面的那个数字就是评论的页数，最后的那个页数可以变为任意整数（没有尝试过上限），当超过实际评论页数时，显示的会是同样的编码，这也就是循环结束条件 此地址为相对路径，打开后是一堆乱码，这就是JavaScript的数据存储形式——json编码。可以简单的类比成Python中的字典，本例中共有两个关键字，一个是“Code”，对应值&#8221;A00006&#8243;，没发现啥用处，第二个关键字是“data”，其余部分均为data的对应值，利用Python的json模块进行解析可以发现，这就是评论的html代码。不过这里需要注意的是，第二个关键字“data”缺少双引号，直接解析会报错，需要先进行字符串处理，然后再解析。 相关代码如下（完整代码可以参见前言中的代码托管地址）： #根据json解析之后的html代码总结出来的各个关键信息的正则表达式 comment_author_pattern=re.compile(r&#039;&#60;span class=&#34;SG_revert_Tit&#34;.*?&#62;(.*?)&#60;/span&#62;&#039;) comment_url_pattern=re.compile(r&#039;&#60;a href=&#34;(.*?)&#34; target=&#34;_blank&#34;&#62;(.*?)&#60;/a&#62;&#039;) comment_time_pattern=re.compile(r&#039;&#60;em class=&#34;SG_txtc&#34;&#62;(.*?)&#60;/em&#62;&#039;) comment_content_pattern=re.compile(r&#039;&#60;div class=&#34;SG_revert_Inner SG_txtb&#34;.*?&#62;(.*?)&#60;/div&#62;&#039;, re.S) #这里的re.S很重要 def commentsAnalyze(key): #key为地址中间的标识性字符串 num=1 #表示评论的页数 url=r&#039;http://blog.sina.com.cn/s/comment_%s_%d.html&#039; %(key, num) #生成json编码对应的地址 page=urllib2.urlopen(url).read().replace(&#039;data:&#039;,&#039;\&#34;data\&#34;:&#039;,1) #给data添加双引号 while not &#039;noCommdate&#039; in page: #noCommdata是无评论json编码页面的关键字 &#8230; <a href="http://huxuan.org/20110708/using-python-to-decode-the-sina-blog-s-comments-generated-by-javascript/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>【前言】sina2wordpress终于有一个大概模样了，目前版本号为0.1<br />
<a href="http://huxuan.org/projects/sina2wordpress/" title="Sina2WordPress">这是本站项目地址</a>，<a href="https://github.com/huxuan/sina2wordpress">这是代码托管地址</a></p>
<p>言归正传，目前新浪博客的评论是用JavaScript生成的，直接用urllib2读取的信息中没有评论信息</p>
<p>通过Firefox下的firebug或者Chrome自带的Develop Tools，都可以找到js脚本在运行时GET的数据，具体方法是：打开之后选择“Network”标签，并选择“XHR”分类项，刷新页面并等待加载完成，稍等一会就会看到GET了一条以“comment”开头的html页面。</p>
<p>主要规律是，例如韩寒同学的这篇日志地址是 “http://blog.sina.com.cn/s/blog_4701280b0101854o.html”，那么打开日志页面时GET的就会是 &#8220;comment_4701280b0101854o_1.html&#8221;，规律不难发现，后面的那个数字就是评论的页数，最后的那个页数可以变为任意整数（没有尝试过上限），当超过实际评论页数时，显示的会是同样的编码，这也就是循环结束条件</p>
<p>此地址为相对路径，打开后是一堆乱码，这就是JavaScript的数据存储形式——json编码。可以简单的类比成Python中的字典，本例中共有两个关键字，一个是“Code”，对应值&#8221;A00006&#8243;，没发现啥用处，第二个关键字是“data”，其余部分均为data的对应值，利用Python的json模块进行解析可以发现，这就是评论的html代码。不过这里需要注意的是，第二个关键字“data”缺少双引号，直接解析会报错，需要先进行字符串处理，然后再解析。</p>
<p>相关代码如下（完整代码可以参见前言中的代码托管地址）：</p>
<pre>
#根据json解析之后的html代码总结出来的各个关键信息的正则表达式
comment_author_pattern=re.compile(r&#039;&lt;span class=&quot;SG_revert_Tit&quot;.*?&gt;(.*?)&lt;/span&gt;&#039;)
comment_url_pattern=re.compile(r&#039;&lt;a href=&quot;(.*?)&quot; target=&quot;_blank&quot;&gt;(.*?)&lt;/a&gt;&#039;)
comment_time_pattern=re.compile(r&#039;&lt;em class=&quot;SG_txtc&quot;&gt;(.*?)&lt;/em&gt;&#039;)
comment_content_pattern=re.compile(r&#039;&lt;div class=&quot;SG_revert_Inner SG_txtb&quot;.*?&gt;(.*?)&lt;/div&gt;&#039;, re.S) #这里的re.S很重要

def commentsAnalyze(key): #key为地址中间的标识性字符串
    num=1 #表示评论的页数
    url=r&#039;http://blog.sina.com.cn/s/comment_%s_%d.html&#039; %(key, num) #生成json编码对应的地址
    page=urllib2.urlopen(url).read().replace(&#039;data:&#039;,&#039;\&quot;data\&quot;:&#039;,1) #给data添加双引号
    while not &#039;noCommdate&#039; in page: #noCommdata是无评论json编码页面的关键字
        data=json.loads(page)[&#039;data&#039;] #&lt;strong&gt;最关键的一部&lt;/strong&gt;，json代码的解析并有效部分

        #通过正则匹配出相关信息，其中url是可能存在的，将稍后处理
        author=comment_author_pattern.findall(data)
        url=[]
        time=comment_time_pattern.findall(data)
        content=comment_content_pattern.findall(data)

        #后处理url，判断前面提取出来的author周边是不是带有&lt;a&gt;标签（超链接）即可
        for i in range(len(author)):
            comment_id+=1
            result=comment_url_pattern.search(author[i])
            if result:
                url.append(result.group(1))
                author[i]=result.group(2)
            else: url.append(&#039;&#039;)

        num+=1 #评论页数+1
        url=r&#039;http://blog.sina.com.cn/s/comment_&#039;+key+&#039;_&#039;+str(num)+&#039;.html&#039; #生成新的页面地址
        page=urllib2.urlopen(url).read().replace(&#039;data:&#039;,&#039;\&quot;data\&quot;:&#039;,1) #修正data的双引号，重复循环
</pre>
<p></a></p>
<p>【后记】感谢 <a href="http://twitter.com/lqs">@lqs</a> 学长和 <a href="http://code.google.com/p/bhosc/">北航开源俱乐部BHOSC的同胞们</a> 在此问题上给予的帮助</p>

<p><a href="http://feedads.g.doubleclick.net/~a/8Yygj3YXcGUdX-XJT5TE_xxNhac/0/da"><img src="http://feedads.g.doubleclick.net/~a/8Yygj3YXcGUdX-XJT5TE_xxNhac/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/8Yygj3YXcGUdX-XJT5TE_xxNhac/1/da"><img src="http://feedads.g.doubleclick.net/~a/8Yygj3YXcGUdX-XJT5TE_xxNhac/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/huxuan?a=ltr6RSeyGrk:niekrrVFQtE:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/huxuan?i=ltr6RSeyGrk:niekrrVFQtE:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/huxuan/~4/ltr6RSeyGrk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://huxuan.org/20110708/using-python-to-decode-the-sina-blog-s-comments-generated-by-javascript/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://huxuan.org/20110708/using-python-to-decode-the-sina-blog-s-comments-generated-by-javascript/</feedburner:origLink></item>
		<item>
		<title>精简WordPress eXtended Rss (WXR) 文件格式</title>
		<link>http://feedproxy.google.com/~r/huxuan/~3/C3zbPJX1N5s/</link>
		<comments>http://huxuan.org/20110624/simplify-wordpress-extended-rss-wxr-file-format/#comments</comments>
		<pubDate>Fri, 24 Jun 2011 08:25:41 +0000</pubDate>
		<dc:creator>Shane.Hu</dc:creator>
				<category><![CDATA[IT水手]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[rss]]></category>
		<category><![CDATA[sina2wor]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[WXR]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://blog.huxuan.org/?p=1053</guid>
		<description><![CDATA[经过N次Import和数据库清空，终于将之前的WXR文件格式的完备集简化了。 简化原则是适应Sina2WordPress项目的需要，尽可能精简文件大小，删除了导入无效的（如博客标题、博客链接等）和从新浪博客中无法获取的（如评论者的链接和IP等）信息，还有item之前的的作者、分类和标签信息。作者在导入时可以指定的，反而加上会有可能的错误，分类和标签的信息用post中的分类和标签就可以自动统计了。没想明白为什么非要单独列出来，难道是为了空的分类和标签，那还要它干嘛？ 一些必不可少的标签及错误总结： 1、wxr_version，缺少会提示“missing/invalid WXR version number”的错误 2、post_id，否则只会导入第一篇文章 3、status，否则都会显示成draft 4、post_type，否则无法导入 5、comment_approved，否则无法导入 P.S.post_id的问题纠结了好久，为什么官方不好好设计一下呢？至少觉得应该在Settings设定对应的选项的…… &#60; ?xml version=&#34;1.0&#34; encoding=&#34;UTF-8&#34; ?&#62; &#60;rss version=&#34;2.0&#34; xmlns:excerpt=&#34;http://wordpress.org/export/1.1/excerpt/&#34; xmlns:content=&#34;http://purl.org/rss/1.0/modules/content/&#34; xmlns:wfw=&#34;http://wellformedweb.org/CommentAPI/&#34; xmlns:dc=&#34;http://purl.org/dc/elements/1.1/&#34; xmlns:wp=&#34;http://wordpress.org/export/1.1/&#34; &#62; &#60;!--RSS版本号和名字空间的扩展，以上为固定内容--&#62; &#60;channel&#62; &#60;wp:wxr_version&#62;1.1&#60;/wp:wxr_version&#62; &#60;!--WXR格式版本号--&#62; &#60;item&#62;&#60;!--页面或者日志内容，每个为一个item--&#62; &#60;title&#62;Title test&#60;/title&#62; &#60;!--标题--&#62; &#60;content:encoded&#62;&#60; ![CDATA[Content_test]]&#62;&#60;/content:encoded&#62; &#60;!--这里是正文内容--&#62; &#60;wp:post_id&#62;1&#60;/wp:post_id&#62; &#60;!--页面或日志的序号，两者使用同一序列--&#62; &#60;wp:post_date&#62;2002-12-21 07:59:59&#60;/wp:post_date&#62; &#8230; <a href="http://huxuan.org/20110624/simplify-wordpress-extended-rss-wxr-file-format/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>经过N次Import和数据库清空，终于将之前的<a href="http://huxuan.org/analysis-of-wordpress-extended-rss-wxr-file/">WXR文件格式的完备集</a>简化了。</p>
<p>简化原则是适应Sina2WordPress项目的需要，尽可能精简文件大小，删除了导入无效的（如博客标题、博客链接等）和从新浪博客中无法获取的（如评论者的链接和IP等）信息，还有item之前的的作者、分类和标签信息。作者在导入时可以指定的，反而加上会有可能的错误，分类和标签的信息用post中的分类和标签就可以自动统计了。没想明白为什么非要单独列出来，难道是为了空的分类和标签，那还要它干嘛？</p>
<p>一些必不可少的标签及错误总结：<br />
1、wxr_version，缺少会提示“missing/invalid WXR version number”的错误<br />
2、post_id，否则只会导入第一篇文章<br />
3、status，否则都会显示成draft<br />
4、post_type，否则无法导入<br />
5、comment_approved，否则无法导入</p>
<p>P.S.post_id的问题纠结了好久，为什么官方不好好设计一下呢？至少觉得应该在Settings设定对应的选项的……</p>
<pre>
&lt; ?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; ?&gt;

&lt;rss version=&quot;2.0&quot;
	xmlns:excerpt=&quot;http://wordpress.org/export/1.1/excerpt/&quot;
	xmlns:content=&quot;http://purl.org/rss/1.0/modules/content/&quot;
	xmlns:wfw=&quot;http://wellformedweb.org/CommentAPI/&quot;
	xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot;
	xmlns:wp=&quot;http://wordpress.org/export/1.1/&quot;
&gt;
&lt;!--RSS版本号和名字空间的扩展，以上为固定内容--&gt;

&lt;channel&gt;
	&lt;wp:wxr_version&gt;1.1&lt;/wp:wxr_version&gt;
	&lt;!--WXR格式版本号--&gt;

	&lt;item&gt;&lt;!--页面或者日志内容，每个为一个item--&gt;
		&lt;title&gt;Title test&lt;/title&gt;
		&lt;!--标题--&gt;
		&lt;content:encoded&gt;&lt; ![CDATA[Content_test]]&gt;&lt;/content:encoded&gt;
		&lt;!--这里是正文内容--&gt;
		&lt;wp:post_id&gt;1&lt;/wp:post_id&gt;
		&lt;!--页面或日志的序号，两者使用同一序列--&gt;
		&lt;wp:post_date&gt;2002-12-21 07:59:59&lt;/wp:post_date&gt;
		&lt;!--发表时间--&gt;
		&lt;wp:comment_status&gt;open&lt;/wp:comment_status&gt;
		&lt;!--评论开启情况，open / closed--&gt;
		&lt;wp:status&gt;publish&lt;/wp:status&gt;
		&lt;!--页面或日志状态，publish / draft / pending / private--&gt;
		&lt;wp:post_type&gt;post&lt;/wp:post_type&gt;
		&lt;!--文章类型，post / page--&gt;
		&lt;wp:is_sticky&gt;0&lt;/wp:is_sticky&gt;
		&lt;!--文章是否置顶，0 / 1--&gt;

		&lt;category domain=&quot;post_tag&quot; nicename=&quot;tag_test&quot;&gt;&lt; ![CDATA[Tag Test]]&gt;&lt;/category&gt;
		&lt;category domain=&quot;category&quot; nicename=&quot;category_test&quot;&gt;&lt; ![CDATA[Category Test]]&gt;&lt;/category&gt;
		&lt;!--
			日志或页面的标签和分类，可多个
			domain：标签对应post_tag，分类对应category
			nicename：对应标签或分类的URL友好名称
			&lt;![CDATA[]]&gt;：标签或分类的显示名称
		--&gt;

		&lt;wp:comment&gt;&lt;!--评论，可多个--&gt;
			&lt;wp:comment_id&gt;1&lt;/wp:comment_id&gt;
			&lt;!--自增序号，评论专用--&gt;
			&lt;wp:comment_author&gt;&lt; ![CDATA[anonymous]]&gt;&lt;/wp:comment_author&gt;
			&lt;!--评论者用户名--&gt;
			&lt;wp:comment_date&gt;2012-12-21 07:59:59&lt;/wp:comment_date&gt;
			&lt;!--评论时间--&gt;
			&lt;wp:comment_content&gt;&lt; ![CDATA[Content of Comment]]&gt;&lt;/wp:comment_content&gt;
			&lt;!--评论内容--&gt;
			&lt;wp:comment_approved&gt;1&lt;/wp:comment_approved&gt;
			&lt;!--评论是否被允许--&gt;
			&lt;wp:comment_parent&gt;0&lt;/wp:comment_parent&gt;
			&lt;!--父评论，指定所回复的评论--&gt;
		&lt;/wp:comment&gt;
	&lt;/item&gt;
&lt;/channel&gt;
&lt;/rss&gt;
</pre>

<p><a href="http://feedads.g.doubleclick.net/~a/ym_z7-GfQSEsT5-hg0TxSjL0bO0/0/da"><img src="http://feedads.g.doubleclick.net/~a/ym_z7-GfQSEsT5-hg0TxSjL0bO0/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/ym_z7-GfQSEsT5-hg0TxSjL0bO0/1/da"><img src="http://feedads.g.doubleclick.net/~a/ym_z7-GfQSEsT5-hg0TxSjL0bO0/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/huxuan?a=C3zbPJX1N5s:rDIwvnQ-zpo:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/huxuan?i=C3zbPJX1N5s:rDIwvnQ-zpo:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/huxuan/~4/C3zbPJX1N5s" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://huxuan.org/20110624/simplify-wordpress-extended-rss-wxr-file-format/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://huxuan.org/20110624/simplify-wordpress-extended-rss-wxr-file-format/</feedburner:origLink></item>
		<item>
		<title>WordPress eXtended Rss (WXR)文件格式解析</title>
		<link>http://feedproxy.google.com/~r/huxuan/~3/gk6ysxKmUSo/</link>
		<comments>http://huxuan.org/20110622/analysis-of-wordpress-extended-rss-wxr-file/#comments</comments>
		<pubDate>Tue, 21 Jun 2011 17:45:37 +0000</pubDate>
		<dc:creator>Shane.Hu</dc:creator>
				<category><![CDATA[IT水手]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[rss]]></category>
		<category><![CDATA[Sina2WordPress]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[WXR]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://blog.huxuan.org/?p=1051</guid>
		<description><![CDATA[Sina2WordPress的第一步——解析WXR文件格式 WXR是Wordpress eXtended Rss的缩写，是WordPress针对博客信息特意设定的格式，它最大的优点是兼容性好，包含信息丰富 通过参照导出的文件，初步找到一个完备集（见下方代码），经测试在WP无任何内容情况下无信息缺漏错误现象 下方代码已经尽可能的注释了所有可能的标签和属性，并且由于一些标签和属性与Sina2WordPress关系不大，故未深究 &#60; ?xml version=&#34;1.0&#34; encoding=&#34;UTF-8&#34; ?&#62; &#60;rss version=&#34;2.0&#34; xmlns:excerpt=&#34;http://wordpress.org/export/1.1/excerpt/&#34; xmlns:content=&#34;http://purl.org/rss/1.0/modules/content/&#34; xmlns:wfw=&#34;http://wellformedweb.org/CommentAPI/&#34; xmlns:dc=&#34;http://purl.org/dc/elements/1.1/&#34; xmlns:wp=&#34;http://wordpress.org/export/1.1/&#34; &#62; &#60;!--RSS版本号和名字空间的扩展，以上为固定内容--&#62; &#60;channel&#62; &#60;title&#62;Blog Title&#60;/title&#62; &#60;!--博客的标题--&#62; &#60;link&#62;http://blog.example.com&#60;/link&#62; &#60;!--博客的链接--&#62; &#60;description&#62;Blog Description&#60;/description&#62; &#60;!--博客的说明/副标题--&#62; &#60;pubdate&#62;Dec, 20 Jun 2012 23:59:59 +0000&#60;/pubdate&#62; &#60;!--WXR文件生成时间--&#62; &#60;language&#62;en&#60;/language&#62; &#60;!--博客的语言，en / zh-cn--&#62; &#8230; <a href="http://huxuan.org/20110622/analysis-of-wordpress-extended-rss-wxr-file/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Sina2WordPress的第一步——解析WXR文件格式</p>
<p>WXR是Wordpress eXtended Rss的缩写，是WordPress针对博客信息特意设定的格式，它最大的优点是兼容性好，包含信息丰富</p>
<p>通过参照导出的文件，初步找到一个完备集（见下方代码），经测试在WP无任何内容情况下无信息缺漏错误现象</p>
<p>下方代码已经尽可能的注释了所有可能的标签和属性，并且由于一些标签和属性与Sina2WordPress关系不大，故未深究</p>
<pre>
&lt; ?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; ?&gt;

&lt;rss version=&quot;2.0&quot;
	xmlns:excerpt=&quot;http://wordpress.org/export/1.1/excerpt/&quot;
	xmlns:content=&quot;http://purl.org/rss/1.0/modules/content/&quot;
	xmlns:wfw=&quot;http://wellformedweb.org/CommentAPI/&quot;
	xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot;
	xmlns:wp=&quot;http://wordpress.org/export/1.1/&quot;
&gt;
&lt;!--RSS版本号和名字空间的扩展，以上为固定内容--&gt;

&lt;channel&gt;
	&lt;title&gt;Blog Title&lt;/title&gt;
	&lt;!--博客的标题--&gt;
	&lt;link&gt;http://blog.example.com&lt;/link&gt;
	&lt;!--博客的链接--&gt;
	&lt;description&gt;Blog Description&lt;/description&gt;
	&lt;!--博客的说明/副标题--&gt;
	&lt;pubdate&gt;Dec, 20 Jun 2012 23:59:59 +0000&lt;/pubdate&gt;
	&lt;!--WXR文件生成时间--&gt;
	&lt;language&gt;en&lt;/language&gt;
	&lt;!--博客的语言，en / zh-cn--&gt;
	&lt;wp:wxr_version&gt;1.1&lt;/wp:wxr_version&gt;
	&lt;!--WXR格式版本号--&gt;
	&lt;wp:base_site_url&gt;http://example.com&lt;/wp:base_site_url&gt;
	&lt;!--网站根目录地址--&gt;
	&lt;wp:base_blog_url&gt;http://blog.example.com&lt;/wp:base_blog_url&gt;
	&lt;!--博客根目录地址--&gt;

	&lt;wp:author&gt;&lt;wp:author_id&gt;1&lt;/wp:author_id&gt;&lt;wp:author_login&gt;admin_test&lt;/wp:author_login&gt;&lt;wp:author_email&gt;admin@example.org&lt;/wp:author_email&gt;&lt;wp:author_display_name&gt;&lt; ![CDATA[AdMin test]]&gt;&lt;/wp:author_display_name&gt;&lt;wp:author_first_name&gt;&lt; ![CDATA[AdMin]]&gt;&lt;/wp:author_first_name&gt;&lt;wp:author_last_name&gt;&lt; ![CDATA[test]]&gt;&lt;/wp:author_last_name&gt;&lt;/wp:author&gt;
	&lt;!--
		作者列表，可多个
		wp:author_id：自增序号
		wp:author_login：用户名
		wp:author_email：邮箱
		wp:author_display_name：显示的作者名称
		wp:author_first_name、wp:author_last_name：如字面意，可为空，但需有&lt;![CDATA[]]&gt;
		P.S.&lt; ![CDATA[**]]&gt;可以理解成强制文本转换，保留文本中所有字符，以避免非法字符对XML文件的影响（后文不再赘述）
	--&gt;

	&lt;wp:category&gt;&lt;wp:term_id&gt;1&lt;/wp:term_id&gt;&lt;wp:category_nicename&gt;category_test&lt;/wp:category_nicename&gt;&lt;wp:category_parent&gt;&lt;/wp:category_parent&gt;&lt;wp:cat_name&gt;&lt; ![CDATA[分类测试]]&gt;&lt;/wp:cat_name&gt;&lt;/wp:category&gt;
	&lt;!--
		分类列表，可多个
		wp:term_id：自增序号，且分类和标签用的是同一个
		wp:category_nicename：URL友好名称，作为相关URL的一部分
		wp:category_parent：父分类，无即为空
		wp:cat_name：显示的分类名称
	--&gt;

	&lt;wp:tag&gt;&lt;wp:term_id&gt;2&lt;/wp:term_id&gt;&lt;wp:tag_slug&gt;tag_test&lt;/wp:tag_slug&gt;&lt;wp:tag_name&gt;&lt; ![CDATA[标签测试]]&gt;&lt;/wp:tag_name&gt;&lt;/wp:tag&gt;
	&lt;!--
		标签列表，可多个
		wp:term_id：自增序号，与标签使用同一个序列
		wp:tag_slug：URL友好名称，作为相关URL的一部分
		wp:tag_name：显示的标签名称
	--&gt;

	&lt;generator&gt;http://wordpress.org/?v=3.1.3&lt;/generator&gt;&lt;!--WXR文件生成工具的标识--&gt;

	&lt;item&gt;&lt;!--页面或者日志内容，每个为一个item--&gt;
		&lt;title&gt;Title&lt;/title&gt;
		&lt;!--标题--&gt;
		&lt;link&gt;http://blog.example.com/title/&lt;/link&gt;
		&lt;!--URL地址--&gt;
		&lt;pubdate&gt;Thu, 15 Apr 2010 23:20:03 +0000&lt;/pubdate&gt;
		&lt;!--发布时间--&gt;
		&lt;dc:creator&gt;admin&lt;/dc:creator&gt;
		&lt;!--文章作者--&gt;
		&lt;guid isPermaLink=&quot;false&quot;&gt;http://blog.example.com/?page_id=1&lt;/guid&gt;
		&lt;!--
			GUID 意为 Global Unique IDentification，即全局唯一标识
			isPermaLink=&quot;false&quot; 指示该地址非合法URL地址的属性
		--&gt;
		&lt;description&gt;&lt;/description&gt;
		&lt;content:encoded&gt;&lt; ![CDATA[Content_test_1]]&gt;&lt;/content:encoded&gt;
		&lt;!--这里是正文内容--&gt;
		&lt;excerpt:encoded&gt;&lt; ![CDATA[]]&gt;&lt;/excerpt:encoded&gt;
		&lt;!--文章摘录，供RSS/Atom使用，一般为空--&gt;
		&lt;wp:post_id&gt;2&lt;/wp:post_id&gt;
		&lt;!--页面或日志的序号，两者使用同一序列--&gt;
		&lt;wp:post_date&gt;2012-12-21 07:59:5&lt;/wp:post_date&gt;
		&lt;!--发表时间--&gt;
		&lt;wp:post_date_gmt&gt;2010-12-20 23:59:59&lt;/wp:post_date_gmt&gt;
		&lt;!--发表时间（GMT）--&gt;
		&lt;wp:comment_status&gt;open&lt;/wp:comment_status&gt;
		&lt;!--评论开启情况，open / closed--&gt;
		&lt;wp:ping_status&gt;closed&lt;/wp:ping_status&gt;
		&lt;!--Ping开启情况，open / closed--&gt;
		&lt;wp:post_name&gt;blog_title&lt;/wp:post_name&gt;
		&lt;!--URL友好的名称--&gt;
		&lt;wp:status&gt;publish&lt;/wp:status&gt;
		&lt;!--页面或日志状态，publish / draft / pending / private--&gt;
		&lt;wp:post_parent&gt;0&lt;/wp:post_parent&gt;
		&lt;!--只用于页面，指示父页面的id--&gt;
		&lt;wp:menu_order&gt;0&lt;/wp:menu_order&gt;
		&lt;!--只用与页面，作为导航时的排序权值--&gt;
		&lt;wp:post_type&gt;post&lt;/wp:post_type&gt;
		&lt;!--文章类型，post / page--&gt;
		&lt;wp:post_password&gt;&lt;/wp:post_password&gt;
		&lt;!--文章是否加密--&gt;
		&lt;wp:is_sticky&gt;0&lt;/wp:is_sticky&gt;
		&lt;!--文章是否置顶，0 / 1--&gt;

		&lt;category domain=&quot;post_tag&quot; nicename=&quot;tag_test&quot;&gt;&lt; ![CDATA[Tag Test]]&gt;&lt;/category&gt;
		&lt;category domain=&quot;category&quot; nicename=&quot;category_test&quot;&gt;&lt; ![CDATA[Category]]&gt;&lt;/category&gt;
		&lt;!--
			日志或页面的标签和分类，可多个
			domain：标签对应post_tag，分类对应category
			nicename：对应标签或分类的URL友好名称
			&lt;![CDATA[]]&gt;：标签或分类的显示名称
		--&gt;

		&lt;wp:postmeta&gt;&lt;!--日志或页面的元数据，可多个--&gt;
			&lt;wp:meta_key&gt;_edit_last&lt;/wp:meta_key&gt;
			&lt;!--元数据的关键字--&gt;
			&lt;wp:meta_value&gt;&lt; ![CDATA[1]]&gt;&lt;/wp:meta_value&gt;
			&lt;!--元数据对应关键字的值--&gt;
		&lt;/wp:postmeta&gt;

		&lt;wp:comment&gt;&lt;!--评论，可多个--&gt;
			&lt;wp:comment_id&gt;1&lt;/wp:comment_id&gt;
			&lt;!--自增序号，评论专用--&gt;
			&lt;wp:comment_author&gt;&lt; ![CDATA[anonymous]]&gt;&lt;/wp:comment_author&gt;&gt;
			&lt;!--评论者用户名--&gt;
			&lt;wp:comment_author_email&gt;anonymous@anonymous.com&lt;/wp:comment_author_email&gt;
			&lt;!--评论者邮箱--&gt;
			&lt;wp:comment_author_url&gt;http://blog.anonymous.com&lt;/wp:comment_author_url&gt;
			&lt;!--评论者链接--&gt;
			&lt;wp:comment_author_ip&gt;8.8.8.8&lt;/wp:comment_author_ip&gt;
			&lt;!--评论者IP--&gt;
			&lt;wp:comment_date&gt;2012-12-21 07:59:59&lt;/wp:comment_date&gt;
			&lt;!--评论时间--&gt;
			&lt;wp:comment_date_gmt&gt;2012-12-20 23:59:59&lt;/wp:comment_date_gmt&gt;
			&lt;!--评论时间（GMT）--&gt;
			&lt;wp:comment_content&gt;&lt; ![CDATA[Content of Comment]]&gt;&lt;/wp:comment_content&gt;
			&lt;!--评论内容--&gt;
			&lt;wp:comment_approved&gt;1&lt;/wp:comment_approved&gt;
			&lt;!--评论是否被允许--&gt;
			&lt;wp:comment_type&gt;&lt;/wp:comment_type&gt;
			&lt;!--评论类型，空白表示一般评论，否则会标记位pingback--&gt;
			&lt;wp:comment_parent&gt;0&lt;/wp:comment_parent&gt;
			&lt;!--父评论，指定所回复的评论--&gt;
			&lt;wp:comment_user_id&gt;0&lt;/wp:comment_user_id&gt;
			&lt;!--如果评论者为注册用户，这里会记录用户ID--&gt;
		&lt;/wp:comment&gt;
	&lt;/item&gt;
&lt;/channel&gt;
&lt;/rss&gt;
</pre>
<p><strong>参考：</strong><a href="http://ipggi.wordpress.com/2011/03/16/the-wordpress-extended-rss-wxr-exportimport-xml-document-format-decoded-and-explained/">http://ipggi.wordpress.com/2011/03/16/the-wordpress-extended-rss-wxr-exportimport-xml-document-format-decoded-and-explained/</a></p>

<p><a href="http://feedads.g.doubleclick.net/~a/0bEOmShl6NjzprBxf93TAHWpFYA/0/da"><img src="http://feedads.g.doubleclick.net/~a/0bEOmShl6NjzprBxf93TAHWpFYA/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/0bEOmShl6NjzprBxf93TAHWpFYA/1/da"><img src="http://feedads.g.doubleclick.net/~a/0bEOmShl6NjzprBxf93TAHWpFYA/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/huxuan?a=gk6ysxKmUSo:S6fdP1vl2h0:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/huxuan?i=gk6ysxKmUSo:S6fdP1vl2h0:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/huxuan/~4/gk6ysxKmUSo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://huxuan.org/20110622/analysis-of-wordpress-extended-rss-wxr-file/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://huxuan.org/20110622/analysis-of-wordpress-extended-rss-wxr-file/</feedburner:origLink></item>
		<item>
		<title>一点闲思</title>
		<link>http://feedproxy.google.com/~r/huxuan/~3/zSdbG_HyAf4/</link>
		<comments>http://huxuan.org/20110616/some-thoughts/#comments</comments>
		<pubDate>Thu, 16 Jun 2011 08:42:59 +0000</pubDate>
		<dc:creator>Shane.Hu</dc:creator>
				<category><![CDATA[碎碎念]]></category>
		<category><![CDATA[Family]]></category>
		<category><![CDATA[Love]]></category>
		<category><![CDATA[struggle]]></category>

		<guid isPermaLink="false">http://blog.huxuan.org/?p=1049</guid>
		<description><![CDATA[前几天终于把入党的材料准备差不多了，电子文档暂且忽略不计，光是必须抄写的8000字以上自传和8篇1500字以上思想汇报就不知道让我的手抽筋多少次了，不过还好都结束了，看着整整78页的方格纸，心中多少有点小成就感，就当是党组织的考验吧，你懂的。 抄写的内容是提前准备好打印出来的，所以抄写时脑子基本处于空闲状态，也挺好，难得有一个这样的时间可以用来思考，可以想一想平时忙忙碌碌或者荒废时光时未曾想过的。 前几天那帮搞G的基友，终于小解放了一下，记得那天遇到逆铭同学，我戏称他们开始蛋疼了，却被反击说我已经蛋疼很久了～囧，想想也是，至少最近不是很紧张，准备北大夏令营材料，准备入党材料，实验室的项目说实话没有100%的用心，混了两篇Rank 2会议的第三还是第四作者，折腾ArchLinux，折腾Nook Color，看了几本还不错的书，其他就是看动漫之类的了，虽然一直没太闲，确实都不是太紧急的事，常常还一边听着音乐一边忙活，着实有点懈怠。 眼看大三就要结束了，很水很水很水很水，水的我已经无话可说了，期末就两门。软件工程过程，基本文科性质，与实际开发相距甚远，基本没听什么，考试开卷，不过是必修课，所以还是要好好应对的。科技写作与沟通技巧，说白了就是英语口语，选修课，外教Bryce人很好，上课也基本认真参与了，应该没什么问题。 最近写简历，写个人陈述时才发现自己虽然确实做了一点东西，但是大多数都是大作业，写完就扔，没有推广到用户，更没能长期坚持维护。最近想写点可以长期维护的东西，其实想了好久了，但一直拖沓着，今天先列一部分在这里，权当对自己的鞭策： 1、Sina2WordPress，大致就是研究一下WordPress eXtended Rss(WXR) 文件格式，用Python的Beautiful Soup抓Sina Blog的网页，再做一下转换，没什么难度，主要是要文件和网页格式的研究可能有点繁琐。 2、LaTeX Resume Templete，用了挺长时间的LaTeX了，前段时间写简历的时候也用了网上的一个模板，写了一个不错的样稿，但是总觉得用人家的模板受各种约束，想设计一个扩展性比较好的，另外就是希望能和LaTeX2HTML搭配起来，便于生成HTML页面挂在个人网站上，可能写模板的时候需要注意的东西比较多。 3、FanFou for Android，用了一段时间的性浪微博，但是还是受不了那么多冗余信息和Spam，就算用的人再多我也不去了，以后只用于同步好了。饭否还是很有爱的，但是一直没有一个很好的Android客户端，有一个安能饭否是从一个开源Twitter客户端上改的，所以感觉还是有点怪怪的，想自己写个，正好熟悉一下从未接触过的API方面开发。 4、Douban for Android，也是比较疑惑怎么到现在都没有很好用的Android客户端，有一个aDouban用起来感觉太不爽了。之前也想了挺长时间，除了API的使用，主要就是感觉豆瓣上的功能太多，不知道一时怎么下手了，担心折腾的太乱太复杂。先从需求开始做吧。 P.S. Doit.im确实是个不错的东东，可以按照项目列to-do list，要好好利用。 除了自己，还想了很多家人和爱人的事。奶奶的病在慢慢调养，爸爸妈妈也在为着更好的生活打拼着，我现在能做的除了做好自己的事，也就是经常打个电话回去问问了。一切都还好吧，希望我保送北大的事情能有惊无险的实现，如果实在不行，乘早找个喜欢的工作也不错。和她呢，总不知道怎么说才好，分分合合，吵吵闹闹，因为异地，常常把问题无限放大，不过还好，最后都好了，对彼此有了更多了解，也显得更加亲密了，就这样也已经折腾了2年3个月零2天了，有时候回头想想真觉得挺不容易的，不过冥冥中有一种感觉快要熬出头了，坚信彼此一起走下去吧，以后都要好好的，我深爱着的你。]]></description>
			<content:encoded><![CDATA[<p>前几天终于把入党的材料准备差不多了，电子文档暂且忽略不计，光是必须抄写的8000字以上自传和8篇1500字以上思想汇报就不知道让我的手抽筋多少次了，不过还好都结束了，看着整整78页的方格纸，心中多少有点小成就感，就当是党组织的考验吧，你懂的。</p>
<p>抄写的内容是提前准备好打印出来的，所以抄写时脑子基本处于空闲状态，也挺好，难得有一个这样的时间可以用来思考，可以想一想平时忙忙碌碌或者荒废时光时未曾想过的。</p>
<p>前几天那帮搞G的基友，终于小解放了一下，记得那天遇到逆铭同学，我戏称他们开始蛋疼了，却被反击说我已经蛋疼很久了～囧，想想也是，至少最近不是很紧张，准备北大夏令营材料，准备入党材料，实验室的项目说实话没有100%的用心，混了两篇Rank 2会议的第三还是第四作者，折腾ArchLinux，折腾Nook Color，看了几本还不错的书，其他就是看动漫之类的了，虽然一直没太闲，确实都不是太紧急的事，常常还一边听着音乐一边忙活，着实有点懈怠。</p>
<p>眼看大三就要结束了，很水很水很水很水，水的我已经无话可说了，期末就两门。软件工程过程，基本文科性质，与实际开发相距甚远，基本没听什么，考试开卷，不过是必修课，所以还是要好好应对的。科技写作与沟通技巧，说白了就是英语口语，选修课，外教Bryce人很好，上课也基本认真参与了，应该没什么问题。</p>
<p>最近写简历，写个人陈述时才发现自己虽然确实做了一点东西，但是大多数都是大作业，写完就扔，没有推广到用户，更没能长期坚持维护。最近想写点可以长期维护的东西，其实想了好久了，但一直拖沓着，今天先列一部分在这里，权当对自己的鞭策：</p>
<p>1、Sina2WordPress，大致就是研究一下WordPress eXtended Rss(WXR) 文件格式，用Python的Beautiful Soup抓Sina Blog的网页，再做一下转换，没什么难度，主要是要文件和网页格式的研究可能有点繁琐。</p>
<p>2、LaTeX Resume Templete，用了挺长时间的LaTeX了，前段时间写简历的时候也用了网上的一个模板，写了一个不错的样稿，但是总觉得用人家的模板受各种约束，想设计一个扩展性比较好的，另外就是希望能和LaTeX2HTML搭配起来，便于生成HTML页面挂在个人网站上，可能写模板的时候需要注意的东西比较多。</p>
<p>3、FanFou for Android，用了一段时间的性浪微博，但是还是受不了那么多冗余信息和Spam，就算用的人再多我也不去了，以后只用于同步好了。饭否还是很有爱的，但是一直没有一个很好的Android客户端，有一个安能饭否是从一个开源Twitter客户端上改的，所以感觉还是有点怪怪的，想自己写个，正好熟悉一下从未接触过的API方面开发。</p>
<p>4、Douban for Android，也是比较疑惑怎么到现在都没有很好用的Android客户端，有一个aDouban用起来感觉太不爽了。之前也想了挺长时间，除了API的使用，主要就是感觉豆瓣上的功能太多，不知道一时怎么下手了，担心折腾的太乱太复杂。先从需求开始做吧。</p>
<p>P.S. Doit.im确实是个不错的东东，可以按照项目列to-do list，要好好利用。</p>
<p>除了自己，还想了很多家人和爱人的事。奶奶的病在慢慢调养，爸爸妈妈也在为着更好的生活打拼着，我现在能做的除了做好自己的事，也就是经常打个电话回去问问了。一切都还好吧，希望我保送北大的事情能有惊无险的实现，如果实在不行，乘早找个喜欢的工作也不错。和她呢，总不知道怎么说才好，分分合合，吵吵闹闹，因为异地，常常把问题无限放大，不过还好，最后都好了，对彼此有了更多了解，也显得更加亲密了，就这样也已经折腾了2年3个月零2天了，有时候回头想想真觉得挺不容易的，不过冥冥中有一种感觉快要熬出头了，坚信彼此一起走下去吧，以后都要好好的，我深爱着的你。</p>

<p><a href="http://feedads.g.doubleclick.net/~a/GxuA1yglxlbruP6pwLMsixQNhqs/0/da"><img src="http://feedads.g.doubleclick.net/~a/GxuA1yglxlbruP6pwLMsixQNhqs/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/GxuA1yglxlbruP6pwLMsixQNhqs/1/da"><img src="http://feedads.g.doubleclick.net/~a/GxuA1yglxlbruP6pwLMsixQNhqs/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/huxuan?a=zSdbG_HyAf4:Wg9nd7a03P8:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/huxuan?i=zSdbG_HyAf4:Wg9nd7a03P8:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/huxuan/~4/zSdbG_HyAf4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://huxuan.org/20110616/some-thoughts/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		<feedburner:origLink>http://huxuan.org/20110616/some-thoughts/</feedburner:origLink></item>
		<item>
		<title>VPS杂记</title>
		<link>http://feedproxy.google.com/~r/huxuan/~3/dOb7cYkquv0/</link>
		<comments>http://huxuan.org/20110603/vps-notes/#comments</comments>
		<pubDate>Fri, 03 Jun 2011 09:29:10 +0000</pubDate>
		<dc:creator>Shane.Hu</dc:creator>
				<category><![CDATA[IT水手]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[lnmp]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[phpmyadmin]]></category>
		<category><![CDATA[Shell]]></category>
		<category><![CDATA[vps]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://blog.huxuan.org/?p=1048</guid>
		<description><![CDATA[入手VPS好久了，用的是LNMP架构，在Evernote中压了一些笔记，一一贴出来示众～ 安装lnmp 注：版本可能有更新，0.7为截至2011/06/03的最新版 wget http://soft.vpser.net/lnmp/lnmp0.7.tar.gz tar zxvf lnmp0.7.tar.gz cd lnmp0.7/ ./ubuntu.sh 创建虚拟主机 /root/vhost.sh root账户的使用 平时使用普通账户登录，需要使用root权限的时候用su命令，然后再输入root命令，使用完root权限之后可以用ctrl+D退出权限，继续使用普通账户权限，这样可以防止权限的混乱 安装OpenVPN wget http://vpsnoc.com/scripts/debian-openvpn.sh chmod +x debian-openvpn.sh ./debian-openvpn.sh 按照提示安装完成后下载keys.tgz，将其解压到OpenVPN安装目录下的config子目录，然后启动OpenVPN就可以使用了 wordpress的rewrite问题 默认的规则有点小问题，替换为以下的即可： if (!-e $request_filename) { rewrite (.*) /index.php; } WordPress文件权限 chown -R www.www /blog]]></description>
			<content:encoded><![CDATA[<p>入手VPS好久了，用的是LNMP架构，在Evernote中压了一些笔记，一一贴出来示众～</p>
<p><strong>安装lnmp</strong><br />
注：版本可能有更新，0.7为截至2011/06/03的最新版</p>
<pre>
wget http://soft.vpser.net/lnmp/lnmp0.7.tar.gz
tar zxvf lnmp0.7.tar.gz
cd lnmp0.7/
./ubuntu.sh
</pre>
<p><strong>创建虚拟主机</strong></p>
<pre>
/root/vhost.sh
</pre>
<p><strong>root账户的使用 </strong><br />
平时使用普通账户登录，需要使用root权限的时候用su命令，然后再输入root命令，使用完root权限之后可以用ctrl+D退出权限，继续使用普通账户权限，这样可以防止权限的混乱</p>
<p><strong>安装OpenVPN</strong></p>
<pre>
wget http://vpsnoc.com/scripts/debian-openvpn.sh
chmod +x debian-openvpn.sh
./debian-openvpn.sh
</pre>
<p>按照提示安装完成后下载keys.tgz，将其解压到OpenVPN安装目录下的config子目录，然后启动OpenVPN就可以使用了</p>
<p><strong>wordpress的rewrite问题</strong><br />
默认的规则有点小问题，替换为以下的即可：</p>
<pre>
if  (!-e $request_filename)
{
    rewrite (.*) /index.php;
}
</pre>
<p><strong>WordPress文件权限</strong></p>
<pre>
chown -R www.www /blog
</pre>

<p><a href="http://feedads.g.doubleclick.net/~a/65GYcx42PdtfADEAJbY9qKiC-d4/0/da"><img src="http://feedads.g.doubleclick.net/~a/65GYcx42PdtfADEAJbY9qKiC-d4/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/65GYcx42PdtfADEAJbY9qKiC-d4/1/da"><img src="http://feedads.g.doubleclick.net/~a/65GYcx42PdtfADEAJbY9qKiC-d4/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/huxuan?a=dOb7cYkquv0:mh3SDf9qF0s:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/huxuan?i=dOb7cYkquv0:mh3SDf9qF0s:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/huxuan/~4/dOb7cYkquv0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://huxuan.org/20110603/vps-notes/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://huxuan.org/20110603/vps-notes/</feedburner:origLink></item>
	</channel>
</rss><!-- Dynamic page generated in 0.411 seconds. --><!-- Cached page generated by WP-Super-Cache on 2012-01-28 21:02:42 -->

