<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><entry xmlns='http://www.w3.org/2005/Atom' xmlns:georss='http://www.georss.org/georss' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5480487.post-3431000252823448072</id><published>2009-09-08T00:02:00.020+08:00</published><updated>2009-09-09T00:20:17.674+08:00</updated><title type='text'>birdnest for twitter</title><content type='html'>说明: dreamhost share hosting不允许跑birdnest，会收到policy bot alert "user xxx running "python code.py xxx.xxx.xxx.xxx:xxxx " listening on port xxxx.  Network daemons are against our Terms of Service."，以下权当折腾实录，并无可操作性&lt;br /&gt;&lt;br /&gt;发现dreamhost上没办法直接跑&lt;a href="twip.googlecode.com/"&gt;twip&lt;/a&gt;，所以打起了&lt;a href="http://code.google.com/p/birdnest/"&gt;birdnest&lt;/a&gt;的主意，虽然dh自带的python版本只有2.3.5，不过很容易就可以diy出birdnest需要的环境&lt;br /&gt;&lt;a href="http://www.flickr.com/photos/kreep/3243977978/" title="national stadium by kreep, on Flickr"&gt;&lt;img src="http://farm4.static.flickr.com/3436/3243977978_d531923532.jpg" width="500" height="333" alt="birdnest, national stadium" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;ssh连接上主机&lt;/li&gt;&lt;li&gt;安装python 2.6.2&lt;br /&gt;mkdir opt&lt;br /&gt;mkdir downloads&lt;br /&gt;cd downloads&lt;br /&gt;wget http://python.org/ftp/python/2.6.2/Python-2.6.2.tgz&lt;br /&gt;tar xvzf Python-2.6.2.tgz&lt;br /&gt;cd Python-2.6.2&lt;br /&gt;./configure --prefix=$HOME/opt/ --enable-unicode=ucs4&lt;br /&gt;make&lt;br /&gt;make install&lt;/li&gt;&lt;li&gt;修改.bash_profile加入export PATH=$HOME/opt/bin/:$PATH&lt;/li&gt;&lt;li&gt;验证python版本&lt;br /&gt;source .bash_profile&lt;br /&gt;python --version&lt;/li&gt;&lt;li&gt;安装simplejson模块&lt;br /&gt;wget http://pypi.python.org/packages/2.6/s/setuptools/setuptools-0.6c9-py2.6.egg&lt;br /&gt;sh setuptools-0.6c9-py2.6.egg&lt;br /&gt;easy_install simplejson&lt;/li&gt;&lt;li&gt;checkout birdnest代码并试运行&lt;br /&gt;svn checkout http://birdnest.googlecode.com/svn/branches/stable&lt;br /&gt;python code.py 主机IP地址:端口号&lt;br /&gt;尝试用支持自定义api proxy的twitter客户端连接，地址设为&lt;br /&gt;http://IP地址:端口号/api&lt;br /&gt;验证ok后ctrl+c结束&lt;/li&gt;&lt;li&gt;detach进程&lt;br /&gt;screen&lt;br /&gt;python code.py 主机IP地址:端口号&lt;br /&gt;ctrl+a ctrl+d&lt;/li&gt;&lt;/ol&gt;大功告成，至此birdnest成功运行在dreamhost主机上了&lt;br /&gt;&lt;br /&gt;参见: &lt;a href="http://yegle.net/2009/07/29/setup-a-birdnest-twitter-api-proxy-on-your-own-host/"&gt;自建birdnest Twitter API proxy&lt;/a&gt;, &lt;a href="http://blog.localkinegrinds.com/2007/08/20/custom-python-installation-for-django-on-dreamhost/"&gt;Custom Python installation for Django on Dreamhost&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5480487-3431000252823448072?l=b.ikreep.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://b.ikreep.com/feeds/3431000252823448072/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://b.ikreep.com/2009/09/birdnest-for-twitter-on-dreamhost.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5480487/posts/default/3431000252823448072'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5480487/posts/default/3431000252823448072'/><link rel='alternate' type='text/html' href='http://b.ikreep.com/2009/09/birdnest-for-twitter-on-dreamhost.html' title='birdnest for twitter'/><author><name>kreep</name><uri>http://www.blogger.com/profile/03577528099640523733</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='02335939454535531545'/></author><thr:total>0</thr:total></entry>