Successfully reported this slideshow.
Your SlideShare is downloading. ×

earthquake.gem

Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
earthquake.gem
     @jugyo
@jugyo

                     I like

• Ruby
• Twitter
Introduction

YouTube videos are no longer supported on SlideShare

View original on YouTube

Upcoming SlideShare
Modern Perl Toolchain
Modern Perl Toolchain
Loading in …3
×

Check these out next

1 of 74 Ad
Advertisement

More Related Content

Advertisement
Advertisement

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 the earthquake.gem
  6. 6. What ?
  7. 7. What is the earthquake.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 don't know !
  24. 24. just a inspiration !
  25. 25. and easy to remember
  26. 26. Feature
  27. 27. Using Streaming API
  28. 28. It's like `tail -f` for twitter.com
  29. 29. Desktop Notification
  30. 30. growl gntp notify.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. queue output
  41. 41. queue output Growl
  42. 42. input queue output
  43. 43. input queue output
  44. 44. input queue output 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!' end end
  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 end end
  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 end end
  53. 53. Plugin
  54. 54. You can install plugins from gist.github.com
  55. 55. :plugin_install https://gist.github.com/899506
  56. 56. That's it!
  57. 57. That's it!
  58. 58. Thanks!
  59. 59. Any question? ?

Editor's Notes

  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n

×