<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
   <channel>
      <title>blog.kentarok.org</title>
      <link>http://blog.kentarok.org/</link>
      <description>about daily life, thought, popular culture, technologies etc.</description>
      <language>en</language>
      <copyright>Copyright 2008</copyright>
      <lastBuildDate>Thu, 14 Jun 2007 03:31:40 +0900</lastBuildDate>
      <generator>http://www.sixapart.com/movabletype/</generator>
      <docs>http://blogs.law.harvard.edu/tech/rss</docs> 

            <item>
         <title>Glitchr: Glitches the Web</title>
         <description>![Glithr](/2007/06/14/glitchr.png &quot;Glitchr&quot;)

Yesterday, I hacked up a website, [Glitchr](http://glitchr.kentarok.org/ &quot;Glitchr&quot;), which is heavily inspired by [youpy](http://d.hatena.ne.jp/youpy/)&apos;s great work, [GlitchMonkey](http://userscripts.org/scripts/show/9653 &quot;GlitchMonkey -- Userscripts.org&quot;). It aimes to let people know fun of glitched things easier without installing greasemonkey script.

&gt; A glitch is a short-lived fault in a system. The term is particularly common in the computing and electronics industries, and in circuit bending, as well as among players of video games, although it is applied to all types of systems including human organizations and nature. The term derives from the German glitschen, meaning &apos;to slip.&apos;

Source: [Glitch - Wikipedia, the free encyclopedia](http://en.wikipedia.org/wiki/Glitch &quot;Glitch - Wikipedia, the free encyclopedia&quot;)

As the entry from Wikipedia says, glitch is a word which originally come from electronics industries terms, but it&apos;s also a name of a genre in some kind of arts, music, movie, image, and so on. Speaking about music, I really love [Oval](http://en.wikipedia.org/wiki/Oval_%28band%29 &quot;Oval (band) - Wikipedia, the free encyclopedia&quot;), who compose songs filled with glitched noises, nevertheless, they&apos;re really melodious and beautiful.

Glitchr is a website which glitches images in webpages, and of course, you can also specify the image by its URL on the Net. Anyway, seeing is believing. I&apos;ll show you some examples (by specifing an image).

![Original image](/2007/06/14/original_girl.png &quot;Original image&quot;)

![Glitchedr image](/2007/06/14/glitched_girl.png &quot;Glithed image&quot;)

It&apos;s interesting!

Surely, it&apos;s totally useless. But usefulness doesn&apos;t matter for arts at all, you know ;)</description>
         <link>http://blog.kentarok.org/2007/06/14/033140.html</link>
         <guid>http://blog.kentarok.org/2007/06/14/033140.html</guid>
        
                  <category domain="http://www.sixapart.com/ns/types#tag">arts</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">image</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">release</category>
        
         <pubDate>Thu, 14 Jun 2007 03:31:40 +0900</pubDate>
      </item>
            <item>
         <title>WebService::Hatena::Graph version 0.06 released</title>
         <description>Today, I released the new version of [WebService::Hatena::Graph](http://search.cpan.org/dist/WebService-Hatena-Graph/ &quot;Kentaro Kuribayashi / WebService-Hatena-Graph - search.cpan.org&quot;) along with some updates of [Hatena::Graph](http://graph.hatena.ne.jp/ &quot;はてなグラフ&quot;) API. It&apos;s become totally new, adding several features, getting graph data and setting/getting configurations.

The feature to set new graph data has been offered since the API was released, but the method to enable users to do so is now renamed to post_data() from post() to distingish posting some graph data , post_data(), from posting some configs, post_config().

Here&apos;s a usage of this module:

    use WebService::Hatena::Graph;

    my $graph = WebService::Hatena::Graph-&gt;new(
        username =&gt; $username,
        password =&gt; $password,
    );

    # set data to the specified graph
    $graph-&gt;post_data(
        graphname =&gt; $graphname,
        date      =&gt; $date,
        value     =&gt; $value,
    );

    # retrieve graph data
    my $graph_data = $graph-&gt;get_data(
        graphname  =&gt; $graphname,
        username   =&gt; $username,
    );

    # set config
    $graph-&gt;post_data(
        graphname      =&gt; $graphname,
        graphcolor     =&gt; $graphcolor,
        graphtype      =&gt; $graphtype,
        status         =&gt; $status,
        allowuser      =&gt; $allowuser,
        allowgrouplist =&gt; $allowgrouplist,
        stack          =&gt; $stack,
        reverse        =&gt; $reverse,
        formula        =&gt; $formula,
        maxy           =&gt; $maxy,
        miny           =&gt; $miny,
        showdata       =&gt; $showdata,
        nolabel        =&gt; $nolabel,
        userline       =&gt; $userline,
        userlinecolor  =&gt; $userlinecolor,
        comment        =&gt; $comment,
    );

    # retrieve config
    my $graph_config = $graph-&gt;get_config( graphname =&gt; $graphname );

Enjoy!</description>
         <link>http://blog.kentarok.org/2007/06/14/021752.html</link>
         <guid>http://blog.kentarok.org/2007/06/14/021752.html</guid>
        
                  <category domain="http://www.sixapart.com/ns/types#tag">cpan</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">perl</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">release</category>
        
         <pubDate>Thu, 14 Jun 2007 02:17:52 +0900</pubDate>
      </item>
            <item>
         <title>Twitter to say farewell</title>
         <description><![CDATA[Steven D. Levitt, well-known in Japan for the book, "<a href="http://www.freakonomics.com/thebook.php" title="Freakonomics: A Rogue Economist Explores the Hidden Side of Everything by Steven D. Levitt and Stephen J. Dubner - William Morrow, 2005">Freakonomics</a>" ("ヤバい経済学" in Japanese), expects the Internet to be of great help for fighting pandemic.

> What can we do to fight global pandemics? The single most powerful tool we have is probably the internet. Pandemics tend to start in remote locations. What we need is a way to extract the information from those places quickly to get a head start on keeping the epidemic tamed. The formal networks like the CDC do not seem to work all that well.

<a href="http://www.freakonomics.com/blog/2007/05/18/fight-global-pandemics-or-at-least-find-a-good-excuse-when-youre-playing-hooky/" title="Freakonomics Blog ? Fight Global Pandemics (Or At Least Find a Good Excuse When You’re Playing Hooky)">Freakonomics Blog ? Fight Global Pandemics (Or At Least Find a Good Excuse When You’re Playing Hooky)</a>

Great. I totally agree with it. And he describes [Whoissick.org](http://whoissick.org/) which allows people to post about their sickness, to search with zip code, to view on a map, etc. It looks very cool and really useful. But he also says:

> I doubt, however, that I would want to bother to go tell Whoissick.org that I feel awful. Certainly if I was about to die from the bird flu, it would not be top of mind.

Certainly ;)

In the meanwhile, I've been really addicted to [Twitter](http://twitter.com/) these days, where people only reply to the question, "What are you doing?".

I think that it must be tough for us to post about our sickness to such sites as Whoissick.org, when we're suffering from disease. It's just a little overreact.

But I'm sure that Twitter enables us to do so easily due to its simplicity and diversity of accessibility. Actually, when people get ill, they're twittering, "got a headache", "feel so bad", "I seem to catch a cold" or so. We may be twittering at that time we're about to dying.

"Folks! I'm about to die. Good-bye!"

No kidding.]]></description>
         <link>http://blog.kentarok.org/2007/05/19/013632.html</link>
         <guid>http://blog.kentarok.org/2007/05/19/013632.html</guid>
        
                  <category domain="http://www.sixapart.com/ns/types#tag">twitter</category>
        
         <pubDate>Sat, 19 May 2007 01:36:32 +0900</pubDate>
      </item>
            <item>
         <title>WebService::Timelog released</title>
         <description>These days, so many start-ups which have an intention of following [Twitter](http://twitter.com/ &quot;Twitter&quot;)&apos;s success have come out one after another. I think it&apos;s absolutely ridiculous that most of them stupid enough not to offer diverse way to access their services except Web forms, for instance, accessibility via open API, IM, cell-phone, and so on.

[Timelog](http://timelog.jp/ &quot;今をメモする「Timelog」&quot;) is one of such sites, but it wisely started providing API which allows its users to access most functions and data on it easily. Really great! As soon as I heard the news, I went straight to work on writing a perl interface to it. Then, I hacked it up as WebService::Timelog, and uploaded it to CPAN.

  * [WebService::Timelog](http://search.cpan.org/dist/WebService-Timelog/ &quot;Kentaro Kuribayashi / WebService-Timelog - search.cpan.org&quot;)

Here&apos;s a simple usage of this module. For more details, consult the documentation on CPAN and [the official documentation of Timelog API](http://timelog.jp/api.asp). Enjoy!

    use WebService::Timelog;

    my $timelog = WebService::Timelog-&gt;new(
        username =&gt; $username,
        password =&gt; $password,
    );

    # update status
    $timelog-&gt;new_msg(text =&gt; $text);

    # or you can do so like this
    $timelog-&gt;update($text);

    # retrieve public messages
    my $public_messages  = $timelog-&gt;public_msg(cnt =&gt; $count, since =&gt; $since);

    # retrieve friends&apos; messages
    my $friends_messages = $timelog-&gt;friends_msg(cnt =&gt; $count, since =&gt; $since);

    # retrieve direct messages
    my $direct_messages  = $timelog-&gt;direct_msg(cnt =&gt; $count);

    # retrieve some information on you
    my $me               = $timelog-&gt;show();

    # retrieve some informtion on your friends
    my $friends          = $timelog-&gt;friends(cnt =&gt; $count);
</description>
         <link>http://blog.kentarok.org/2007/05/17/152609.html</link>
         <guid>http://blog.kentarok.org/2007/05/17/152609.html</guid>
        
                  <category domain="http://www.sixapart.com/ns/types#tag">cpan</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">perl</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">timelog</category>
        
         <pubDate>Thu, 17 May 2007 15:26:09 +0900</pubDate>
      </item>
            <item>
         <title>Acme::MorningMusume version 0.10 released</title>
         <description>I&apos;ve shipped a new version of Acme::MorningMusume. It&apos;s an update along with that Hitomi Yoshizawa graduated from モーニング娘。 on May 6.

  * [Kentaro Kuribayashi / Acme-MorningMusume-0.10 - search.cpan.org](http://search.cpan.org/~kentaro/Acme-MorningMusume-0.10/ &quot;Kentaro Kuribayashi / Acme-MorningMusume-0.10 - search.cpan.org&quot;)

As I wrote here before, I&apos;m hardly interested in モーニング娘。 now. I love ℃-ute and Berryz工房!!! I have to say モーニング娘。 now doesn&apos;t matter at all.</description>
         <link>http://blog.kentarok.org/2007/05/07/225541.html</link>
         <guid>http://blog.kentarok.org/2007/05/07/225541.html</guid>
        
                  <category domain="http://www.sixapart.com/ns/types#tag">berryz.c-ute</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">cpan</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">idol</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">morningmusume</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">perl</category>
        
         <pubDate>Mon, 07 May 2007 22:55:41 +0900</pubDate>
      </item>
            <item>
         <title>Origins of Domain Names of Mine</title>
         <description>It seems that blogging about origins of domain names is in fashion among Japanese bloggers, which was suggested by kaminogoya-san at this entry: &quot;[ドメイン名の由来を書いてみる - 2xup.org](http://2xup.org/log/2007/05/06-0146 &quot;ドメイン名の由来を書いてみる - 2xup.org&quot;)&quot;. I&apos;ll also take after them to catch up.

I run some domain names for several websites.

[kentarok.org](http://kentarok.org/) is for some kind of personal things like [blog](http://blog.kentarok.org/ &quot;blog.kentarok.org&quot;), [code repository](http://svn.kentarok.org/public/ &quot;svn.kentarok.org&quot;), [repository viewer and task management tool](http://code.kentarok.org/trac &quot;code.kentarok.org - Trac&quot;), and [some documents](http://docs.kentarok.org/ &quot;docs.kentarok.org/&quot;) (it&apos;s now empty, though...). As you easily recognize, it was named after my own name, Kentaro Kuribayashi.

[antipop.gs](http://antipop.gs/), which is obsolete but will still work until next year or so, was replaced by kentarok.org described above. It was the first domain name I took. The story about the domain name is too long to tell whole of it, so I&apos;ll explain it as shortly as I can.

When I took a procedure for connecting to the Internet for the first time and was needed to choose some phrase for my e-mail account name, I hadn&apos;t thought about it at all. Since no good idea came out to me then, I took a name from a Hip Hop group called [Antipop Consortium](http://en.wikipedia.org/wiki/Antipop_Consortium &quot;Antipop Consortium - Wikipedia, the free encyclopedia&quot;). I was just listening to their music then. So, I started using the name, antipop, in various occasion: domain name, IDs for some websites, etc.

[simpleandclean.jp](http://simpleandclean.jp/) was named after a song of Hikaru Utada, &quot;[Simple and Clean](http://en.wikipedia.org/wiki/Simple_and_Clean &quot;Simple and Clean - Wikipedia, the free encyclopedia&quot;)&quot;, which is English version of &quot;光&quot;, but not literally. I&apos;m an enthusiastic fan of her, and love the song the most of her works. simpleandclean.jp now hosts only some experimental things of mine so far, I&apos;ll offer something usefull things there.

I have also much more domain names except them. There may be a chance to write about them some time or other.</description>
         <link>http://blog.kentarok.org/2007/05/07/183417.html</link>
         <guid>http://blog.kentarok.org/2007/05/07/183417.html</guid>
        
                  <category domain="http://www.sixapart.com/ns/types#tag">blog</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">myself</category>
        
         <pubDate>Mon, 07 May 2007 18:34:17 +0900</pubDate>
      </item>
            <item>
         <title>Alternative usage of Twitter</title>
         <description>[Twitter](http://twitter.com/ &quot;Twitter&quot;) not only is a site where we replay to the question, &quot;What are you doing?&quot;, but also can be an alternative way of informing and reminding us of anything like news, weather forecast, blog posts which gathers many attentions, TODOs, and so on.

For instance, there&apos;s a tweet which broadcasts weather forecast of Tokyo area in Japan to its followers.

 * [Twitter / tokyoforecast](http://twitter.com/tokyoforecast &quot;Twitter / tokyoforecast&quot;)

Sorry to say, since I&apos;m not live in Tokyo or near there but Amami Island, Kagoshima, forecast of Tokyo area is entirely useless for me. So, I made my version of it:

 * [Twitter / amamiforecast](http://twitter.com/amamiforecast &quot;Twitter / amamiforecast&quot;)

Also, I made another tweets which convey QotD, Question of the Day, from [Vox](http://www.vox.com/), really fascinating blogging tool offered by Six Apart, to Twitter.

 * [Twitter / qotd_vox](http://twitter.com/qotd_vox &quot;Twitter / qotd_vox&quot;) (in English)
 * [Twitter / qotd_vox_ja](http://twitter.com/qotd_vox_ja &quot;Twitter / qotd_vox_ja&quot;) (in Japanese)

They just only fetch QotD from Vox and dump it onto Twitter, but QotD is suitable also for such sites as Twitter, so it&apos;s worth the trial to do it, I think.

Acknowledgements:

 * [Plagger](http://plagger.org/): fetches, processes, and publishes feeds.
 * [livedoor weather forecast service](http://weather.livedoor.com/ &quot;livedoor 天気情報&quot;): offers information of weather forecast as a feed.</description>
         <link>http://blog.kentarok.org/2007/04/25/201830.html</link>
         <guid>http://blog.kentarok.org/2007/04/25/201830.html</guid>
        
                  <category domain="http://www.sixapart.com/ns/types#tag">plagger</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">twitter</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">vox</category>
        
         <pubDate>Wed, 25 Apr 2007 20:18:30 +0900</pubDate>
      </item>
            <item>
         <title>Template::Plugin::Shorten version 0.01 released</title>
         <description><![CDATA[The initial version of [Template::Plugin::Shorten](http://search.cpan.org/dist/Template-Plugin-Shorten/) is now on CPAN. It works as a [Template::Toolkit](http://search.cpan.org/dist/Template-Toolkit/) plugin, which filters URLs to shorten or lengthen using URL shortening sites like [TinyURL.com](http://tinyurl.com/).

I made it so that I could neatly write a template for a Plagger plugin, [P::P::Publish::Twitter](http://plagger.org/trac/browser/trunk/plagger/lib/Plagger/Plugin/Publish/Twitter.pm), which now supports templatization using TT. I'm afraid that it may cause some problems in other contexts.

Here's a usage of this module:

    # Load this plugin
    [% USE Shorten %]

    # Shortening URLs
    [% FILTER shorten_url %]
      <a href="http://search.cpan.org/">search.cpan.org</a>
    [% END %]

    # or

    [% text | shorten_url %]

    # Lengthening URLs
    [% FILTER lengthen_url %]
      <a href="http://tinyurl.com/37rwu">search.cpan.org</a>
    [% END %]

    # or

    [% text | lengthen_url %]
]]></description>
         <link>http://blog.kentarok.org/2007/04/25/161607.html</link>
         <guid>http://blog.kentarok.org/2007/04/25/161607.html</guid>
        
                  <category domain="http://www.sixapart.com/ns/types#tag">cpan</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">perl</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">tt</category>
        
         <pubDate>Wed, 25 Apr 2007 16:16:07 +0900</pubDate>
      </item>
            <item>
         <title>Commands Execution History</title>
         <description>Here&apos;s the history of the commands I executed from someday in this year to today.

    $ ruby -pe &apos;gsub(/^.+;| .+$/,&quot;&quot;)&apos; .zhistory | sort | uniq -c | sort -r | head -30
        880 sudo
        831 svk
        473 ls
        369 cd
        217 rm
        199 perl
        195 svn
        121 apt-cache
        117 mv
        106 wget
        101 chmod
        100 mkdir
         84 perldoc
         79 cp
         76 cat
         60 &apos;
         52
         49 vi
         44 href
         34 tar
         34 less
         32 ps
         30 echo
         29 ruby
         29 ln
         27 locate
         24 jed
         23 kill
         22 screen
         22 lv</description>
         <link>http://blog.kentarok.org/2007/04/19/044851.html</link>
         <guid>http://blog.kentarok.org/2007/04/19/044851.html</guid>
        
                  <category domain="http://www.sixapart.com/ns/types#tag">linux</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">zsh</category>
        
         <pubDate>Thu, 19 Apr 2007 04:48:51 +0900</pubDate>
      </item>
            <item>
         <title>IRC2Twitter Gateway Apps</title>
         <description>Do you enjoy twittering? How do you play with [Twitter](http://twitter.com/)? The best way I think is to post statuses via IRC. You may wonder how you can do it. Don&apos;t worry! Many people help you with their excellent tools. 

[Yappo](http://blog.yappo.jp/yappo/archives/000506.html &quot;YappoLogs: twitter2ircd.pl - POEで書いたperlのTwitter IRC Gateway&quot;) and [typester](http://unknownplace.org/memo/2007/04/15#e001 &quot;unknownplace.org - 2007/04/15 - Yet Another IRC Gateway for Twitter&quot;) hacked up Perl scripts which work as a gateway and connect IRC to Twitter. To make it, the former implements [POE::Component::Client::Twitter](http://search.cpan.org/dist/POE-Component-Client-Twitter/ &quot;Kazuhiro Osawa / POE-Component-Client-Twitter - search.cpan.org&quot;) and the latter uses [POE::Component::Jabber](http://search.cpan.org/dist/POE-Component-Jabber/ &quot;Nicholas Perez / POE-Component-Jabber - search.cpan.org&quot;). If you&apos;re a Ruby guy, you might want to use [tig.rb (twitter irc gareway)](http://subtech.g.hatena.ne.jp/cho45/20070415/1176631923 &quot;subtech - 冬通りに消え行く制服ガールは、夢物語にリアルを求めない。 - tig.rb (twitter irc gareway)&quot;) written by cho45. Super cool!

By the way, I use [TwitterIrcGateway](http://www.misuzilla.org/dist/net/twitterircgateway/ &quot;TwitterIrcGateway - misuzilla.org&quot;) habitually. Today, I found there was Linux version of it (using [Mono](http://www.mono-project.com/Main_Page &quot;Main Page - Mono&quot;))! I went straight to test it and confirmed that it worked well in my environment, debian GNU/Linux (sid). According to mayuki, the author of TwitterIrcGateway, as it includes also Mono itself, we don&apos;t need to install it for ourselves in advance. Really great! 

I wrote an init script like this:

    $ cat /etc/init.d/TwitterIrcGateway
    #!/bin/sh

    NAME=&quot;TwitterIrcGateway&quot;
    DIR=&quot;/path/to/TwitterIrcGateway/&quot;
    OPT=&quot;--port=6669 --interval=60 --resolve-tinyurl=true --encoding=iso-2022-jp --ignore-watch-error=true --enable-drop-protection=true&quot;
    KILL=&quot;/usr/bin/killall&quot;

    case &quot;$1&quot; in
        start)
            echo -n &quot;Starting $NAME...&quot;
            cd ${DIR} &amp;&amp; ./${NAME} ${OPT} 2&gt; /dev/null &amp;
            echo &quot;.&quot;
            ;;
        stop)
            echo -n &quot;Stopping $NAME... &quot;
            ${KILL} $NAME
            ;;
        *)
            echo &quot;Usage: /etc/init.d/$NAME {start|stop}&quot;
            exit 1
            ;;
    esac

    exit 0
</description>
         <link>http://blog.kentarok.org/2007/04/16/021923.html</link>
         <guid>http://blog.kentarok.org/2007/04/16/021923.html</guid>
        
                  <category domain="http://www.sixapart.com/ns/types#tag">irc</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">twitter</category>
        
         <pubDate>Mon, 16 Apr 2007 02:19:23 +0900</pubDate>
      </item>
            <item>
         <title>NHK started broadcasting their radio program on business English online</title>
         <description>![textbook for &quot;Business English&quot;](/2007/04/15/textbook_for_business_english.png)
I found NHK started broadcasting their radio program on business English, &quot;[ビジネス英会話](http://www.nhk.or.jp/gogaku/english/business/index.html &quot;NHK外国語講座&quot;)&quot;, online from this month. I went to a book store and bought a textbook for the program without any delay. It&apos;s really super!

Until now, I&apos;ve taken TOEIC two times. In either times, the score of listening is terribly lesser than reading. I must enhance my ability of listening, but to put it into practice is difficult, so expect the program helps me to do so.</description>
         <link>http://blog.kentarok.org/2007/04/15/025018.html</link>
         <guid>http://blog.kentarok.org/2007/04/15/025018.html</guid>
        
                  <category domain="http://www.sixapart.com/ns/types#tag">learning english</category>
        
         <pubDate>Sun, 15 Apr 2007 02:50:18 +0900</pubDate>
      </item>
            <item>
         <title>Twittering via E-mail</title>
         <description>There must be many people who&apos;d like to post their status to [Twitter](http://twitter.com/) from cell-phones. In my case, Twitter hasn&apos;t supported the cell-phones provided by Japanese careers yet, or to be exact, Japanese cell-phones don&apos;t support International SMS, so I&apos;ve been forced inconvenience on not to be able to do it. However, it&apos;s nonsence that I only wait for them to concider my circumstance. I have to help me for myself.

Today, I found [DreamHost](http://www.dreamhost.com/), which hosts this blog and other websites of mine, supported piping E-mails into other programs. Great! I went straight to write a tiny script, mail2twitter.rb, which allows me to post my status via e-mail. Then I created a new user to accept the e-mails. Finally, created a file named .forward.postfix right under the user&apos;s home directory like this:

    &quot;| /home/username/path/to/mail2twitter.rb&quot;

That&apos;s all. For more, consult [DreamHost Wiki](http://wiki.dreamhost.com/Email_to_Script &quot;Email to Script - DreamHost&quot;) to know how to configure your environment. And I drew upon [a script written by ma.la](http://la.ma.la/blog/diary_200704111918.htm &quot;最速インターフェース研究会 :: bluewindからtwitterを更新できるようにRubyでシンプルなクライアントを書いた&quot;) to write this script. Thanks!

**Note**:

 * Don&apos;t forget to give the script an executable privilege(e.g. `chmod +x mail2twitter.rb`).
 * Hide the address to accept e-mails from anyone. mail2twitter.rb checks who sends an e-mail by From field of it, but, you know,  it&apos;s inadequate to save your status from malicious people.
 * This way explained here is basically applicable to other environments which support e-mail piping.

[mail2twitter.rb](/2007/04/14/mail2twitter.txt)

    #!/usr/bin/ruby

    require &apos;uri&apos;
    require &apos;kconv&apos;
    require &apos;mailread&apos;
    require &apos;net/http&apos;

    username  = &apos;username&apos;
    password  = &apos;password&apos;
    addresses = [&apos;foo@exapmle.com&apos;, &apos;bar@example.com&apos;]

    mail      = Mail.new($stdin)
    exit unless addresses.find{|address| mail[&apos;From&apos;].index address}

    status    = URI.escape(Kconv::kconv(mail[&apos;Subject&apos;], Kconv::UTF8, Kconv::AUTO))
    req       = Net::HTTP::Post.new(&apos;/statuses/update.json&apos;)
    req.body  = &apos;status=&apos; + status
    req.basic_auth username, password

    Net::HTTP.new(&apos;twitter.com&apos;, 80).start {|http|
      http.request req
    }
</description>
         <link>http://blog.kentarok.org/2007/04/15/004510.html</link>
         <guid>http://blog.kentarok.org/2007/04/15/004510.html</guid>
        
                  <category domain="http://www.sixapart.com/ns/types#tag">ruby</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">twitter</category>
        
         <pubDate>Sun, 15 Apr 2007 00:45:10 +0900</pubDate>
      </item>
            <item>
         <title>MT Plugin to Attach Bookmark Counts on Delicious</title>
         <description><![CDATA[To attach counts which indicate how many people bookmarked my entries to del.icio.us, I wrote a tiny plugin script pasted below. I'm sure that anyone must have written a script like it yet, but it's probably much faster to write it for myself than to google for it.

[delicious-count.pl](/2007/04/11/delicious-count.txt)

    use strict;
    use Digest::MD5 ();
    use MT::Template::Context;

    MT::Template::Context->add_tag(DeliciousCount => sub {
        my $ctx  = shift;
        my $link = $ctx->stash('entry') ? $ctx->stash('entry')->permalink
    	                            : $ctx->stash('blog')->site_url;
        my $digested = Digest::MD5::md5_hex($link);

        return qq{<a href="http://del.icio.us/url/$digested"><img src="http://del.icio.us/feeds/img/savedcount/$digested?aggregate"></a>};
    });

    1;


]]></description>
         <link>http://blog.kentarok.org/2007/04/11/192045.html</link>
         <guid>http://blog.kentarok.org/2007/04/11/192045.html</guid>
        
                  <category domain="http://www.sixapart.com/ns/types#tag">delicious</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">movabletype</category>
        
         <pubDate>Wed, 11 Apr 2007 19:20:45 +0900</pubDate>
      </item>
            <item>
         <title>About a Girl (, Wearing Glasses)</title>
         <description>I absolutely hate those who attach their fingers to glasses when they&apos;re taken photographies. Wearing glasses, especially for girls, has been revaluated recent years, so we often get an oppotunity of looking at such photos. Whenever I encounter such photos, I&apos;m forced to feel annoyed their befavior, sucking arround for the fashion.

I absolutely love girls who&apos;re wearing glasses, especially celluloid-rimmed one, but think they should wear glasses in a dignified manner without attaching their fingers to it.</description>
         <link>http://blog.kentarok.org/2007/04/11/030456.html</link>
         <guid>http://blog.kentarok.org/2007/04/11/030456.html</guid>
        
                  <category domain="http://www.sixapart.com/ns/types#tag">girls</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">thought</category>
        
         <pubDate>Wed, 11 Apr 2007 03:04:56 +0900</pubDate>
      </item>
            <item>
         <title>Post Skype&apos;s Mood Text to Twitter</title>
         <description>I wrote a WSH script, [skype2twitter.js](/2007/04/10/skype2twitter.js), which allows you to post your mood text set on Skype client to [Twitter](http://twitter.com/). After setting your username and password of Twiter, just run it. Then, the script checks your mood text, and posts it to Twitter if changed. 

Be sure that now it just only posts the mood text to twitter, that is, it doesn&apos;t synchronize the mood text and the status on Twitter, which can be updated from Web, IM or the other various places. I expect someone to enhance it to enable to do it.

To tell the truth, what I did with the script is just to mix [this script](http://d.hatena.ne.jp/arikui/20061203#1165072573 &quot;Fuck食場 - SkypeにiTunesで再生してる曲名表示&quot;) and [another one](http://muumoo.jp/news/2007/04/10/0twitterclient.html &quot;Twitterに投稿するJavaScriptを作ってみた(MM Command Sense でも使えるよ)(管理人日記) - むぅもぉ.jp&quot;). Thank to them!

[skype2twitter.js](/2007/04/10/skype2twitter.js)

    // configurations
    var username = &apos;username&apos;;
    var password = &apos;password&apos;;
    var interval = 60000;

    var status;
    var skype = newComObject(&quot;Skype4Com.Skype&quot;);
    var ua    = createUserAgent();

    while (true) {
        if (status == skype.CurrentUserProfile.MoodText) continue;

        status = skype.CurrentUserProfile.MoodText
        postStatus(ua, username, password, status);
        WScript.Sleep(interval);
    }

    function postStatus (ua, username, password, status) {
        try {
            ua.open(
                &apos;POST&apos;,
                &apos;http://twitter.com/statuses/update.json&apos;,
                false,
                username,
                password
            );
            ua.setRequestHeader(&apos;Content-Type&apos;, &apos;application/x-www-form-urlencoded&apos;);
            ua.setRequestHeader(&apos;X-Twitter-Client&apos;, &apos;Skype2Twitter&apos;);
            ua.setRequestHeader(&apos;X-Twitter-Client-Version&apos;, &apos;0.01&apos;);
            ua.setRequestHeader(&apos;X-Twitter-Client-URL&apos;,  &apos;http://blog.kentarok.org/2007/04/10/skype2twitter.xml&apos;);
            ua.send(&apos;status=&apos; + encodeURIComponent(status));

            if(ua.status == 200) {
                print(&apos;Updated: &apos; + status);
            }
            else {
                print(&apos;Error: &apos; + ua.status + &apos; - &apos; + ua.statusText);
            }
        }
        catch (e) {
            print (e.message);
        }
    }

    function createUserAgent () {
        try{
            return new ActiveXObject(&apos;Msxml2.XMLHTTP&apos;);
        }
        catch (e) {
            try{
                return new ActiveXObject(&apos;Microsoft.XMLHTTP&apos;);
            }
            catch(e){
                return null;
            }
        }
    }

    function newComObject (lib) {
        var obj;

        try {
            obj = WScript.CreateObject(lib);
        }
    	catch(e){
            obj = new ActiveXObject(lib);
        }

        return obj;
    }

    function print (string) {
        WScript.Echo(string);
    }
</description>
         <link>http://blog.kentarok.org/2007/04/10/202326.html</link>
         <guid>http://blog.kentarok.org/2007/04/10/202326.html</guid>
        
                  <category domain="http://www.sixapart.com/ns/types#tag">skype</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">twitter</category>
                  <category domain="http://www.sixapart.com/ns/types#tag">wsh</category>
        
         <pubDate>Tue, 10 Apr 2007 20:23:26 +0900</pubDate>
      </item>
      
   </channel>
</rss>
