<?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>Sakana.fr - A sysadmin&#039;s blog &#187; Web</title>
	<atom:link href="http://www.sakana.fr/blog/category/web/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sakana.fr/blog</link>
	<description>On the fly saving of few useful (?) tech tips</description>
	<lastBuildDate>Thu, 26 Jan 2012 15:30:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>Web server optimizations : ETAGs</title>
		<link>http://www.sakana.fr/blog/2008/07/13/web-server-optimizations-etags/</link>
		<comments>http://www.sakana.fr/blog/2008/07/13/web-server-optimizations-etags/#comments</comments>
		<pubDate>Sun, 13 Jul 2008 09:21:32 +0000</pubDate>
		<dc:creator>Stephane Kattoor</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[etag]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[httpd]]></category>
		<category><![CDATA[webserver]]></category>

		<guid isPermaLink="false">http://www.sakana.fr/blog/?p=160</guid>
		<description><![CDATA[This is nothing new, but just in case you missed it, Yahoo! published a fairly detailed report about how to speed up your website response times : Best Practices for Speeding Up Your Web Site. Many of the tips are common sense, some are somehow unexpected, and some I didn&#8217;t know like the HTTP/1.1 header [...]<p><a href="http://www.sakana.fr/blog/2008/07/13/web-server-optimizations-etags/">Web server optimizations : ETAGs</a> is a post from: <a href="http://www.sakana.fr/blog">Tech@Sakana - A sysadmin's blog</a></p>
]]></description>
			<content:encoded><![CDATA[<p>This is nothing new, but just in case you missed it, Yahoo! published a fairly detailed report about how to speed up your website response times :  <a title="Best Practices for Speeding Up Your Web Site" href="http://developer.yahoo.com/performance/rules.html" target="_blank">Best Practices for Speeding Up Your Web Site</a>.</p>
<p>Many of the tips are common sense, some are somehow unexpected, and some I didn&#8217;t know like the HTTP/1.1 header ETAG. Let&#8217;s see what that&#8217;s about.</p>
<p><span id="more-160"></span>An ETAG is a property which is sent to the web browser by a webserver along with a static file, and uniquely identify a file. This is comparable to a checksum of the file, but different in the way it is computed. For example, Apache computes the ETAG of a file based on the size, the date, and the inode number of the file (a checksum would be based on the <em>actual content</em> of the file, and as such would yield a bigger resource consumption to compute).</p>
<p>That way, the first time a web client fetches a static file from your webserver, it will cache it along with its ETAG. Next time it will request the same content, the client will provide the known (cached) ETAG in the request. The webserver has a chance to compute the ETAG of the file and compare it against the one provided with the client.  If they match then the file didn&#8217;t change and the client has a valid copy of the file in its cache. The webserver doesn&#8217;t need to send the file over again and can answer a 304 HTTP/1.1 status code (&#8220;Not modified&#8221;).</p>
<p>This is an efficient way to save bandwidth, but this has a drawback in case your website generates a large traffic and is hosted on a web server farm. With the standard setup of Apache, the ETAG depends on the file inode amongst other things. This is of course different on each server of the farm, and so the same file can be downloaded again and again, every time a client gets connected to a different server, even if the file content is actually the same &#8230;</p>
<p>In this situation, the simplest solution is to disable the ETAG feature on the webservers. This will force the web clients to rely on other cache control features such as the &#8220;Last-Modified&#8221; which means that a file in cache is still valid if it hasn&#8217;t been modified since the date it was placed in the cache.</p>
<p>Anyway, you might have to do some testing to find out which setup suits you best, but it is good to know what are ETAGs.</p>
<p><strong>References</strong> :</p>
<ol>
<li><a title="ETAGs setup in Apache" href="http://httpd.apache.org/docs/2.2/mod/core.html#fileetag" target="_blank">ETAGs setup in Apache</a></li>
<li><a title="Yahoo's Exceptional Performance guide" href="http://developer.yahoo.com/performance/" target="_blank">Yahoo!&#8217;s guide to improve performance of websites and busy webservers</a></li>
</ol>
<p><script type="text/javascript"><!--
google_ad_client = "pub-4571688872511149";
/* 728x90, created 10/17/09 */
google_ad_slot = "0784069657";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p><a href="http://www.sakana.fr/blog/2008/07/13/web-server-optimizations-etags/">Web server optimizations : ETAGs</a> is a post from: <a href="http://www.sakana.fr/blog">Tech@Sakana - A sysadmin's blog</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sakana.fr/blog/2008/07/13/web-server-optimizations-etags/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Apache : Perform load tests and bench Apache</title>
		<link>http://www.sakana.fr/blog/2007/10/23/apache-perform-load-tests-and-bench-apache/</link>
		<comments>http://www.sakana.fr/blog/2007/10/23/apache-perform-load-tests-and-bench-apache/#comments</comments>
		<pubDate>Tue, 23 Oct 2007 20:14:15 +0000</pubDate>
		<dc:creator>Stephane Kattoor</dc:creator>
				<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://www.sakana.fr/blog/2007/10/23/apache-perform-load-tests-and-bench-apache/</guid>
		<description><![CDATA[If you need to simulate a load on an Apache server (or any web server actually), you can use Apache Bench, which is included in the standard Apache HTTPd distribution. This tool will launch connections to your webserver as instructed to simulate multiple users and will help you to tune your Apache settings. You can [...]<p><a href="http://www.sakana.fr/blog/2007/10/23/apache-perform-load-tests-and-bench-apache/">Apache : Perform load tests and bench Apache</a> is a post from: <a href="http://www.sakana.fr/blog">Tech@Sakana - A sysadmin's blog</a></p>
]]></description>
			<content:encoded><![CDATA[<p>If you need to simulate a load on an Apache server (or any web server actually), you can use <strong>Apache Bench</strong>, which is included in the standard <a href="http://httpd.apache.org/" title="Apache web server" target="_blank">Apache HTTPd distribution</a>. This tool will launch connections to your webserver as instructed to simulate multiple users and will help you to tune your Apache settings.</p>
<p>You can find the synopsis at the <a href="http://httpd.apache.org/docs/2.2/programs/ab.html" title="Apache Bench documentation" target="_blank">Apache website</a>. Most common options are :</p>
<ul>
<li>-n : number of requests to perform</li>
<li>-c : number of concurrent requests</li>
</ul>
<p>Other options allow you to control precisely the request to send,  proxy settings, user authentication, cookies and much more.</p>
<p><strong>Question to readers</strong> : Which HTTP load tester do YOU use ? TIA for sharing !</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-4571688872511149";
/* 728x90, created 10/17/09 */
google_ad_slot = "0784069657";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p><a href="http://www.sakana.fr/blog/2007/10/23/apache-perform-load-tests-and-bench-apache/">Apache : Perform load tests and bench Apache</a> is a post from: <a href="http://www.sakana.fr/blog">Tech@Sakana - A sysadmin's blog</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sakana.fr/blog/2007/10/23/apache-perform-load-tests-and-bench-apache/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Find good websites through ReviewMe</title>
		<link>http://www.sakana.fr/blog/2007/05/16/find-good-websites-through-reviewme/</link>
		<comments>http://www.sakana.fr/blog/2007/05/16/find-good-websites-through-reviewme/#comments</comments>
		<pubDate>Wed, 16 May 2007 15:00:53 +0000</pubDate>
		<dc:creator>Stephane Kattoor</dc:creator>
				<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://www.sakana.fr/blog/2007/05/16/find-good-websites-through-reviewme/</guid>
		<description><![CDATA[ReviewMe aims at connecting advertisers and publishers (including bloggers) so that publishers will get paid to write reviews on their site about a product or a website. As obvious as this is, it is designed so that bloggers will get money from the time they spend on their blogs and advertisers will get better quality [...]<p><a href="http://www.sakana.fr/blog/2007/05/16/find-good-websites-through-reviewme/">Find good websites through ReviewMe</a> is a post from: <a href="http://www.sakana.fr/blog">Tech@Sakana - A sysadmin's blog</a></p>
]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.reviewme.com/?ref=17645" title="ReviewMe" target="_blank"><img src="http://www.sakana.fr/blog/wp-content/uploads/2007/05/rmlogo.jpg" title="ReviewMe" alt="ReviewMe" align="left" />ReviewMe</a> aims at connecting advertisers and publishers (including bloggers) so that publishers will get paid to write reviews on their site about a product or a website.</p>
<p>As obvious as this is, it is designed so that bloggers will get money from the time they spend on their blogs and advertisers will get better quality advertisement. But if you are not interested by the financial aspect, you might still be interested in using ReviewMe to find the best blogs about the subjects you like.<br />
<span id="more-95"></span></p>
<h4>Concept of ReviewMe</h4>
<p>If you are an advertiser, you can post offers to review your product, along with a price tag. Bloggers who will get to post a review for your product will then get paid this amount of money for their job.</p>
<p>If you are a publisher (e.g : blogger), you can subscribe your blogs and wait to see the products or website you&#8217;d be interested in reviewing. You can choose which product/website to review. Note that you don&#8217;t have to write a positive review.</p>
<p>Your website will be given a price tag, meaning that an advertiser will have to pay you this much money to get a review on your blog/website.</p>
<p>The price tag of a publisher is computed by ReviewMe based on various indicators such as <a href="http://www.technorati.com" title="Technorati" target="_blank">Technorati</a> popularity, <a href="http://www.alexa.com" title="Alexa statistics" target="_blank">alexa</a> rank and so on. The most popular the publisher, the wider the audience, the higher the price tag.</p>
<h4>I don&#8217;t need the money, am I still interested in ReviewMe ?</h4>
<p>Short answer: <em>yes definitely</em>. Because the price tag is related to the audience of a the publisher / blog, and the audience is related to the quality of the blog, then you can easily find the best blogs about a topic by looking at their price tag.</p>
<p>If you don&#8217;t feel like monetizing your blog (or if you don&#8217;t own a blog), you can still use ReviewMe to find the best blogs about a specific topic.</p>
<p>Go on and create a free account at <a href="http://www.reviewme.com/?ref=17645" title="ReviewMe" target="_blank">ReviewMe</a>&#8230;</p>
<p><a href="http://www.sakana.fr/blog/2007/05/16/find-good-websites-through-reviewme/">Find good websites through ReviewMe</a> is a post from: <a href="http://www.sakana.fr/blog">Tech@Sakana - A sysadmin's blog</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sakana.fr/blog/2007/05/16/find-good-websites-through-reviewme/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google and iGoogle : about google hype and technorati</title>
		<link>http://www.sakana.fr/blog/2007/05/01/when-google-does-something/</link>
		<comments>http://www.sakana.fr/blog/2007/05/01/when-google-does-something/#comments</comments>
		<pubDate>Tue, 01 May 2007 08:14:03 +0000</pubDate>
		<dc:creator>Stephane Kattoor</dc:creator>
				<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://www.sakana.fr/blog/2007/05/01/when-google-does-something/</guid>
		<description><![CDATA[I accessed my &#8220;Google Personnalized Homepage&#8221; today morning only to discover that the page logo now displays iGoogle instead of the classic and usual Google&#8230; I was wondering what it was, as the logo is not clickable with a link to an explanation as I hoped it would be &#8230; I quickly tried a search [...]<p><a href="http://www.sakana.fr/blog/2007/05/01/when-google-does-something/">Google and iGoogle : about google hype and technorati</a> is a post from: <a href="http://www.sakana.fr/blog">Tech@Sakana - A sysadmin's blog</a></p>
]]></description>
			<content:encoded><![CDATA[<p>I accessed my &#8220;<a href="http://www.google.com/ig" title="iGoogle" target="_blank">Google Personnalized Homepage</a>&#8221; today morning only to discover that the page logo now displays <strong>iGoogle</strong> instead of the classic and usual Google&#8230; I was wondering what it was, as the logo is not clickable with a link to an explanation as I hoped it would be &#8230;<br />
<span id="more-89"></span></p>
<p>I quickly tried a search in Google itself about iGoogle, but didn&#8217;t really get a relevant explanation to this renaming&#8230; then I decided to try a search on <a href="http://www.technorati.com" title="Technorati blog search engine" target="_blank">Technorati</a>.</p>
<p><a href="http://www.sakana.fr/blog/wp-content/uploads/2007/05/igoogle.png" title="iGoogle on Technorati"><img src="http://www.sakana.fr/blog/wp-content/uploads/2007/05/igoogle.thumbnail.png" title="iGoogle on Technorati" alt="iGoogle on Technorati" align="right" /></a>Technorati is a more or less a search engine too, but it is specifically dedicated to blogs, and I guessed that bloggers would have been quick to post about this renaming&#8230; and I was right ! If you look at the chart on the right, you&#8217;ll see that the number of posts containing iGoogle drastically increased between yesterday and today&#8230; (you can get an <a href="http://technorati.com/chartimg/igoogle?totalHits=341&amp;size=s&amp;days=30" target="_blank" title="iGoogle on Technorati">actualized chart on Technorati</a>)</p>
<p>Turned out that I didn&#8217;t find exactly what triggered that renaming, but seems like it was more or less to be expected (iGoogle is what was the ig standing for in the personnalized home page URL http://www.google.com/ig)  but there are two lessons to learn from this :</p>
<ol>
<li>As soon as Google does something, even the most unimportant ones, it immediately triggers a wave of blog posts because of the geek factor carried by Google (and am I not blogging about it right now ?)</li>
<li>When you try to get a real time coverage about an event, you might have more chance to find out with blogs search engines than with Google. Blogs indexing are close to real time, and bloggers have a quick reponse time. Classical search engines on the other hand, usually take some time before indexing new contents, making it unsuitable for real time answers.</li>
</ol>
<p>Update : this has been covered in yesterday <a href="http://www.techcrunch.com/2007/04/30/rebrand-new-features-google-ig-to-relaunch-as-igoogle/trackback/" title="TechCrunch about iGoogle">article about iGoogle on TechCrunch</a>.</p>
<p><!--adsense--></p>
<p><a href="http://www.sakana.fr/blog/2007/05/01/when-google-does-something/">Google and iGoogle : about google hype and technorati</a> is a post from: <a href="http://www.sakana.fr/blog">Tech@Sakana - A sysadmin's blog</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sakana.fr/blog/2007/05/01/when-google-does-something/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress plugin : tan tan noodles WordPress Reports</title>
		<link>http://www.sakana.fr/blog/2007/04/05/wordpress-plugin-tan-tan-noodles-wordpress-reports/</link>
		<comments>http://www.sakana.fr/blog/2007/04/05/wordpress-plugin-tan-tan-noodles-wordpress-reports/#comments</comments>
		<pubDate>Thu, 05 Apr 2007 11:40:49 +0000</pubDate>
		<dc:creator>Stephane Kattoor</dc:creator>
				<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://www.sakana.fr/blog/2007/04/05/wordpress-plugin-tan-tan-noodles-wordpress-reports/</guid>
		<description><![CDATA[Tan Tan Noodles&#8217;s wordpress reports plugin has just been updated as announced on the plugin&#8217;s homepage : Bug Fixes: WordPress Reports (0.81) : tan tan noodles &#8211; msg free since 2005 A bug fix release for the WordPress Reports plugin is now available for download. If you are using WordPress+Google Analytics+FeedBurner then this plugin is [...]<p><a href="http://www.sakana.fr/blog/2007/04/05/wordpress-plugin-tan-tan-noodles-wordpress-reports/">WordPress plugin : tan tan noodles WordPress Reports</a> is a post from: <a href="http://www.sakana.fr/blog">Tech@Sakana - A sysadmin's blog</a></p>
]]></description>
			<content:encoded><![CDATA[<p>Tan Tan Noodles&#8217;s wordpress reports plugin has just been updated as announced on the plugin&#8217;s homepage :</p>
<blockquote><p><a href="http://tantannoodles.com/2007/04/05/bug-fixes-wordpress-reports-081/">Bug Fixes: WordPress Reports (0.81) : tan tan noodles &#8211; msg free since 2005</a><br />
A bug fix release for the WordPress Reports plugin is now available for download.</p></blockquote>
<p>If you are using <a href="http://www.wordpress.org" title="Wordpress.org" target="_blank">WordPress</a>+<a href="http://www.google.com/analytics/" title="Google Analytics" target="_blank">Google Analytics</a>+<a href="http://www.feeburner.com" title="FeedBurner" target="_blank">FeedBurner</a> then this plugin is a must : it will let you get the main reports of both statistics tools directly from you WordPress admin interface.<span id="more-81"></span></p>
<p><a href="http://www.sakana.fr/blog/wp-content/uploads/2007/04/stats.png" title="Statistics from TanTan Noodles WordPress Reports plugin"><img src="http://www.sakana.fr/blog/wp-content/uploads/2007/04/stats.png" alt="Statistics from TanTan Noodles WordPress Reports plugin" /></a></p>
<p>Thanks to this update, the plugin is now working for me (it would not have let me configure my Google Analytics account in the previous version). No hesitation, give it a try !</p>
<p><!--adsense--></p>
<p><a href="http://www.sakana.fr/blog/2007/04/05/wordpress-plugin-tan-tan-noodles-wordpress-reports/">WordPress plugin : tan tan noodles WordPress Reports</a> is a post from: <a href="http://www.sakana.fr/blog">Tech@Sakana - A sysadmin's blog</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sakana.fr/blog/2007/04/05/wordpress-plugin-tan-tan-noodles-wordpress-reports/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress and AdSense: Getting money from your WordPress blog</title>
		<link>http://www.sakana.fr/blog/2007/03/25/wordpress-adsense-getting-money-from-your-wordpress-blog/</link>
		<comments>http://www.sakana.fr/blog/2007/03/25/wordpress-adsense-getting-money-from-your-wordpress-blog/#comments</comments>
		<pubDate>Sat, 24 Mar 2007 23:08:56 +0000</pubDate>
		<dc:creator>Stephane Kattoor</dc:creator>
				<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://www.sakana.fr/blog/2007/03/25/wordpress-adsense-getting-money-from-your-wordpress-blog/</guid>
		<description><![CDATA[WordPress is a great blogging platform, which will let you easily publish your blog. Now, considering the amount of time you&#8217;ll probably spend writing contents, you might want to get money from it (all work deserves money, right ? ). I&#8217;ll show you how to do this easily, by using the advertisement program of Google [...]<p><a href="http://www.sakana.fr/blog/2007/03/25/wordpress-adsense-getting-money-from-your-wordpress-blog/">WordPress and AdSense: Getting money from your WordPress blog</a> is a post from: <a href="http://www.sakana.fr/blog">Tech@Sakana - A sysadmin's blog</a></p>
]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.wordpress.org" title="Wordpress" target="_blank">WordPress</a> is a great blogging platform, which will let you easily publish your blog. Now, considering the amount of time you&#8217;ll probably spend writing contents, you might want to get money from it (all work deserves money, right ? <img src='http://www.sakana.fr/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  ).</p>
<p>I&#8217;ll show you how to do this easily, by using the advertisement program of Google : AdSense.<br />
<span id="more-80"></span></p>
<h4>Creating an AdSense account</h4>
<p>First of, you need to create an AdSense account, which you can do by clicking the referral below. <!--adsense#adsense--><br />
(By the way, this kind of referral <em>is</em> a way to get revenue on its own).</p>
<p>The account creation is fairly straight forward and should not raise any problem.</p>
<h4>Setting up WordPress for AdSense</h4>
<p>The next step is to setup your blog to include targeted advertisement. This can be made either by editing the template files of your theme (but this requires some specific skills) or by using the right plugin. I recommand most users to use the <a href="http://www.acmetech.com/blog/2005/07/26/adsense-deluxe-wordpress-plugin/" title="AdSense Deluxe plugin for WordPress" target="_blank">AdSense Deluxe plugin</a>, because of its ease of use and advanced configuration capabilities.</p>
<p>Installing this plugin is just like any other WordPress plugin : unzip and upload into the <code>wp-content/plugins</code> folder and then enable the plugin through the &#8220;plugins&#8221; section of the administration interface.</p>
<h4>Integrating AdSense advertisements into your posts</h4>
<p>Now that the plugin is installed, you need to :</p>
<ol>
<li>Go to your AdSense account, select the type of advertisement you want, and get the corresponding block of code</li>
<li>Go to your WordPress administration interface, in Options -&gt; AdSense Deluxe and then click on the &#8220;Add new&#8221; link; then you&#8217;ll be asked to fill a few fields, and especially to paste in the block of code you recovered in the 1st point. The name you&#8217;ll give will make it possible to manage different types and formats of ads.</li>
<li>Add <code>&lt;!--adsense--&gt;</code> to your posts to insert advertisement. This will insert your default advertisement. If you defined different kind of ads or referral, then you can specify the name of the adsense block like this : <code>&lt;!--adsense#name--&gt;</code>.</li>
</ol>
<p>If you use the WordPress builtin editor, take care to insert the <code>&lt;!--adsense--&gt;</code> lines from the &#8220;code&#8221; view, not the &#8220;visual&#8221; view !</p>
<h4>That&#8217;s all !</h4>
<p>Google AdSense offers different kind of products (advertisement banners, referral for google products or for firefox), as well as different formats. Be sure to go through all of them to find what works best for your site ! The AdSense-Deluxe plugin will make it easy for you to insert them in your posts.</p>
<p>The advertisement below was inserted with a simple <code>&lt;!--adsense--&gt;</code> statement.</p>
<p><!--adsense--></p>
<p><a href="http://www.sakana.fr/blog/2007/03/25/wordpress-adsense-getting-money-from-your-wordpress-blog/">WordPress and AdSense: Getting money from your WordPress blog</a> is a post from: <a href="http://www.sakana.fr/blog">Tech@Sakana - A sysadmin's blog</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sakana.fr/blog/2007/03/25/wordpress-adsense-getting-money-from-your-wordpress-blog/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Scripting Twitter with Perl + LWP</title>
		<link>http://www.sakana.fr/blog/2007/03/18/scripting-twitter-with-perl-lwp/</link>
		<comments>http://www.sakana.fr/blog/2007/03/18/scripting-twitter-with-perl-lwp/#comments</comments>
		<pubDate>Sun, 18 Mar 2007 18:45:46 +0000</pubDate>
		<dc:creator>Stephane Kattoor</dc:creator>
				<category><![CDATA[Dev]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://www.sakana.fr/blog/2007/03/18/scripting-twitter-with-perl-lwp/</guid>
		<description><![CDATA[A little follow up on yesterday article about scripting Twitter with cURL: the solution was working, but somehow inconvenient. Not practical to have to go and fetch the user id every time you want to send a direct message ! This time, I scripted Twitter direct message with Perl and LWP (libwww-perl), for a much [...]<p><a href="http://www.sakana.fr/blog/2007/03/18/scripting-twitter-with-perl-lwp/">Scripting Twitter with Perl + LWP</a> is a post from: <a href="http://www.sakana.fr/blog">Tech@Sakana - A sysadmin's blog</a></p>
]]></description>
			<content:encoded><![CDATA[<p>A little follow up on yesterday article about <a href="http://www.sakana.fr/blog/2007/03/18/scripting-twitter-with-curl/">scripting Twitter with cURL</a>: the solution was working, but somehow inconvenient. Not practical to have to go and fetch the user id every time you want to send a <em>direct message</em> !</p>
<p>This time, I scripted Twitter <em>direct message</em> with Perl and <a href="http://search.cpan.org/%7Egaas/libwww-perl-5.805/lib/LWP.pm">LWP</a> (libwww-perl), for a much more convenient solution. I designed it to be used like a sort of universal paging service.</p>
<p><span id="more-74"></span></p>
<h4>Running the script</h4>
<p>Simply launch the script to get the usage :<br />
<pre><code>spaghetti% ./twitter-direct.pl
Usage:
twitter-direct.pl --login login --password password --to user --text
&quot;text to send&quot;</code></pre></p>
<p>Options:<br />
&#8211;login<br />
lets you specify the login of your Twitter account<br />
&#8211;password<br />
lets you specify your password<br />
&#8211;to<br />
the target user of the message<br />
&#8211;text<br />
the direct message to send<br />
So for example :<br />
<pre><code>spaghetti% ./twitter.pl --login mylogin --password mypassword --to &quot;mybuddy&quot;&nbsp;&nbsp;--text &#039;Hi ! Want to go to the movie ?&#039;
</code></pre></p>
<p>That&#8217;s it !</p>
<h4>Download</h4>
<p><center><a href="http://www.sakana.fr/blog/wp-content/uploads/2007/03/twitter-direct.tar.gz"><img src="http://www.sakana.fr/blog/wp-content/uploads/2007/03/archive.png" title="Download the package" alt="Download the package" align="middle" height="64" width="64" /></a></center></p>
<h4>Worth reading</h4>
<ul>
<li><a href="http://www.sakana.fr/blog/2007/03/17/twitter-send-free-sms-messages/">Twitter : Send free SMS messages to your friends</a> : now you can do this from the command line</li>
<li><a href="http://www.sakana.fr/blog/2007/03/18/scripting-twitter-with-curl/">Scripting Twitter with cURL</a></li>
<li><a href="http://www.sakana.fr/blog/2007/03/18/scripting-twitter-with-perl-lwp/">Scripting Twitter with Perl + LWP</a> : a script in Perl doing the same thing (much simpler).</li>
<li><a href="http://www.sakana.fr/blog/2010/01/24/perltwitter-getting-mentions-from-command-line/">Perl+Twitter : Getting @mentions from command line</a></li>
</ul>
<h4>Related</h4>
<ul>
<li>Here is another command line tool for twitter : <a href="http://toufeeq.blogspot.com/2007/01/twitish.html">Twitish</a>.</li>
<li>Twitter in a <a href="http://blog.kung-foo.tv/archives/001745.html">color Terminal</a></li>
</ul>
<p><!--adsense--></p>
<p><a href="http://www.sakana.fr/blog/2007/03/18/scripting-twitter-with-perl-lwp/">Scripting Twitter with Perl + LWP</a> is a post from: <a href="http://www.sakana.fr/blog">Tech@Sakana - A sysadmin's blog</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sakana.fr/blog/2007/03/18/scripting-twitter-with-perl-lwp/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Scripting Twitter with cURL</title>
		<link>http://www.sakana.fr/blog/2007/03/18/scripting-twitter-with-curl/</link>
		<comments>http://www.sakana.fr/blog/2007/03/18/scripting-twitter-with-curl/#comments</comments>
		<pubDate>Sun, 18 Mar 2007 01:03:57 +0000</pubDate>
		<dc:creator>Stephane Kattoor</dc:creator>
				<category><![CDATA[Dev]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://www.sakana.fr/blog/2007/03/18/scripting-twitter-with-curl/</guid>
		<description><![CDATA[Twitter already provides an API but it is currently very limited. It will let you fairly easily change your status, but won&#8217;t let you send a direct message. Comes in cURL. cURL is a very versatile command line utility which is designed to script web pages interactions. As a little demo, I&#8217;ll show you how [...]<p><a href="http://www.sakana.fr/blog/2007/03/18/scripting-twitter-with-curl/">Scripting Twitter with cURL</a> is a post from: <a href="http://www.sakana.fr/blog">Tech@Sakana - A sysadmin's blog</a></p>
]]></description>
			<content:encoded><![CDATA[<p><a href="http://twitter.com">Twitter</a> already provides an <a href="http://twitter.com/help/api">API</a> but it is currently very limited. It will let you fairly easily change your status, but won&#8217;t let you send a <em>direct message</em>.</p>
<p>Comes in <a href="http://curl.haxx.se/">cURL</a>. cURL is a very versatile command line utility which is designed to script web pages interactions. As a little demo, I&#8217;ll show you how to use it to easily overcome the shortcomings of Twitter&#8217;s API.</p>
<p><span id="more-73"></span></p>
<h4>cURL availability</h4>
<p>cURL is available for many Unix/Linux systems as well as for Windows. You can download a binary package from the <a href="http://curl.haxx.se/download.html">download page for the cURL project</a>. If you&#8217;re using a recent Linux distro, chances are that it is already installed.</p>
<h4>Scripting status update</h4>
<p>For this very task, we can simply use Twitter&#8217;s API :<br />
<code>curl --basic --user username:password --data status=&quot;Having fun with cURL&quot; http://twitter.com/statuses/update.xml</code><br />
Let&#8217;s explain this snippet a bit :</p>
<ul>
<li><code>--basic --user username:password</code> : as explained in the <a href="http://twitter.com/help/api">API help</a>, the API is password protected by a &#8220;Basic Auth&#8221;. This takes care of it, by providing your Twitter username and password to the Basic Auth required by the API.</li>
<li><code>--data status=&quot;Having fun with cURL&quot;</code> : this is the data that will be sent to the API, actually the new status, which will be wrapped in a POST HTTP request.</li>
<li><code>http://twitter.com/statuses/update.xml</code> : last but not least, this is the URL of the API</li>
</ul>
<h4>Scripting a <em>direct message</em></h4>
<p>This requires a little bit more evolved trick. Indeed, Twitter&#8217;s API doesn&#8217;t provide anything to send a <em>direct message</em>.</p>
<p>To overcome this lack of feature, we are going to use cURL to do this through the web forms, just as if we would do it by hand :<br />
<code>curl --cookie /tmp/cookies.txt --cookie-jar /tmp/cookies.txt --user-agent Mozilla/4.0 --data &#039;username_or_email=username&#039; --data &#039;password=password&#039; --data &#039;commit=Sign In&#039; http://twitter.com/login</code><br />
This piece performs the login / authentication :</p>
<ul>
<li><code>--cookie /tmp/cookies.txt --cookie-jar /tmp/cookies.txt</code> : we are reading / storing the cookies from the file /tmp/cookies.txt. Right now this file is empty, but when the authentication will have been done, it will contain the session cookie which will let us keep authenticated at the next request</li>
<li><code>--user-agent Mozilla/4.0</code> : curl will pretend it is Mozilla/4.0.</li>
<li><code>--data[...]</code>: the data to be sent, actually the login and password</li>
<li><code>http://twitter.com/login</code>: the URL of the login form</li>
</ul>
<p>This will log us in, and let us send the direct message with the following command :<br />
<code>curl --cookie /tmp/cookies.txt --cookie-jar /tmp/cookies.txt --user-agent Mozilla/4.0 --data &quot;text=little message to send&quot; --data &#039;commit=Send&#039; http://twitter.com/direct_messages/create/123456</code><br />
There is not much more to explain with this command. The URL which is used here is the one you can get by going on <a href="http://twitter.com/home">Twitter</a>, then clicking on the friend you want to send a <em>direct message</em> to, and then clicking on &#8220;message&#8221; on the right hand sidebar.</p>
<p>That&#8217;s it, you&#8217;ve sent your Twitter <em>direct message</em> from the command line with cURL ! Of course you could wrap up those two lines in a shell script and make it more user friendly &#8230;</p>
<p>Worth reading :</p>
<ul>
<li><a href="http://www.sakana.fr/blog/2007/03/17/twitter-send-free-sms-messages/">Twitter : Send free SMS messages to your friends</a> : now you can do this from the command line</li>
<li><a href="http://www.sakana.fr/blog/2007/03/18/scripting-twitter-with-curl/">Scripting Twitter with cURL</a></li>
<li><a href="http://www.sakana.fr/blog/2007/03/18/scripting-twitter-with-perl-lwp/">Scripting Twitter with Perl + LWP</a> : a script in Perl doing the same thing (much simpler).</li>
<li><a href="http://www.sakana.fr/blog/2010/01/24/perltwitter-getting-mentions-from-command-line/">Perl+Twitter : Getting @mentions from command line</a></li>
</ul>
<p><!--adsense--></p>
<p><a href="http://www.sakana.fr/blog/2007/03/18/scripting-twitter-with-curl/">Scripting Twitter with cURL</a> is a post from: <a href="http://www.sakana.fr/blog">Tech@Sakana - A sysadmin's blog</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sakana.fr/blog/2007/03/18/scripting-twitter-with-curl/feed/</wfw:commentRss>
		<slash:comments>55</slash:comments>
		</item>
		<item>
		<title>Twitter : Send free SMS messages to your friends</title>
		<link>http://www.sakana.fr/blog/2007/03/17/twitter-send-free-sms-messages/</link>
		<comments>http://www.sakana.fr/blog/2007/03/17/twitter-send-free-sms-messages/#comments</comments>
		<pubDate>Sat, 17 Mar 2007 16:26:22 +0000</pubDate>
		<dc:creator>Stephane Kattoor</dc:creator>
				<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://www.sakana.fr/blog/2007/03/17/twitter-send-free-sms-messages/</guid>
		<description><![CDATA[If you don&#8217;t know yet about Twitter, you might want to have a look at my previous article about it. One of its neat features is the (previously written about) ability to send direct messages to your friends. This feature will let you easily send free SMS from your computer to any of your friends. [...]<p><a href="http://www.sakana.fr/blog/2007/03/17/twitter-send-free-sms-messages/">Twitter : Send free SMS messages to your friends</a> is a post from: <a href="http://www.sakana.fr/blog">Tech@Sakana - A sysadmin's blog</a></p>
]]></description>
			<content:encoded><![CDATA[<p>If you don&#8217;t know yet about <a href="http://twitter.com/" title="Twitter web site">Twitter</a>, you might want to have a look at <a href="http://www.sakana.fr/blog/2007/02/12/twitter-is-fun/" title="Twitter is fun !" target="_blank">my previous article about it.</a><br />
One of its neat features is the (<a href="http://www.sakana.fr/blog/2007/03/11/twitter-unified-messaging-interface/" title="Twitter : Unified messaging interface" target="_blank">previously written about</a>) ability to send <em>direct messages</em> to your friends.</p>
<p>This feature will let you easily send free SMS from your computer to any of your friends.<span id="more-71"></span></p>
<p>To enjoy this free SMS service, you&#8217;ll need to follow those few easy steps :</p>
<ol>
<li><a href="http://twitter.com/account/create" title="Create a Twitter account" target="_blank">Create an account</a> on <a href="http://twitter.com/" title="Twitter" target="_blank">Twitter</a>, and then <a href="http://twitter.com/login" title="Login on Twitter">log in</a></li>
<li><a href="http://www.sakana.fr/blog/wp-admin/Invite%20your%20friends" title="Invite your friends on Twitter" target="_blank">Invite your friends</a>, so that they&#8217;ll create an account as well. You&#8217;ll only be able to send free SMS messages to your Twitter-friends if they <a href="http://twitter.com/devices" title="Configure your mobile phone" target="_blank">set up their cell phone</a> in their Twitter account.</li>
<li>Have them configure their account so that direct messages sent to them will be delivered to their cell phone
<ol>
<li>Look on the right hand sidebar, the &#8220;send notifications to&#8221; lets you do this</li>
<li>Ensure that the <a href="http://twitter.com/devices" title="Cell phone and IM configuration in Twitter" target="_blank">cell phone configuration</a> is ok too, that is &#8220;notifications&#8221; are on for the cell phone</li>
</ol>
</li>
<li>Start sending them <em>direct messages</em>; they&#8217;ll get them as SMS on their cell phones :
<ol>
<li>You can do this either through the <a href="http://twitter.com/direct_messages" title="Direct Messages web interface of Twitter" target="_blank">web interface</a></li>
<li>or through IM (for example GTalk or AIM) if you <a href="http://help.twitter.com/index.php?pg=kb.page&amp;id=28" title="How to configure IM with Twitter, help page" target="_blank">configured it</a>. Basically you&#8217;ll add a special buddy (twitter@twitter.com for GTalk for example), and when you&#8217;ll send him a message, it will interact with your twitter. This is a way to update your Twitter status, but there is a <a href="http://help.twitter.com/index.php?pg=kb.page&amp;id=10" title="Twitter lingo help page" target="_blank">lingo</a> which will let you send direct messages. If you want to send a message to a user whose twitter account is my_friend, then send the following message to the twitter buddy : <code>d my_friend hello there !</code></li>
</ol>
</li>
</ol>
<p>That&#8217;s really this simple ! <img src='http://www.sakana.fr/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Worth reading :</p>
<ul>
<li><a href="http://www.sakana.fr/blog/2007/03/17/twitter-send-free-sms-messages/">Twitter : Send free SMS messages to your friends</a> : now you can do this from the command line</li>
<li><a href="http://www.sakana.fr/blog/2007/03/18/scripting-twitter-with-curl/">Scripting Twitter with cURL</a></li>
<li><a href="http://www.sakana.fr/blog/2007/03/18/scripting-twitter-with-perl-lwp/">Scripting Twitter with Perl + LWP</a> : a script in Perl doing the same thing (much simpler).</li>
<li><a href="http://www.sakana.fr/blog/2010/01/24/perltwitter-getting-mentions-from-command-line/">Perl+Twitter : Getting @mentions from command line</a></li>
</ul>
<p><!--adsense--></p>
<p><a href="http://www.sakana.fr/blog/2007/03/17/twitter-send-free-sms-messages/">Twitter : Send free SMS messages to your friends</a> is a post from: <a href="http://www.sakana.fr/blog">Tech@Sakana - A sysadmin's blog</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sakana.fr/blog/2007/03/17/twitter-send-free-sms-messages/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Twitter : Unified messaging interface</title>
		<link>http://www.sakana.fr/blog/2007/03/11/twitter-unified-messaging-interface/</link>
		<comments>http://www.sakana.fr/blog/2007/03/11/twitter-unified-messaging-interface/#comments</comments>
		<pubDate>Sun, 11 Mar 2007 09:25:27 +0000</pubDate>
		<dc:creator>Stephane Kattoor</dc:creator>
				<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://www.sakana.fr/blog/2007/03/11/the-several-habits-of-wildly-successful-twitter-users-%c2%bb-slacker-manager/</guid>
		<description><![CDATA[The Several Habits of Wildly Successful Twitter Users » Slacker Manager If you just want to send a note directly to someone, you can get them via the direct messages web interface. Damn ! I&#8217;m a twitter user myself, but how could I have overlooked that &#8220;direct message&#8221; feature ? Now you can think of [...]<p><a href="http://www.sakana.fr/blog/2007/03/11/twitter-unified-messaging-interface/">Twitter : Unified messaging interface</a> is a post from: <a href="http://www.sakana.fr/blog">Tech@Sakana - A sysadmin's blog</a></p>
]]></description>
			<content:encoded><![CDATA[<blockquote><p><a href="http://slackermanager.com/2007/03/the-several-habits-of-wildly-successful-twitter-users.html" title="The Several Habits of Wildly Successful Twitter Users" target="_blank">The Several Habits of Wildly Successful Twitter Users » Slacker Manager</a><br />
If you just want to send a note directly to someone, you can get them via the direct messages web interface.</p></blockquote>
<p>Damn ! I&#8217;m a twitter user myself, but how could I have overlooked that &#8220;<a href="http://twitter.com/direct_messages">direct message</a>&#8221; feature ? Now you can think of twitter as a unified messaging interface. If the personne you&#8217;re sending a message didn&#8217;t configure anything then the message will wait to be read on the website. If she configured IM and cell phone, then she&#8217;ll get it on the IM when online, on the cell phone when not. Pretty cool !</p>
<p>The <a href="http://slackermanager.com/2007/03/the-several-habits-of-wildly-successful-twitter-users.html" title="The Several Habits of Wildly Successful Twitter Users" target="_blank">rest of the quoted</a> article is worth to be read !</p>
<p><a href="http://www.sakana.fr/blog/2007/02/12/twitter-is-fun/" title="Twitter is fun !" target="_blank">My old post about twitter</a></p>
<p><!--adsense--></p>
<p><a href="http://www.sakana.fr/blog/2007/03/11/twitter-unified-messaging-interface/">Twitter : Unified messaging interface</a> is a post from: <a href="http://www.sakana.fr/blog">Tech@Sakana - A sysadmin's blog</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sakana.fr/blog/2007/03/11/twitter-unified-messaging-interface/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

