SlideShare a Scribd company logo
Termtter

      Introduce a Termtter
        Sora HARAKAMI
       sorah@tubusu.net
2010-03-28 Online.sg #10 (onsp2)
Hi

•
•          Online.sg #10 (sp#2)
    rubysapporo
•                                       RubySapporo
            Lingr



•   Lingr                  URL(
                           )

•   http://chat.onlinesg.org/
•   http://lingr.com/room/onsg (Lingr           )
•              ( Sora HARAKAMI )

•   http://codnote.net/
•     1(             2)

•              (    80+)

•   Rubyist

•   termtter
Twitter

• What’s Happening?
    --- #onsg10 now.
• Twitter

•           (“ ” or true)
•   Twitter API   TL



•   API

•

•
(               )
•   Twit
•   Tween
•   NatsuLion, NatsuLiPhone
•   YoruFukurou
•   Web (twitter.com)
•   movatwitter
•   Echofon
•   Vim
•   telnet
•   TwitterIRCGateway
•   tig.rb
Terminal Twitter

• Terminal   Twitter

• ssh
Termtter
<(@)//_
   
 Termtter
Termtter
• Ruby   Twitter

•
•
•
•
•
•
•
•
Photo taken by niallkennedy
http://www.flickr.com/photos/niallkennedy/5092992/
• json 1.1.3+
• highline 1.5.0+
• termcolor 1.0.0+
• rubytter 0.11.0+
• notify 0.2.1+
• $ gem install json highline termcolor
  rubytter notify
• gem install termtter
Onsg10 Intro Termtter
(   )
•   git

•

•   git clone git://github.com/jugyo/termtter
•   export PATH=/path/to/termtter/bin:$PATH
•          zshrc      bashrc

•
•          git pull
Photo taken by kjarrett
http://www.flickr.com/photos/kjarrett/1805317057/
• `termtter`
•
• ~/.termtter/config
• ~/.termtter/config
• Ruby
•                     (
             )

• config.password
•   #                                         termtter
                                        #
•   config.update_interval -- TL
•   config.timeout --
•   config.retry --
•   config.enable_ssl -- SSL
•   config.plugins.keyword.keywords --               TL

