<?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>Voland.com.cn &#187; wordpress</title>
	<atom:link href="http://www.voland.com.cn/tag/wordpress/feed" rel="self" type="application/rss+xml" />
	<link>http://www.voland.com.cn</link>
	<description>人生百年,诸事记之</description>
	<lastBuildDate>Thu, 02 Feb 2012 23:09:02 +0000</lastBuildDate>
	<language>zh</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>用java程序向wordpress发布文章</title>
		<link>http://www.voland.com.cn/java-program-to-wordpress-with-articles-published</link>
		<comments>http://www.voland.com.cn/java-program-to-wordpress-with-articles-published#comments</comments>
		<pubDate>Thu, 13 May 2010 01:42:52 +0000</pubDate>
		<dc:creator>Nortan</dc:creator>
				<category><![CDATA[人生百味]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[XML-RPC]]></category>

		<guid isPermaLink="false">http://www.voland.com.cn/?p=486</guid>
		<description><![CDATA[java向wordpress发布文章也成？当然成！不仅能发布文章，读写都不成问题，还很方便，这些便利得益于XML-RPC协议。WordPress提供了XML-RPC API使得第三方的可以与之通信来发布和修改博客。我们也可以使用这个接口做一些工作，例如：在网站首页显示最新的博客、在博客之外的页面上发表博客文章、把博客与其他内容管理系统结合等。 一、开启XML-RPC支持 WordPress的XML-RPC协议默认是未开启的，需要到管理后台的“设置&#8211;>撰写”里的“远程发布”给XML-RPC打上勾。其说明文字为：启用 WordPress，Movable Type，MetaWeblog和Blogger 的 XML-RPC发布协议。 二、API接口选择 WordPress提供了对Blogger API、metaWeblog API、Movable Type API以及其自身的WordPress API的支持。其中WordPress API最为丰富，提供了包括操作评论文章在内的各种各样的支持。Blogger API功能较少，基本上淘汰不用了；而metaWeblog API提供了常用的接口且参数比较简洁，用得较多一些。所以我们以它作为例子。 三、例子代码 这个例子中，需要用到apache的XML-RPC项目包,大家可以到 apache 官方下载,使用这个例子，就可以与昨天的《通用文章采集器的设计与实现》结合，来生成自动发布的站点了，这个慎用哦，后果自负：） import java.net.URL; import java.util.HashMap; import java.util.Map; &#160; import org.apache.xmlrpc.client.XmlRpcClient; import org.apache.xmlrpc.client.XmlRpcClientConfigImpl; &#160; public class Test &#123; public static void post&#40;String title, String content&#41; &#123; try&#123; // Set up XML-RPC connection to server String [...]]]></description>
			<content:encoded><![CDATA[<p>java向wordpress发布文章也成？当然成！不仅能发布文章，读写都不成问题，还很方便，这些便利得益于XML-RPC协议。WordPress提供了XML-RPC API使得第三方的可以与之通信来发布和修改博客。我们也可以使用这个接口做一些工作，例如：在网站首页显示最新的博客、在博客之外的页面上发表博客文章、把博客与其他内容管理系统结合等。<span id="more-486"></span></p>
<p>一、开启XML-RPC支持</p>
<p>WordPress的XML-RPC协议默认是未开启的，需要到管理后台的“设置&#8211;>撰写”里的“远程发布”给XML-RPC打上勾。其说明文字为：启用 WordPress，Movable Type，MetaWeblog和Blogger 的 XML-RPC发布协议。</p>
<p>二、API接口选择</p>
<p>WordPress提供了对Blogger API、metaWeblog API、Movable Type API以及其自身的WordPress API的支持。其中WordPress API最为丰富，提供了包括操作评论文章在内的各种各样的支持。Blogger API功能较少，基本上淘汰不用了；而metaWeblog API提供了常用的接口且参数比较简洁，用得较多一些。所以我们以它作为例子。</p>
<p>三、例子代码</p>
<p>这个例子中，需要用到apache的XML-RPC项目包,大家可以到 <a href="http://ws.apache.org/xmlrpc/download.html" target="_blank">apache 官方</a>下载,使用这个例子，就可以与昨天的《<a href="http://www.voland.com.cn/common-article-collection-design-and-implementation">通用文章采集器的设计与实现</a>》结合，来生成自动发布的站点了，这个慎用哦，后果自负：）</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.net.URL</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.util.HashMap</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.util.Map</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.xmlrpc.client.XmlRpcClient</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.xmlrpc.client.XmlRpcClientConfigImpl</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Test <span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> post<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> title, <span style="color: #003399;">String</span> content<span style="color: #009900;">&#41;</span>  <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">try</span><span style="color: #009900;">&#123;</span>
			<span style="color: #666666; font-style: italic;">// Set up XML-RPC connection to server</span>
                        <span style="color: #003399;">String</span> domain <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;www.extbi.com&quot;</span><span style="color: #339933;">;</span><span style="color: #666666; font-style: italic;">//你网站的域名</span>
			XmlRpcClientConfigImpl config <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> XmlRpcClientConfigImpl<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			config.<span style="color: #006633;">setServerURL</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">URL</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;http://&quot;</span><span style="color: #339933;">+</span>domain<span style="color: #339933;">+</span><span style="color: #0000ff;">&quot;/xmlrpc.php&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			XmlRpcClient client <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> XmlRpcClient<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			client.<span style="color: #006633;">setConfig</span><span style="color: #009900;">&#40;</span>config<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
			<span style="color: #666666; font-style: italic;">// Set up parameters required by newPost method</span>
			<span style="color: #003399;">Map</span> post <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">HashMap</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			post.<span style="color: #006633;">put</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;title&quot;</span>, title<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #666666; font-style: italic;">//标题</span>
			post.<span style="color: #006633;">put</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;mt_keywords&quot;</span>, <span style="color: #0000ff;">&quot;标签,标签2,标签3&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #666666; font-style: italic;">//标签</span>
			<span style="color: #003399;">Object</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> categories <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Object</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> <span style="color: #0000ff;">&quot;服饰&quot;</span>,<span style="color: #0000ff;">&quot;数码&quot;</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span><span style="color: #666666; font-style: italic;">//分类</span>
			post.<span style="color: #006633;">put</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;categories&quot;</span>, categories<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			post.<span style="color: #006633;">put</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;description&quot;</span>, content<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #666666; font-style: italic;">//内容</span>
			<span style="color: #003399;">Object</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> params <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Object</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> <span style="color: #0000ff;">&quot;1&quot;</span>, <span style="color: #0000ff;">&quot;用户名&quot;</span>, <span style="color: #0000ff;">&quot;密码&quot;</span>, post,
					<span style="color: #003399;">Boolean</span>.<span style="color: #000066; font-weight: bold;">TRUE</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
			<span style="color: #666666; font-style: italic;">// Call newPost</span>
			<span style="color: #003399;">String</span> result <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span><span style="color: #009900;">&#41;</span> client.<span style="color: #006633;">execute</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;metaWeblog.newPost&quot;</span>, params<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot; Created with blogid &quot;</span> <span style="color: #339933;">+</span> result<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span><span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">Exception</span> e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #666666; font-style: italic;">// TODO: handle exception</span>
                       <span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot; UnCreated &quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>四、畅想</p>
<p>博客有如此大强大，灵活，好用的接口 ，那为什么国内常用的CMS没有呢？做一个也花不了多少时间，当然，在实际的管理软件中，如CRM中，我建议也可以加入这样的接口，那与其它系统集成是多么爽的一件事情。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.voland.com.cn/java-program-to-wordpress-with-articles-published/feed</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>这个可以有！为wordpress上传图片增加水印</title>
		<link>http://www.voland.com.cn/watermark-your-uploaded-images</link>
		<comments>http://www.voland.com.cn/watermark-your-uploaded-images#comments</comments>
		<pubDate>Wed, 14 Apr 2010 02:00:06 +0000</pubDate>
		<dc:creator>Nortan</dc:creator>
				<category><![CDATA[常用]]></category>
		<category><![CDATA[Watermark]]></category>
		<category><![CDATA[Watermark RELOADED]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[水印]]></category>

		<guid isPermaLink="false">http://www.voland.com.cn/?p=342</guid>
		<description><![CDATA[发表博客文章时，我们有时希望上传图片并增加水印,但目前网站主要介绍super-image-plugin与Watermark，他们有着致命的弱点，这里介绍使用Watermark RELOADED]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.voland.com.cn/watermark-your-uploaded-images"><img class="aligncenter size-full wp-image-356" title="小沈阳" src="http://www.voland.com.cn/wp-content/uploads/2010/04/xiaoshengyang.jpg" alt="小沈阳，有还是没有" width="500" height="220" /></a></p>
<p>发表博客文章时，增加一张相关的图片，不仅提升视觉效果，还能帮助读者理解文章的意思，甚至有时会起到意想不到的效果，这个以盲点套利和主题投机的<a title="花荣的博客" href="http://blog.sina.com.cn/u/1282871591" target="_blank">花荣的博客</a>为代表，有时我们希望发表的图片打上自己的标记，告诉大伙这是你网站上的，这就需要有一套图片水印插件，我的网站基于wordpress，这里仅介绍怎么为你的wordpress博客上传图片时增加水印。</p>
<p>网上介绍相关插件的文章比较多，但同出一辙，无非就是介绍super-image-plugin与Watermark，这里我就不多表，主要原因是他们两个都需要修改程序的原代码，以后升级不方便，本人使用的是<a title="watermark reloaded site" href="http://randomplac.es/wordpress-plugins/watermark-reloaded/" target="_blank">Watermark RELOADED</a>。先看看官方的说明：<span id="more-342"></span></p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;">This plugin allows you to watermark your uploaded images.
<span style="color: #202020;">You</span> can create watermark with different fonts and apply it
to different image sizes <span style="color: #009900;">&#40;</span>thumbnail<span style="color: #339933;">,</span> medium<span style="color: #339933;">,</span> large<span style="color: #339933;">,</span> fullsize<span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
positioning it anywhere on the image.</pre></div></div>

<p><strong>推荐本插件的原因有如下几点：</strong></p>
<p>1、不需要修改wordpress的主体程序，直接安装并激活就可以使用</p>
<p>2、配置及使用简单，可以自定义字体，文字颜色等等</p>
<p>3、作者更新比较快，已知列入他的开始计划的功能有：</p>
<ol>
<li>Analyze option of watermarking aditional image sizes</li>
<li>Watermark pictures with image</li>
<li>Analyze option to disable watermark for certain pictures</li>
</ol>
<p><strong>Watermark RELOADED的安装</strong></p>
<ol>
<li>下载本插件，并解压后上传‘watermark-reloaded/’到‘/wp-content/plugins/’目录</li>
<li>通过wordpress后台管理的”插件菜单”来找到watermark reloaded并激活它</li>
<li>设置watermark reloaded并使用它</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.voland.com.cn/watermark-your-uploaded-images/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>禁用WordPress的文章修订功能</title>
		<link>http://www.voland.com.cn/disable-wordpress-changes-feature-articles</link>
		<comments>http://www.voland.com.cn/disable-wordpress-changes-feature-articles#comments</comments>
		<pubDate>Thu, 28 Jan 2010 09:45:37 +0000</pubDate>
		<dc:creator>Nortan</dc:creator>
				<category><![CDATA[常用]]></category>
		<category><![CDATA[post revisions]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[禁用文章修订]]></category>

		<guid isPermaLink="false">http://127.0.0.1/~nortan/?p=181</guid>
		<description><![CDATA[从2.6起,wordpress编辑文章时,增加了文章版本保存的功能,这个功能对性能有一定的影响,不想要这个功能可以修改wp-config.php文章。]]></description>
			<content:encoded><![CDATA[<p>好像从2.6起,wordpress编辑文章时,增加了文章版本保存的功能,这个功能对性能有一定的影响,不想要这个功能的同学可以在 wp-config.php 中添加以下代码：</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'WP_POST_REVISIONS'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>关于 WP_POST_REVISIONS 这个变量的详细设置为：</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">true</span>（默认）或者 <span style="color: #339933;">-</span><span style="color: #0000dd;">1</span>：保存所有修订版本
<span style="color: #000000; font-weight: bold;">false</span> 或者 <span style="color: #0000dd;">0</span>：不保存任何版本（除了自动保存的版本）
大于 <span style="color: #0000dd;">0</span> 的整数 n：保存 n 个修订版本（<span style="color: #339933;">+</span><span style="color: #0000dd;">1</span> 只保存自动保存版本），旧的版本将被删除。</pre></div></div>

<p>建议大家还是设置1或者2,总有不小心被删除的时候呀</p>
]]></content:encoded>
			<wfw:commentRss>http://www.voland.com.cn/disable-wordpress-changes-feature-articles/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

