<?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>很错 &#187; api</title>
	<atom:link href="http://www.hencuo.com/archives/tag/api/feed" rel="self" type="application/rss+xml" />
	<link>http://www.hencuo.com</link>
	<description>Android,Php,Wordpress</description>
	<lastBuildDate>Wed, 11 Jan 2012 12:41:39 +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.hencuo.com/archives/201</link>
		<comments>http://www.hencuo.com/archives/201#comments</comments>
		<pubDate>Tue, 20 Dec 2011 12:14:42 +0000</pubDate>
		<dc:creator>半醒</dc:creator>
				<category><![CDATA[技术类]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[upyun]]></category>

		<guid isPermaLink="false">http://www.hencuo.com/?p=201</guid>
		<description><![CDATA[之前申请又拍云的测试帐号，只需要注册后等待审核就可以，需要注意的是填写的手机号是正确的，因为最后是人工打电话审核的。 这个插件作用是在撰写日志的时候，将日志的配图上传到你的又拍云空间里。多数blog使用的虚拟空间速度并不是很快，如果再加上图片的话，页面加载速度会慢很多。 又拍云提供有PHP版的sdk，这里只用到写文件的部分。具体说明下次再写，下面图片就是上传到又拍云的。]]></description>
			<content:encoded><![CDATA[<p>之前申请又拍云的测试帐号，只需要注册后等待审核就可以，需要注意的是填写的手机号是正确的，因为最后是人工打电话审核的。</p>
<p>这个插件作用是在撰写日志的时候，将日志的配图上传到你的又拍云空间里。多数blog使用的虚拟空间速度并不是很快，如果再加上图片的话，页面加载速度会慢很多。</p>
<p>又拍云提供有<a href="https://www.upyun.com/intro/custom.php" target="_blank">PHP版的sdk</a>，这里只用到写文件的部分。具体说明下次再写，下面图片就是上传到又拍云的。</p>
<p><img src="http://hencuo.b0.upaiyun.com/2011/1324382831.jpg" alt="汤唯" width="395" height="593" border="0" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.hencuo.com/archives/201/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Apigee搭建自己的免费API</title>
		<link>http://www.hencuo.com/archives/47</link>
		<comments>http://www.hencuo.com/archives/47#comments</comments>
		<pubDate>Sat, 03 Jul 2010 04:13:39 +0000</pubDate>
		<dc:creator>半醒</dc:creator>
				<category><![CDATA[技术类]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[apigee]]></category>
		<category><![CDATA[twip]]></category>
		<category><![CDATA[Twitter]]></category>

		<guid isPermaLink="false">http://www.hencuo.com/archives/47</guid>
		<description><![CDATA[使用Apigee可直接创建自己的API，无需其他任何条件。而是要Twip之类搭建API，需要服务器支持，购买的有些空间更是不让搭建twitter api的。 打开首页http://apigee.com/，进入Sign Up，填写注册信息，如图： 所有项都是必填，最后将 I agree to the Terms of Use and Privacy Policy前面打勾。点击注册后需要去邮箱里激活帐号，所以要填写自己正确的邮箱地址。邮箱确认后就可以使用自己的帐号登录，添加API了。 填写API名称和简介： 测试API连接是否成功，这里用twitter的api地址，http://api.twitter.com。点击Connect进行测试，会提示是否成功。 [adsense] [adsense]填写API SubDomain，即以后在填写API时使用的地址： 创建成功，API信息：4cac1137]]></description>
			<content:encoded><![CDATA[<p>使用Apigee可直接创建自己的API，无需其他任何条件。而是要Twip之类搭建API，需要服务器支持，购买的有些空间更是不让搭建twitter api的。</p>
<p>打开首页<a href="http://apigee.com/" target="_blank">http://apigee.com/</a>，进入Sign Up，填写注册信息，如图：</p>
<p><span id="more-47"></span></p>
<p><a href="http://free.imgbed.com/pp/2981278053.jpg" target="_blank"><img style="display: block; float: none; margin-left: auto; margin-right: auto; border-width: 0px;" title="点击查看大图" src="http://free.imgbed.com/pp/2981278053.jpg" border="0" alt="点击查看大图" width="580" height="694" /></a>所有项都是必填，最后将 I agree to the Terms of Use and Privacy Policy前面打勾。点击注册后需要去邮箱里激活帐号，所以要填写自己正确的邮箱地址。邮箱确认后就可以使用自己的帐号登录，添加API了。</p>
<p><a href="http://free.imgbed.com/pp/298127tjt.jpg" target="_blank"><img style="display: block; float: none; margin-left: auto; margin-right: auto; border-width: 0px;" src="http://free.imgbed.com/pp/298127tjt.jpg" border="0" alt="" width="580" height="351" /></a>填写API名称和简介：</p>
<p><a href="http://free.imgbed.com/pp/298127lrl.jpg" target="_blank"><img style="display: block; float: none; margin-left: auto; margin-right: auto; border-width: 0px;" title="点击查看大图" src="http://free.imgbed.com/pp/298127lrl.jpg" border="0" alt="点击查看大图" width="580" height="373" /></a></p>
<p>测试API连接是否成功，这里用twitter的api地址，<a href="http://api.twitter.com" target="_blank">http://api.twitter.com</a>。点击Connect进行测试，会提示是否成功。<br />
[adsense]<br />
<a href="http://free.imgbed.com/pp/298127bob.jpg" target="_blank"><img style="display: block; float: none; margin-left: auto; margin-right: auto; border-width: 0px;" title="点击查看大图" src="http://free.imgbed.com/pp/298127bob.jpg" border="0" alt="点击查看大图" width="580" height="545" /></a></p>
<p>[adsense]填写API SubDomain，即以后在填写API时使用的地址：</p>
<p><img style="display: block; float: none; margin-left: auto; margin-right: auto; border-width: 0px;" title="点击查看大图" src="http://free.imgbed.com/pp/298127zwz.jpg" border="0" alt="点击查看大图" width="580" height="351" /> 创建成功，API信息：<span style="color: #ffffff;">4cac1137</span></p>
<p><a href="http://free.imgbed.com/pp/298127cnc.jpg" target="_blank"><img style="display: block; float: none; margin-left: auto; margin-right: auto; border-width: 0px;" title="点击查看大图" src="http://free.imgbed.com/pp/298127cnc.jpg" border="0" alt="点击查看大图" width="580" height="524" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.hencuo.com/archives/47/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Twitter命令大全</title>
		<link>http://www.hencuo.com/archives/29</link>
		<comments>http://www.hencuo.com/archives/29#comments</comments>
		<pubDate>Mon, 23 Nov 2009 11:53:45 +0000</pubDate>
		<dc:creator>半醒</dc:creator>
				<category><![CDATA[技术类]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[Twitter]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.hencuo.com/archives/29</guid>
		<description><![CDATA[对使用电脑的用户来说，接触最多的应该是windows下的DOS命令，比如：ipconfig、ping、ftp等。而对于twitter来说，是一个网页版服务，但TA同样也可以使用一些命令来完成一些常用的操作，你可以通过手机、twitter上的更新框以及其他第三方客户端上来使用下面的所有命令。 打开或关闭twitter（主要是针对一些手机twitter通知，并不是关闭twitter服务） ON：打开所有来自twitter的手机通知 OFF, STOP, QUIT, End, Cancel, Arret or Unsubscribe：关闭所有来自twitter的手机通知 ON username：打开针对某一用户的手机通知，比如：ON cooiky OFF username：对一特定用户，关闭来自twitter上关于TA的手机通知，比如：OFF cooiky FOLLOW username：直接follow指定的用户，同时接收twitter发送的关于TA的信息到你的手机，比如：FOLLOW cooiky（大陆用户无法使用twitter的手机服务） LEAVE username：unfollow指定的用户，同时不接收twitter发送的关于TA的信息，比如：LEAVE cooiky 更多有趣的命令：friends、favourites、stats！ 对于twitter，并不是只有上面的简单的ON、OFF命令，使用下面的命令，你可以发送站内信、将一条推加为收藏、甚至提醒某个人更新twitter（如果你想知道TA正在做什么）等等。 @ 格式：@cooiky&#160; twitter的使用技巧 功能：以公开留言的形式回复别人，所有的用户都能看到。 D 格式：D cooiky&#160; 我刚写了关于twitter的使用技巧 功能：以站内留言的形式回复别人，仅有对方才能看到(右侧的Direct Messages)，注意D和用户名之间有个空格键。 WHOIS 格式：whois cooiky 功能：查询用户资料。注意这个功能只支持WEB输入(会在页面顶部显示相关信息)。 GET 格式：get cooiky 功能：查询用户最近的更新。注意这个功能只支持WEB输入(会在页面顶部显示相关信息)。 NUDGE 格式：nudge cooiky 功能：提醒用户进行更新。注意这个功能只支持WEB输入(会在页面顶部显示相关信息)。 FAV 格式：fav cooiky 功能：收藏用户最近的更新。 STATS 格式：stats 功能：查询关注自己和自己关注的用户数，及BIO。注意这个功能只支持WEB输入(会在页面顶部显示相关信息)，插件和IM无效。 INVITE [...]]]></description>
			<content:encoded><![CDATA[<p>对使用电脑的用户来说，接触最多的应该是windows下的DOS命令，比如：ipconfig、ping、ftp等。而对于twitter来说，是一个网页版服务，但TA同样也可以使用一些命令来完成一些常用的操作，你可以通过手机、twitter上的更新框以及其他第三方客户端上来使用下面的所有命令。</p>
<p>打开或关闭twitter（主要是针对一些手机twitter通知，并不是关闭twitter服务）</p>
<ul>
<p><strong>ON</strong>：打开所有来自twitter的手机通知       <br /><strong>OFF, STOP, QUIT, End, Cancel, Arret or Unsubscribe</strong>：关闭所有来自twitter的手机通知       <br /><strong>ON username</strong>：打开针对某一用户的手机通知，比如：ON cooiky       <br /><strong>OFF username</strong>：对一特定用户，关闭来自twitter上关于TA的手机通知，比如：OFF cooiky       <br /><strong>FOLLOW username</strong>：直接follow指定的用户，同时接收twitter发送的关于TA的信息到你的手机，比如：FOLLOW cooiky（大陆用户无法使用twitter的手机服务）       <br />LEAVE username</strong>：unfollow指定的用户，同时不接收twitter发送的关于TA的信息，比如：LEAVE cooiky </p>
</ul>
<p>更多有趣的命令：friends、favourites、stats！</p>
<p> <span id="more-29"></span>
<p>对于twitter，并不是只有上面的简单的ON、OFF命令，使用下面的命令，你可以发送站内信、将一条推加为收藏、甚至提醒某个人更新twitter（如果你想知道TA正在做什么）等等。</p>
<ul>
<p><strong>@</strong>       <br />格式：@cooiky&#160; twitter的使用技巧       <br />功能：以公开留言的形式回复别人，所有的用户都能看到。       <br /><strong>D</strong>       <br />格式：D cooiky&#160; 我刚写了关于twitter的使用技巧       <br />功能：以站内留言的形式回复别人，仅有对方才能看到(右侧的Direct Messages)，注意D和用户名之间有个空格键。       <br /><strong>WHOIS</strong>       <br />格式：whois cooiky       <br />功能：查询用户资料。注意这个功能只支持WEB输入(会在页面顶部显示相关信息)。       <br /><strong>GET</strong>       <br />格式：get cooiky       <br />功能：查询用户最近的更新。注意这个功能只支持WEB输入(会在页面顶部显示相关信息)。       <br /><strong>NUDGE</strong>       <br />格式：nudge cooiky       <br />功能：提醒用户进行更新。注意这个功能只支持WEB输入(会在页面顶部显示相关信息)。       <br /><strong>FAV</strong>       <br />格式：fav cooiky       <br />功能：收藏用户最近的更新。       <br /><strong>STATS</strong>       <br />格式：stats       <br />功能：查询关注自己和自己关注的用户数，及BIO。注意这个功能只支持WEB输入(会在页面顶部显示相关信息)，插件和IM无效。       <br /><strong>INVITE</strong>       <br />格式：invite 13812345678       <br />功能：短信发送邀请。       <br />注：twitter还提供其他一些手机更新的功能，但twitter手机服务并不支持大陆用户。       <br /><strong>RT</strong>       <br />格式：rt @cooiky 我刚写了关于twitter的使用技巧       <br />功能：转载用户的更新。       <br />注：RT是retweet的缩写，是目前应用最频繁的快捷命令，官方目前已正式推出RT功能，并提供retweet api，但目前对于多少客户端来说并不支持。       <br /><strong>VIA</strong>       <br />格式：rt @cooiky via@cooiky 我刚写了关于twitter的使用技巧       <br />功能：转载用户的更新。       <br />注：与RT搭配使用，区别在于RT跟的是转载的用户，VIA跟的是原创的用户。 </p>
</ul>
<p>其他一些你需要知道的信息</p>
<ol>
<li>在手机上使用ON/OFF username命令，只对使用该命令的客户端有效,而对WEB方式并无作用 </li>
<li>follow/leave username效果同ON/OFF </li>
<li>在手机上使用follow命令第一次follow一个新用户，在你的WEB上同样会follow该用户 </li>
<li>你只能通过访问用户的profile页面才能绝对的unfollow该用户，而使用off, leave, stop, and quit这些命令，则只能在发出该命令的设备上取消用户更新提醒 </li>
</ol>
<p>原文：<a href="http://twitter.zendesk.com/forums/59008/entries/14020" rel="nofollow" target="_blank">http://twitter.zendesk.com/forums/59008/entries/14020</a></p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>1、<a href="http://www.hencuo.com/archives/13" target="_blank">Twitter第三方应用（PC客户端版）</a></p>
<p>2、<a href="http://www.hencuo.com/archives/10" target="_blank">Twitter第三方应用（网页版）</a></p>
<p>3、修改本地hosts的方式访问twitter，请关注豆瓣上的twitter小组</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hencuo.com/archives/29/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>[Android] Zuosa API获取一条指定的消息</title>
		<link>http://www.hencuo.com/archives/23</link>
		<comments>http://www.hencuo.com/archives/23#comments</comments>
		<pubDate>Sun, 08 Nov 2009 08:09:29 +0000</pubDate>
		<dc:creator>半醒</dc:creator>
				<category><![CDATA[技术类]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[zuosa]]></category>

		<guid isPermaLink="false">http://www.hencuo.com/archives/23</guid>
		<description><![CDATA[Google于2007年11月5日推出基于Linux平台的开源手机操作系统，即Android。同时发布android软件开发工具包SDK（2.0版已发布），便于手机应用程序开发者进行基于android的手机应用程序开发。 下面代码是根据zuosa提供的API，希望开发出基于android平台上的zuosa客户端，路漫漫其修远兮。程序主要是对api返回数据的处理，这里是json格式数据。对于JAVA，有很多第三方的程序包可以很方便的处理json数据。其实在android SDK中同样提供了json数据处理方法，只不过可能会稍显的有些复杂。 public String process() { String myString=&#34;&#34;; try{ //获取指定id为34230762的消息 URL url = new URL(&#34;http://api.zuosa.com/statuses/show.json?id=34230762&#34;); //使用HttpURLConnection类建立连接 HttpURLConnection conn = (HttpURLConnection)url.openConnection(); conn.connect(); StringBuffer totalXML = new StringBuffer(&#34;&#34;); if (conn.getResponseCode() == HttpURLConnection.HTTP_OK) { InputStream httpStream = conn.getInputStream(); BufferedReader bufferReader = new BufferedReader(new InputStreamReader(httpStream)); String currLine = &#34;&#34;; while((currLine=bufferReader.readLine())!=null) totalXML.append(currLine); } myString=totalXML.toString(); //关闭连接 conn.disconnect(); //myString为String格式，需要先转换为JSONObject便于处理 JSONObject jsonObject=new [...]]]></description>
			<content:encoded><![CDATA[<p>Google于2007年11月5日推出基于Linux平台的开源手机操作系统，即Android。同时发布android软件开发工具包SDK（2.0版已发布），便于手机应用程序开发者进行基于android的手机应用程序开发。</p>
<p>下面代码是根据zuosa提供的API，希望开发出基于android平台上的zuosa客户端，路漫漫其修远兮。程序主要是对api返回数据的处理，这里是json格式数据。对于JAVA，有很多第三方的程序包可以很方便的处理json数据。其实在android SDK中同样提供了json数据处理方法，只不过可能会稍显的有些复杂。</p>
<p> <span id="more-23"></span>
<pre><font size="2"><span style="color: #0000ff">public</span> String process() {
  String myString=&quot;<span style="color: #8b0000"></span>&quot;;
  <span style="color: #0000ff">try</span>{</font></pre>
<pre><font size="2">     //获取指定id为34230762的消息
     URL url = <span style="color: #0000ff">new</span> URL(&quot;<span style="color: #8b0000">http://api.zuosa.com/statuses/show.json?id=34230762</span>&quot;);</font></pre>
<pre><font size="2">     //使用HttpURLConnection类建立连接
     HttpURLConnection conn = (HttpURLConnection)url.openConnection();
     conn.connect();
     StringBuffer totalXML = <span style="color: #0000ff">new</span> StringBuffer(&quot;<span style="color: #8b0000"></span>&quot;);
     <span style="color: #0000ff">if</span> (conn.getResponseCode() == HttpURLConnection.HTTP_OK) {
        InputStream httpStream = conn.getInputStream();
        BufferedReader bufferReader = <span style="color: #0000ff">new</span> BufferedReader(<span style="color: #0000ff">new</span> InputStreamReader(httpStream));
        String currLine = &quot;<span style="color: #8b0000"></span>&quot;;
        <span style="color: #0000ff">while</span>((currLine=bufferReader.readLine())!=<span style="color: #0000ff">null</span>)
                    totalXML.append(currLine);
     }
     myString=totalXML.toString(); </font></pre>
<pre><font size="2">     //关闭连接
     conn.disconnect();</font></pre>
<pre><font size="2">     //myString为String格式，需要先转换为JSONObject便于处理
     JSONObject jsonObject=<span style="color: #0000ff">new</span> JSONObject(myString);
     myString=&quot;<span style="color: #8b0000"></span>&quot;;</font></pre>
<pre><font size="2">     //keys方法：返回json格式数据中的所有key
     Iterator l=jsonObject.keys();</font></pre>
<pre><font size="2">     //readjson读取对应key的值，即zuosa消息内容
     myString=readjson(l, jsonObject);
 } <span style="color: #0000ff">catch</span> (JSONException e) {
     myString=e.getMessage();
 } <span style="color: #0000ff">catch</span>(Exception ee) {
     myString=ee.getMessage();
 }
    <span style="color: #0000ff">return</span> myString;
}</font></pre>
<pre><font size="2"><span style="color: #0000ff">public</span> String readjson(Iterator l, JSONObject jsonObject) {
   String myString=&quot;<span style="color: #8b0000"></span>&quot;;
   Iterator templ=<span style="color: #0000ff">null</span>;
   <span style="color: #0000ff">try</span> {</font></pre>
<pre><font size="2">    //遍历整个json数据
    <span style="color: #0000ff">for</span> (; l.hasNext(); ) {
    	String ll=(String)l.next();</font></pre>
<pre><font size="2">        //因为在zuosa返回的json数据是多维，这里先判断对应key的值是否是json格式数据
    	JSONObject tempJson=jsonObject.optJSONObject(ll);</font></pre>
<pre><font size="2">        //如果对应key的值不存在或者不是一个jsonobject，则返回null
    	<span style="color: #0000ff">if</span> (tempJson!=<span style="color: #0000ff">null</span>) {
    	    templ=tempJson.keys();</font></pre>
<pre><font size="2">            //这里应该可以使用递归，可一直不成功
    	    myString+=readjson2(templ, tempJson);
    	} <span style="color: #0000ff">else</span> {</font></pre>
<pre><font size="2">            //格式化时间，按年月日 时分秒 形式显示
    	    <span style="color: #0000ff">if</span> (ll.equals(&quot;<span style="color: #8b0000">created_at</span>&quot;)) {</font></pre>
<pre><font size="2">                SimpleDateFormat sdf = new SimpleDateFormat(&quot;yyyy年MM月dd日 HH时mm分ss秒&quot;);
    		Date date=new Date();</font></pre>
<pre><font size="2">                //以key:value显示数据&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; myString+=ll+&quot;:&quot;+sdf.format(date);</font></pre>
<pre><font size="2">    	    }<span style="color: #0000ff">else</span>
    		myString+=ll+&quot;<span style="color: #8b0000">:</span>&quot;+jsonObject.getString(ll);
    	}

  }
  }<span style="color: #0000ff">catch</span> (JSONException e) {
     myString=e.getMessage();
  } <span style="color: #0000ff">catch</span>(Exception ee) {
     myString=ee.getMessage();
  }
  <span style="color: #0000ff">return</span> myString;
}</font></pre>
<pre><font size="2">//readjson2跟上面的readjson基本一样。
<span style="color: #0000ff">public</span> String readjson2(Iterator l, JSONObject jsonObject) {
   String myString=&quot;<span style="color: #8b0000"></span>&quot;;
   Iterator templ=<span style="color: #0000ff">null</span>;
   <span style="color: #0000ff">try</span> {
    <span style="color: #0000ff">for</span> (; l.hasNext(); ) {
    	String ll=(String)l.next();
    	myString+=ll+&quot;<span style="color: #8b0000">:</span>&quot;+jsonObject.getString(ll);
    }
   }<span style="color: #0000ff">catch</span> (JSONException e) {
        myString=e.getMessage();
   } <span style="color: #0000ff">catch</span>(Exception ee) {
        myString=ee.getMessage();
   }
  <span style="color: #0000ff">return</span> myString;
}</font></pre>
<p>模拟器上执行结果：</p>
<p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" border="0" src="http://i35.tinypic.com/21eyuew.jpg" width="340" height="274" /></p>
<p>至于在layout中如何布局，就是另外的活儿了。本程序是用的android sdk 1.6</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hencuo.com/archives/23/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>

