<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	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/"
	>

<channel>
	<title>老甘的可读区</title>
	<atom:link href="http://www.cngump.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.cngump.com</link>
	<description>developer,geek,java,python,mac,linux</description>
	<lastBuildDate>Fri, 16 Dec 2011 01:53:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>为WordPress添加分享到社交网站按钮(非插件)</title>
		<link>http://www.cngump.com/2011/03/wordpress_share_to/</link>
		<comments>http://www.cngump.com/2011/03/wordpress_share_to/#comments</comments>
		<pubDate>Tue, 15 Mar 2011 04:57:21 +0000</pubDate>
		<dc:creator>cngump</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[分享]]></category>

		<guid isPermaLink="false">http://www.cngump.com/?p=49</guid>
		<description><![CDATA[在使用WordPress过程中，有时为了方便阅读着分享到主流的社交网站或微薄，需要在文章旁边添加一些分享按钮。如下图，本文就介绍简单对WordPress做些简单修改来完成对分享的支持. 相关代码和图片打包下载: shareto 修改步骤如下： 零 : 把下载好的images下面的图标文件上传到你的空间中。 一 ：把写好的 shareto.php 上传到你的主题目录，然后把其中的图片的地址改为你自己上传的 如: /wp-content/themes/你的主题名字/ 下面: &#60;?php //shareto.php $permalink = urlencode(get_permalink($post-&#62;ID)); $title = urlencode($post-&#62;post_title); $title = str_replace('+','%20',$title); $sitename="cngump"; $domainurl="http://www.cngump.com/"; //把下面的图片url替换成自己的空间的url ?&#62; &#60;h3&#62;我要分享到：&#60;/h3&#62; &#60;ul&#62; &#60;li&#62;&#60;a title="新浪微博" rel="nofollow" href="http://v.t.sina.com.cn/share/share.php?url=&#60;?php echo $permalink; ?&#62;&#38;title=&#60;?php echo $title; ?&#62;&#38;content=utf-8" target="_blank"&#62;&#60;img title="新浪微博" src="http://www.cngump.com/images/bookmark/sina.png" alt="新浪微博" /&#62;&#60;/a&#62;&#60;/li&#62; &#60;li&#62;&#60;a title="腾讯微博" rel="nofollow" target="_blank" href="javascript:window.open('http://v.t.qq.com/share/share.php?title='+'&#60;?php echo $title; ?&#62;'+encodeURIComponent(document.title)+'&#38;url='+encodeURIComponent('&#60;?php echo [...]]]></description>
			<content:encoded><![CDATA[<p>在使用WordPress过程中，有时为了方便阅读着分享到主流的社交网站或微薄，需要在文章旁边添加一些分享按钮。如下图，本文就介绍简单对WordPress做些简单修改来完成对分享的支持.</p>
<p><a href="http://www.cngump.com/wp-content/uploads/2011/03/屏幕快照-2011-03-15-下午12.33.50.png"><img class="alignnone size-full wp-image-51" title="屏幕快照 2011-03-15 下午12.33.50" src="http://www.cngump.com/wp-content/uploads/2011/03/屏幕快照-2011-03-15-下午12.33.50.png" alt="" width="604" height="97" /></a></p>
<p>相关代码和图片打包下载:</p>
<p><a href="http://www.cngump.com/wp-content/uploads/2011/03/shareto.zip">shareto</a></p>
<p>修改步骤如下：</p>
<p>零 : 把下载好的images下面的图标文件上传到你的空间中。</p>
<p>一 ：把写好的 shareto.php 上传到你的主题目录，然后把其中的图片的地址改为你自己上传的 如: /wp-content/themes/你的主题名字/ 下面:</p>
<pre class="brush:php">&lt;?php
//shareto.php
$permalink = urlencode(get_permalink($post-&gt;ID));
$title = urlencode($post-&gt;post_title);
$title = str_replace('+','%20',$title);

$sitename="cngump";
$domainurl="http://www.cngump.com/";
//把下面的图片url替换成自己的空间的url
?&gt;

&lt;h3&gt;我要分享到：&lt;/h3&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;a title="新浪微博" rel="nofollow" href="http://v.t.sina.com.cn/share/share.php?url=&lt;?php echo $permalink; ?&gt;&amp;title=&lt;?php echo $title; ?&gt;&amp;content=utf-8" target="_blank"&gt;&lt;img title="新浪微博" src="http://www.cngump.com/images/bookmark/sina.png" alt="新浪微博" /&gt;&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a title="腾讯微博" rel="nofollow" target="_blank" href="javascript:window.open('http://v.t.qq.com/share/share.php?title='+'&lt;?php echo $title; ?&gt;'+encodeURIComponent(document.title)+'&amp;url='+encodeURIComponent('&lt;?php echo $permalink; ?&gt;')+'&amp;jumpback=2&amp;noui=1','favit','width=700,height=546,left=50,top=50,toolbar=no,menubar=no,location=no,scrollbars=yes,status=yes,resizable=yes');void(0)" &gt;
		&lt;img title="腾讯微博" src="http://www.cngump.com/images/bookmark/tqq.png" alt="腾讯微博" /&gt;
	&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a title="网易微博" rel="nofollow" href="http://t.163.com/share/popup?sourceUrl=&lt;?php echo $domainurl; ?&gt;&amp;source=&lt;?php echo $sitename; ?&gt;&amp;title=&lt;?php echo $title; ?&gt;&amp;link=%20&lt;?php echo $permalink; ?&gt;&amp;content=utf-8" target="_blank"&gt;&lt;img title="网易微博" src="http://www.cngump.com/images/bookmark/t163.png" alt="网易微博" /&gt;&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a title="鲜果" rel="nofollow" href="http://www.xianguo.com/service/submitdigg/?link=&lt;?php echo $permalink; ?&gt;&amp;title=&lt;?php echo $title; ?&gt;&amp;content=utf-8" target="_blank"&gt;&lt;img title="鲜果" src="http://www.cngump.com/images/bookmark/xianguo.png" alt="鲜果" /&gt;&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a title="九点" rel="nofollow" href="http://www.douban.com/recommend/?url=&lt;?php echo $permalink; ?&gt;&amp;title=&lt;?php echo $title; ?&gt;&amp;n=1" target="_blank"&gt;&lt;img title="九点" src="http://www.cngump.com/images/bookmark/douban9.png" alt="九点" /&gt;&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a title="人人" rel="nofollow" href="http://share.renren.com/share/buttonshare.do?link=&lt;?php echo $permalink; ?&gt;&amp;title=&lt;?php echo $title; ?&gt;" target="_blank"&gt;&lt;img title="人人" src="http://www.cngump.com/images/bookmark/renren.png" alt="人人" /&gt;&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a title="抽屉" rel="nofollow" href="http://dig.chouti.com/digg.action?newsURL=&lt;?php echo $permalink; ?&gt;&amp;title=&lt;?php echo $title; ?&gt;&amp;content=utf-8" target="_blank"&gt;&lt;img title="抽屉" src="http://www.cngump.com/images/bookmark/chouti.png" alt="抽屉" /&gt;&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a title="百度搜藏" rel="nofollow" href="http://cang.baidu.com/do/add?it=&lt;?php echo $title; ?&gt;&amp;iu=&lt;?php echo $permalink; ?&gt;" target="_blank"&gt;&lt;img title="百度搜藏" src="http://www.cngump.com/images/bookmark/baidu.png" alt="百度搜藏" /&gt;&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a title="Follow5" rel="nofollow" href="http://www.follow5.com/f5/discuz/sharelogin.jsp?url=&lt;?php echo $permalink; ?&gt;&amp;title=&lt;?php echo $title; ?&gt;&amp;content=utf-8" target="_blank"&gt;&lt;img title="Follow5" src="http://www.cngump.com/images/bookmark/f5.png" alt="Follow5" /&gt;&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a title="Twitter" rel="nofollow" href="http://twitter.com/home?status=&lt;?php echo $title; ?&gt;%20-%20&lt;?php echo $permalink; ?&gt;" target="_blank"&gt;&lt;img title="Twitter" src="http://www.cngump.com/images/bookmark/twitter.png" alt="Twitter" /&gt;&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a title="Facebook" rel="nofollow" href="http://www.facebook.com/share.php?u=&lt;?php echo $permalink; ?&gt;&amp;t=&lt;?php echo $title; ?&gt;" target="_blank"&gt;&lt;img title="Facebook" src="http://www.cngump.com/images/bookmark/facebook.png" alt="Facebook" /&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</pre>
<p>根据你的图片路径在文中修改相应的img的url即可</p>
<p>二. 修改你的主题样式文件,在style.css最后加上以下样式，如：/wp-content/themes/你的主题名字/sytle.css</p>
<pre class="brush:css">/************************************************
*	shareto					     		    *
************************************************/
#share {
        -moz-border-radius:5px 5px 5px 5px;
        -webkit-border-radius: 5px;
        float:left;
}

#share li  {
        float:left;
        margin:6px 0 0 5px;
        padding:4px 0 4px 8px;
        list-style-type:none;
        background:none;
}
</pre>
<p>三.  修改单编日志页面的index.php（main index template），有的主题是single.php。把以下代码加到你想放的位置。</p>
<pre class="brush:php">&lt;div id="share"&gt;
&lt;?php include(TEMPLATEPATH."/shareto.php");?&gt;
&lt;/div&gt;</pre>
<p>九. 刷新文章页面看看效果和测试。</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cngump.com/2011/03/wordpress_share_to/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>用Python批量生成PyCon2011视频的下载地址</title>
		<link>http://www.cngump.com/2011/03/pycon2011/</link>
		<comments>http://www.cngump.com/2011/03/pycon2011/#comments</comments>
		<pubDate>Mon, 14 Mar 2011 10:58:37 +0000</pubDate>
		<dc:creator>cngump</dc:creator>
				<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.cngump.com/?p=35</guid>
		<description><![CDATA[#源代码 # url_blip_tv.py import re import urllib __author__ = 'cngump' #config rss_url="http://pycon.blip.tv/rss" #rss feed list html_file="pycon2011.html" #html file name #parse f = urllib.urlopen(rss_url) content=f.read() #regex PyCon2011's mp4 regex=r'http://blip.tv/file/get/Pycon\-PyCon2011(?P&#60;name&#62;.*?)\.mp4' reobj=re.compile(regex) html="&#60;html&#62;&#60;head&#62;&#60;title&#62;pycon2011&#60;/title&#62;&#60;/head&#62;&#60;body&#62;" url_list=[] for abc in reobj.finditer(content): print abc.group() url=abc.group() if(url not in url_list): url_list.append(url) html=html+"&#60;a href='{0}'&#62;{0}&#60;/a&#62;&#60;br&#62;\n".format(url) #write html=html+"&#60;/body&#62;&#60;/html&#62;" html_file = open(html_file, 'w') html_file.write(html); Python源代码打包下载 url_blip_tv.py linux或者mac用户使用命令批量下载： [...]]]></description>
			<content:encoded><![CDATA[<p>#源代码</p>
<pre class="brush:py"># url_blip_tv.py
import re
import urllib

__author__ = 'cngump'

#config
rss_url="http://pycon.blip.tv/rss"   #rss feed list
html_file="pycon2011.html"           #html file name

#parse
f = urllib.urlopen(rss_url)
content=f.read()

#regex PyCon2011's mp4
regex=r'http://blip.tv/file/get/Pycon\-PyCon2011(?P&lt;name&gt;.*?)\.mp4'
reobj=re.compile(regex)

html="&lt;html&gt;&lt;head&gt;&lt;title&gt;pycon2011&lt;/title&gt;&lt;/head&gt;&lt;body&gt;"
url_list=[]

for abc in reobj.finditer(content):
	print abc.group()
	url=abc.group()
	if(url not in url_list):
		url_list.append(url)
		html=html+"&lt;a href='{0}'&gt;{0}&lt;/a&gt;&lt;br&gt;\n".format(url)

#write
html=html+"&lt;/body&gt;&lt;/html&gt;"

html_file = open(html_file, 'w')
html_file.write(html);</pre>
<p>Python源代码打包下载<br />
<a href="http://www.cngump.com/wp-content/uploads/2011/03/url_blip_tv.py_.zip">url_blip_tv.py</a></p>
<p>linux或者mac用户使用命令批量下载：<br />
wget  &#8211;force-html -i pycon2011.html</p>
<p>widnows用户<br />
用浏览器打开 pycon2011.html 文件，然后用迅雷批量下载。</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cngump.com/2011/03/pycon2011/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Three20框架介绍</title>
		<link>http://www.cngump.com/2011/02/three20/</link>
		<comments>http://www.cngump.com/2011/02/three20/#comments</comments>
		<pubDate>Mon, 28 Feb 2011 00:47:48 +0000</pubDate>
		<dc:creator>cngump</dc:creator>
				<category><![CDATA[iOS]]></category>
		<category><![CDATA[ios]]></category>
		<category><![CDATA[three20]]></category>

		<guid isPermaLink="false">http://www.cngump.com/?p=25</guid>
		<description><![CDATA[Three20 &#160; View more presentations from Gump Law]]></description>
			<content:encoded><![CDATA[<div id="__ss_7075932" style="width: 425px;"><strong style="display: block; margin: 12px 0 4px;"><a target="_blank" title="Three20" href="http://www.slideshare.net/cngump/three20-7075932">Three20</a></strong> <object id="__sse7075932" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=trhee20-110226232240-phpapp02&amp;stripped_title=three20-7075932&amp;userName=cngump" /><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><embed type="application/x-shockwave-flash" width="425" height="355" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=trhee20-110226232240-phpapp02&amp;stripped_title=three20-7075932&amp;userName=cngump" allowfullscreen="true" allowscriptaccess="always" name="__sse7075932"></embed></object>&nbsp;</p>
<div style="padding: 5px 0 12px;">View more <a target="_blank" href="http://www.slideshare.net/">presentations</a> from <a target="_blank" href="http://www.slideshare.net/cngump">Gump Law</a></div>
</div>
<p><script src="http://b.scorecardresearch.com/beacon.js?c1=7&amp;c2=7400849&amp;c3=1&amp;c4=&amp;c5=&amp;c6="></script><br />
<script src="http://b.scorecardresearch.com/beacon.js?c1=7&amp;c2=7400849&amp;c3=1&amp;c4=&amp;c5=&amp;c6="></script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.cngump.com/2011/02/three20/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>珠三角沙龙 2010-12 数据专场的主题 &#8211; R语言简介</title>
		<link>http://www.cngump.com/2011/01/intr-r/</link>
		<comments>http://www.cngump.com/2011/01/intr-r/#comments</comments>
		<pubDate>Mon, 24 Jan 2011 14:43:53 +0000</pubDate>
		<dc:creator>cngump</dc:creator>
				<category><![CDATA[R]]></category>

		<guid isPermaLink="false">http://www.cngump.com/?p=22</guid>
		<description><![CDATA[R语言简介 View more presentations from Gump Law.]]></description>
			<content:encoded><![CDATA[<div id="__ss_5844355" style="width: 425px;"><strong><a target="_blank" title="R语言简介" href="http://www.slideshare.net/cngump/r-5844355">R语言简介</a></strong><object id="__sse5844355" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="355" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="src" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=r-101120084105-phpapp01&amp;stripped_title=r-5844355&amp;userName=cngump" /><param name="name" value="__sse5844355" /><param name="allowfullscreen" value="true" /><embed id="__sse5844355" type="application/x-shockwave-flash" width="425" height="355" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=r-101120084105-phpapp01&amp;stripped_title=r-5844355&amp;userName=cngump" name="__sse5844355" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<div style="padding: 5px 0 12px;">View more <a target="_blank" href="http://www.slideshare.net/">presentations</a> from <a target="_blank" href="http://www.slideshare.net/cngump">Gump Law</a>.</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.cngump.com/2011/01/intr-r/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>在珠三角沙龙的主题 </title>
		<link>http://www.cngump.com/2011/01/java-desktop-development/</link>
		<comments>http://www.cngump.com/2011/01/java-desktop-development/#comments</comments>
		<pubDate>Mon, 24 Jan 2011 14:19:21 +0000</pubDate>
		<dc:creator>cngump</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Desktop]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[开发]]></category>

		<guid isPermaLink="false">http://www.cngump.com/?p=18</guid>
		<description><![CDATA[Java桌面应用开发 View more presentations from Gump Law. 2011.01.23在珠三角小沙龙做的一个主题，由于那天主题太多，到了最后还有很多主题都没有讲，本打算就我的主题放到下一期去讲，但是一想大家对Java兴趣也不高，就用最快的速度过一遍就OK了，后来只用了大约5分钟就讲完了。话题没有太多具体的例子，只是从大局介绍了一下，希望对小白能有所帮助。]]></description>
			<content:encoded><![CDATA[<div id="__ss_6671941" style="width: 425px;"><strong style="display: block; margin: 12px 0 4px;"><a target="_blank" title="Java桌面应用开发" href="http://www.slideshare.net/cngump/java-6671941">Java桌面应用开发</a></strong><object id="__sse6671941" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="355" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="src" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=java-110123085547-phpapp02&amp;stripped_title=java-6671941&amp;userName=cngump" /><param name="name" value="__sse6671941" /><param name="allowfullscreen" value="true" /><embed id="__sse6671941" type="application/x-shockwave-flash" width="425" height="355" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=java-110123085547-phpapp02&amp;stripped_title=java-6671941&amp;userName=cngump" name="__sse6671941" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<div style="padding: 5px 0 12px;">View more <a target="_blank" href="http://www.slideshare.net/">presentations</a> from <a target="_blank" href="http://www.slideshare.net/cngump">Gump Law</a>.</div>
</div>
<p>2011.01.23在珠三角小沙龙做的一个主题，由于那天主题太多，到了最后还有很多主题都没有讲，本打算就我的主题放到下一期去讲，但是一想大家对Java兴趣也不高，就用最快的速度过一遍就OK了，后来只用了大约5分钟就讲完了。话题没有太多具体的例子，只是从大局介绍了一下，希望对小白能有所帮助。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cngump.com/2011/01/java-desktop-development/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>reboot &#8230;</title>
		<link>http://www.cngump.com/2011/01/reboot/</link>
		<comments>http://www.cngump.com/2011/01/reboot/#comments</comments>
		<pubDate>Mon, 24 Jan 2011 13:43:33 +0000</pubDate>
		<dc:creator>cngump</dc:creator>
				<category><![CDATA[心情]]></category>
		<category><![CDATA[cngump]]></category>

		<guid isPermaLink="false">http://www.cngump.com/?p=15</guid>
		<description><![CDATA[随着Google Calendar已经可以看到2011年，但是对于一个中国人来讲，春节没有过，还不是新年。现在离春节还有10天左右，最近忙了很多事，然后做了一个艰难的决定，决定重开Blog，虽然重开，之前一切也没有迁移了，连名字也有原来的 老甘Blog 改为 老甘的可读区。 虽然本人不好写作，但是为了为以后的生活和技术多做一些记录，决定以后把blog继续写下去。]]></description>
			<content:encoded><![CDATA[<p>随着Google Calendar已经可以看到2011年，但是对于一个中国人来讲，春节没有过，还不是新年。现在离春节还有10天左右，最近忙了很多事，然后做了一个艰难的决定，决定重开Blog，虽然重开，之前一切也没有迁移了，连名字也有原来的 老甘Blog 改为 老甘的可读区。 虽然本人不好写作，但是为了为以后的生活和技术多做一些记录，决定以后把blog继续写下去。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cngump.com/2011/01/reboot/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Hello world!</title>
		<link>http://www.cngump.com/2010/09/hello-world/</link>
		<comments>http://www.cngump.com/2010/09/hello-world/#comments</comments>
		<pubDate>Wed, 08 Sep 2010 06:43:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http:/?p=1</guid>
		<description><![CDATA[Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!]]></description>
			<content:encoded><![CDATA[<p>Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cngump.com/2010/09/hello-world/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