•   config.confirm --                     (re
                        :-( )
Photo taken by Kevin Steele
http://www.flickr.com/photos/kevinsteele/463276653/
• `termtter`
•

• TL
•             ,

•   u, update
•   r, replies
•   l, list
•   show
•   re, reply
•   rt, retweet
•   fib
u,update

• Twitter post
• >u
• updated =>
r, replies


• replies
• >r
l, list
•            TL

•   >l
    TL

•   > l {ID}
    @{ID} TL

•   > l {ID}/{SLUG}
    Twitter
                  http://twitter.com/{ID}/{SLUG}

•   > l /{SLUG}
show
•   > show {TYPABLE_ID}
•          typable_id post

•   typable_id tig

•   (10:23:12) [$bc] akazora:



•   (10/03/21 10:49) [$hc] sora_h: @akazora hi. (reply_to
    [$ak])
•                     typable_id
re, reply
• post reply
• in_reply_to_status_id
• reply
• > re {TYPABLE_ID} hi!
  replied => hi!
rt, retweet
•   RT

•        RT

•   QT

•   config.plugins.retweet.official_retweet = false    RT

•   config.plugins.retweet.quotetweet = true QT       (
    RT          )

•        RT                                     RT

•   > rt {TYPABLE_ID} {COMMENT}
fib

• Twitter
• fib {n}
•                n
  tweet
• termtter

•            git
• config   Termtter::Client.init do |t| ~ end
           t.plug ‘plugin ’

•              config
      t.plug                         #



•
• easy_post
• growl, growl2
• notify-send, notify-send2, notify-send3
• footer
• channel
• story
easy_post
•   TIG

•   > hogehoge
•     hogehoge      commandnotfound



•         re hoge
      u
growl, growl2
•        growl

•   TL           growl

•
•   growl -- ruby-growl   (                )

•   growl2 -- rubycocoa   meow

•   growl

•                growl           network
notify-send,notify-
    send2, notify-send3
•   growl                  tl

•   notify-send -- http://jugyo.org/blog/3850
         growl ubuntu      notify-send

•   notify-send2 --



•   notify-send3 -- `notify-send`
footer
•
•   config.footer = “     ”

•
•   footer

•
•                               termtter

•   footer
channel

•
•
    > c channel


•
channel(2)
•
•   @{ID} --                     TL

•                   _search --

•   replies -- replies
•   main -- home_timeline
•              --
    ( /watch           sora_h/watch   )
channel(3)
•
• config.plugins.channel.auto_reload_channel
  s = { :”               ” =>         }

• :hoge              :@hoge      :/list
                    :”               ”
story
•
•
    config.plugins.stdout.sweets


    (           : jugyo ujm sora_h lingr_termtter
    termtter hitode909 nanki sixeight)
story
---               sora_h

                                               termtter
                                       nanki
                                      jugyo



                       Twitter

                                                           replies


Twitter


                                      Twitter


                                                          termtter
      hitode909                  fib
                  g
• Ruby
• /path/to/termtter/lib/plugins/
  foobar.rb

• load
API
•   Termtter::Client.register_command
•   Termtter::Client.register_hook
•   Termtter::Client.output
•   Termtter::Client.add_task
•   Termtter::Client.execute
•   Termtter::API.twitter
•   config. {...} .set_default
Termtter::Client.
     register_command
• command
•   Termtter::Client.register_command(
     :name => :foo, #
     :alias => :f, #
     :help => [‘foo, f’, ‘bar’] #
     :exec => lambda { |arg| #      lambda   arg
         ...
    })
Termtter::Client.
             register_hook
• hook
• hook
•   Termtter::Client.register_hook(
     :name => :piyopiyo, #
        :point => :foobar, #hook
        :exec => lambda {...} #    hook
    )
hook points
   • point
      Point             Args          Detail
:filter_for_output   statuses, event
:modify_arg_for_{
                  command , arg
              }                        arg
:pre_exec_{
                    command , arg
          }
:post_exec_{
                    command , arg
              }
    :initialize
Termtter::Client.output

• statuses
• statuses => [status, status, ...]
  statuses
  Termtter::API.twitter.home_timeline
                ok
Termtter::Client.add_ta
          sk
•
• crontab
• Termtter::Client.add_task(
      :name => :foobar, #
      :interval => 10 #        (   )
  )
Termtter::Client.execut
           e

•
• Termtter::Client.execute(“some_command
  some_arg”)
Termtter::API.twitter

• Rubytter
• Termtter::API.twitter.update(“hoge”)
•
config. {...} .set_default
•                config.plugins.



• config.plugins.hoge.set_default(:foo,:bar)

•                config.plugins.hoge.foo :bar
•
•
    story   fib
• lib/termtter         core

• lib/plugins        plugin

• lib/plugins/defaults
               plugin(
                              )
core


• core   core client.rb

•
•

•
•
• ujihisa
• [2010/3/18 6:42:20 AM] &ujihisa25:
  termtter             =

• [2010/3/18 6:42:32 AM] &ujihisa25:
                            termtter
• ujihisa
• [2010/3/18 6:42:20 AM] &ujihisa25:
  termtter             =

• [2010/3/18 6:42:32 AM] &ujihisa25:
                            termtter
•
sorah


•
• fork   commit   pull request

•
pull request

• github
  http://github.com/jugyo/termtter
     fork     clone

•                              commit&push

• http://github.com/jugyo/termtter
                   pull request
pull request



• Spec
pull request



• Spec
•
pull request



• Spec
•
pull request



• Spec
•              termtter
pull request



• Spec
•              termtter
pull request


• Spec
•              termtter
pull request

• Spec
•                 termtter


  http://ujm.tumblr.com/post/232805392/
  termtter-pull-spec
termtter room

• http://lingr.com/room/termtter
•             termtter
• termtter
•
end
end
Lingr   online.sg
   http://chat.onlinesg.org/




            end
few
less -> few
few


• gem install few
• git clone git://github.com/ujihisa/few
• git        /path/to/few/bin PATH
demo

More Related Content

KEY
Use cases in the code with AOP
Andrzej Krzywda
 
PDF
Don't Go, Java!
Christoph Engelbert
 
PDF
What is few?
Shota Fukumori
 
PDF
No gain is so certain as that which proceeds from the economical use of what ...
Rhea Myers
 
PDF
ORV NAHSE Newsletter - Winter 2009
Yonathan Kebede, FACHE
 
PDF
Google Docs Student Set Up
Liz Becker
 
KEY
ぼくとわたしのVim
Shota Fukumori
 
KEY
Less to Few
Shota Fukumori
 
Use cases in the code with AOP
Andrzej Krzywda
 
Don't Go, Java!
Christoph Engelbert
 
What is few?
Shota Fukumori
 
No gain is so certain as that which proceeds from the economical use of what ...
Rhea Myers
 
ORV NAHSE Newsletter - Winter 2009
Yonathan Kebede, FACHE
 
Google Docs Student Set Up
Liz Becker
 
ぼくとわたしのVim
Shota Fukumori
 
Less to Few
Shota Fukumori
 
Ad

Onsg10 Intro Termtter