Diese Präsentation wurde erfolgreich gemeldet.
Wir verwenden Ihre LinkedIn Profilangaben und Informationen zu Ihren Aktivitäten, um Anzeigen zu personalisieren und Ihnen relevantere Inhalte anzuzeigen. Sie können Ihre Anzeigeneinstellungen jederzeit ändern.
earthquake.gem     @jugyo
@jugyo                     I like• Ruby• Twitter
Introduction
Introduction
I talk about theearthquake.gem
What       ?
What is theearthquake.gem?
Twitter terminal client with  Streaming API support                        cool!
written in Ruby                  ruby!
Demo
Why      ?
Why did I create this?
hmm
3.11       !
earthquake!!
I thought about death
I thought about death
What should I do?
Aha!
I need a new Twitter Client!
I need real-time   information
Why did I name earthquake?                 ?
I dont know               !
just a inspiration                     !
and easy to remember
Feature
Using Streaming API
Its like `tail -f` for    twitter.com
Desktop Notification
growl             gntpnotify.gem             notify-send             libnotify
Extensible with Ruby
Usage
install ruby 1.9.2    using rvm
rvm readline package is       required
$ rvm package install openssl$ rvm package install readline$ rvm install 1.9.2   --with-openssl-dir=$HOME/.rvm/usr   --wit...
gem install earthquake
$ earthquake
Detail
queue
queueoutput
queue        outputGrowl
input          queueoutput
input          queueoutput
input             queueoutput          output_filter
input_filter         input                    queue      output                 output_filter
earthquake directory is    "~/.earthquake"
define command
Earthquake.init do  command :hello do    twitter.udpate Hello World!  endend
define output_filter
Earthquake.init do  output_filter do |item|    if item["text"] && item["_stream"]      item["text"] =~ /ruby/i ? true : fa...
define input_filter
Earthquake.init do  ...  input_filter do |text|    if text =~ /^:(update|reply|retweet|message)/ && text.size > 140      p...
Plugin
You can install plugins from   gist.github.com
:plugin_install https://gist.github.com/899506
Thats it!
Thats it!
Thanks!
Any question?                ?
earthquake.gem
earthquake.gem
earthquake.gem
earthquake.gem
earthquake.gem
earthquake.gem
earthquake.gem
earthquake.gem
earthquake.gem
earthquake.gem
earthquake.gem
earthquake.gem
earthquake.gem
earthquake.gem
Nächste SlideShare
Wird geladen in …5
×

earthquake.gem

10.024 Aufrufe

Veröffentlicht am

the demo movie is here http://www.youtube.com/watch?v=S2KtBGrIe5c

Veröffentlicht in: Technologie, Design

earthquake.gem

  1. 1. earthquake.gem @jugyo
  2. 2. @jugyo I like• Ruby• Twitter
  3. 3. Introduction
  4. 4. Introduction
  5. 5. I talk about theearthquake.gem
  6. 6. What ?
  7. 7. What is theearthquake.gem?
  8. 8. Twitter terminal client with Streaming API support cool!
  9. 9. written in Ruby ruby!
  10. 10. Demo
  11. 11. Why ?
  12. 12. Why did I create this?
  13. 13. hmm
  14. 14. 3.11 !
  15. 15. earthquake!!
  16. 16. I thought about death
  17. 17. I thought about death
  18. 18. What should I do?
  19. 19. Aha!
  20. 20. I need a new Twitter Client!
  21. 21. I need real-time information
  22. 22. Why did I name earthquake? ?
  23. 23. I dont know !
  24. 24. just a inspiration !
  25. 25. and easy to remember
  26. 26. Feature
  27. 27. Using Streaming API
  28. 28. Its like `tail -f` for twitter.com
  29. 29. Desktop Notification
  30. 30. growl gntpnotify.gem notify-send libnotify
  31. 31. Extensible with Ruby
  32. 32. Usage
  33. 33. install ruby 1.9.2 using rvm
  34. 34. rvm readline package is required
  35. 35. $ rvm package install openssl$ rvm package install readline$ rvm install 1.9.2 --with-openssl-dir=$HOME/.rvm/usr --with-readline-dir=$HOME/.rvm/usr rvm install
  36. 36. gem install earthquake
  37. 37. $ earthquake
  38. 38. Detail
  39. 39. queue
  40. 40. queueoutput
  41. 41. queue outputGrowl
  42. 42. input queueoutput
  43. 43. input queueoutput
  44. 44. input queueoutput output_filter
  45. 45. input_filter input queue output output_filter
  46. 46. earthquake directory is "~/.earthquake"
  47. 47. define command
  48. 48. Earthquake.init do command :hello do twitter.udpate Hello World! endend
  49. 49. define output_filter
  50. 50. Earthquake.init do output_filter do |item| if item["text"] && item["_stream"] item["text"] =~ /ruby/i ? true : false else true end endend
  51. 51. define input_filter
  52. 52. Earthquake.init do ... input_filter do |text| if text =~ /^:(update|reply|retweet|message)/ && text.size > 140 puts "shortening urls...".c(:info) text.gsub(URI.regexp([http,https])) do |url| query = "domain=#{config[:bitly][:domain]}&longUrl=#{URI.encode(url)}&login=#{config[:bitly][:username]}&apiKey=#{config[:bitly][:api_key]}" result = JSON.parse(Net::HTTP.get("api.bit.ly", "/v3/shorten?#{query}")) if result[status_code] == 200 result[data][url] else url end end else text end url shorter with bit.ly endend
  53. 53. Plugin
  54. 54. You can install plugins from gist.github.com
  55. 55. :plugin_install https://gist.github.com/899506
  56. 56. Thats it!
  57. 57. Thats it!
  58. 58. Thanks!
  59. 59. Any question? ?

×