Idea 2 app in 1 month<br />A birds eye view of rails app development to cut corners, save time, save money and have fun<br />
Before<br />
After<br />
An idea<br />Ideas are worth nothing<br />Development & Marketing take time<br />Original, simple ideas in 1 Month<br />
The problem<br />“Its hard to follow and join in<br />conversation round a given<br /> topic with social media. Many<br />...
The solution<br />“Use advanced search to curate <br />simple, useful conversations<br />around popular topics.”<br />Find...
Design first<br /><ul><li>I’m not a designer
Easy to build
Simple to understand
Min input for max useful output</li></ul>Mock it up<br />
The design<br />Also radio, confs, news, brands…<br />
Chat room style<br />2 pages, 1 click.<br />
Twitter Search – Poll vs Stream<br /><ul><li>Twitter to do clever stuff
Fast flow of relevant tweets
Quick development
Cheap to host</li></li></ul><li>Polling<br />+ Super simple REST api<br />+ Powerful query language<br />+ No authenticati...
Result speed can vary</li></li></ul><li>Polling Code<br />Powerful Queries<br />iprug OR from:iprug OR “ipswich ruby” OR r...
Streaming<br />+ Near real-time access<br />+ Simple REST api<br />+ Keyword filters<br />+ AND and OR<br /><ul><li>No phr...
Hogs workers/processes
Not well suited to Heroku architecture</li></li></ul><li>Streaming Code<br />Tracking keywords<br />track=iprug, ipswich r...
Streaming In Ruby<br />There’s a gem for that<br />gem install tweetstream<br />Built IN DAEmonizATION<br />TweetStream::D...
Lazy Twitter Solution<br />Simplest: CURB the basic rest api<br />gem install curb<br />status = Timeout::timeout(timeout)...
Lots of DB Writes<br />Optimize import<br />gem install ’activerecord-import’ <br />tweets = []<br />raw_tweet = grab_twee...
Twitter API Quirks<br />- JSON and XML have different data<br />- With Heroku must set a user-agent<br />- Speed Varies<br...
Twitter Sentiment Analysis<br />Bayesian Classification with Classifier gem<br />+ Interesting for age, mood, personality ...
Twitter Sentiment Analysis<br />Natural Language Processing with Ruby Linguistics<br />Find the direct object of the sente...
Twitter Sentiment Analysis<br /><ul><li>Combination of the 2 seems to be successful for some people.
Seems complicated
No I’m too lazy
Cheat: Tweetfeel API</li></ul>http://svc.webservius.com/v1/tweetFeel/tfapi?type=all&wsvKey=mykey&keyword=iprug<br />
Extracting Interesting Stuff<br /><ul><li>I <3 rubular & regex
Detect mentions
Detect links
Resolve links</li></ul>f.match(/@[a-zA-Z0-9_]+/)<br />starts_with?('http:')<br />http://api.longurl.org/v2/expand?url=http...
Upcoming SlideShare
Loading in...5
×

Idea2app

1,596

Published on

My story of building a Ruby on Rails app in one month to solve the problem of following popular conversation on twitter.

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,596
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
4
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Transcript of "Idea2app"

  1. 1. Idea 2 app in 1 month<br />A birds eye view of rails app development to cut corners, save time, save money and have fun<br />
  2. 2. Before<br />
  3. 3. After<br />
  4. 4. An idea<br />Ideas are worth nothing<br />Development & Marketing take time<br />Original, simple ideas in 1 Month<br />
  5. 5. The problem<br />“Its hard to follow and join in<br />conversation round a given<br /> topic with social media. Many<br /> people don’t get twitter”<br />
  6. 6. The solution<br />“Use advanced search to curate <br />simple, useful conversations<br />around popular topics.”<br />Find the interesting stuff easily<br />
  7. 7. Design first<br /><ul><li>I’m not a designer
  8. 8. Easy to build
  9. 9. Simple to understand
  10. 10. Min input for max useful output</li></ul>Mock it up<br />
  11. 11. The design<br />Also radio, confs, news, brands…<br />
  12. 12. Chat room style<br />2 pages, 1 click.<br />
  13. 13. Twitter Search – Poll vs Stream<br /><ul><li>Twitter to do clever stuff
  14. 14. Fast flow of relevant tweets
  15. 15. Quick development
  16. 16. Cheap to host</li></li></ul><li>Polling<br />+ Super simple REST api<br />+ Powerful query language<br />+ No authentication<br /><ul><li>Variable unpublished rate limits
  17. 17. Result speed can vary</li></li></ul><li>Polling Code<br />Powerful Queries<br />iprug OR from:iprug OR “ipswich ruby” OR ruby near:ipswich -wedding<br />SIMPLE API<br />http://search.twitter.com/search.json?q=QUERY&result_type=recent<br />&rpp=100&lang=en<br />
  18. 18. Streaming<br />+ Near real-time access<br />+ Simple REST api<br />+ Keyword filters<br />+ AND and OR<br /><ul><li>No phrases or NOT
  19. 19. Hogs workers/processes
  20. 20. Not well suited to Heroku architecture</li></li></ul><li>Streaming Code<br />Tracking keywords<br />track=iprug, ipswich ruby<br />SIMPLE API<br />http://stream.twitter.com/1/statuses/filter.json?track=iprug,ipswichruby-uYOUR_TWITTER_USERNAME:YOUR_PASSWORD<br />
  21. 21. Streaming In Ruby<br />There’s a gem for that<br />gem install tweetstream<br />Built IN DAEmonizATION<br />TweetStream::Daemon.new(’usr','pwd')<br /> .track('term1’, 'term2') do |status|<br /> puts "#{status.text}"<br /> end<br />
  22. 22.
  23. 23. Lazy Twitter Solution<br />Simplest: CURB the basic rest api<br />gem install curb<br />status = Timeout::timeout(timeout) do<br />r = Curl::Easy.perform(url) do |c| <br />c.headers["User-Agent"] = ”TB/1.1”<br />end<br /> response = r.body_str<br />end<br />
  24. 24. Lots of DB Writes<br />Optimize import<br />gem install ’activerecord-import’ <br />tweets = []<br />raw_tweet = grab_tweets()<br />raw_tweet.times do |t| <br /> tweets << Tweet.new(to_fields(raw_tweet))<br />end<br />Tweet.import tweets<br />
  25. 25. Twitter API Quirks<br />- JSON and XML have different data<br />- With Heroku must set a user-agent<br />- Speed Varies<br />- Query Complexity limits<br />- Unpredictable rate limits<br />
  26. 26.
  27. 27. Twitter Sentiment Analysis<br />Bayesian Classification with Classifier gem<br />+ Interesting for age, mood, personality type<br />- Not so good for sentiment on object<br />require 'classifier’<br />b = Classifier::Bayes.new ’positive', ’negative’<br />b.train_positive ”I <3 my iPhone”<br />b.train_negative ”iPhone can’t make calls #fail”<br />b.classify ”iPhone is a rip off #fail" <br /># returns ’negative'<br />
  28. 28. Twitter Sentiment Analysis<br />Natural Language Processing with Ruby Linguistics<br />Find the direct object of the sentence => “dog”<br />"he is a big dog".en.sentence.object.to_s<br />Find the infinitive verb form of the sentence => “be”<br />"he is a big dog".en.sentence.verb.infinitive<br />
  29. 29. Twitter Sentiment Analysis<br /><ul><li>Combination of the 2 seems to be successful for some people.
  30. 30. Seems complicated
  31. 31. No I’m too lazy
  32. 32. Cheat: Tweetfeel API</li></ul>http://svc.webservius.com/v1/tweetFeel/tfapi?type=all&wsvKey=mykey&keyword=iprug<br />
  33. 33.
  34. 34. Extracting Interesting Stuff<br /><ul><li>I <3 rubular & regex
  35. 35. Detect mentions
  36. 36. Detect links
  37. 37. Resolve links</li></ul>f.match(/@[a-zA-Z0-9_]+/)<br />starts_with?('http:')<br />http://api.longurl.org/v2/expand?url=http%3A%2F%2Fis.gd%2Fw&title=1<br />
  38. 38.
  39. 39. Extracting Video & Images<br /><ul><li>Known video sites youtube, vimeo, livestream
  40. 40. Known image sites yfrog, twitpic, intagram etc
  41. 41. Get thumbnails don’t make your own #lazy</li></ul>class TwitpicResolver < ImageResolver<br /> SEARCH_SNIPPET = "twitpic"<br /> URL = "http://twitpic.com/show/[size]/[id]"<br /> THUMB = "thumb"<br /> LARGE = "large"<br /> ID_EXTRACTOR = /twitpic.com/(.*)/<br />end<br />
  42. 42. UI Stuff<br /><ul><li>SASS & Blueprint = Compass
  43. 43. SASS is awesome, nesting, variables, mixins
  44. 44. SCSS default SASS syntax now
  45. 45. HAML
  46. 46. CSS cropping = No imagemagikfaff
  47. 47. Highcharts.js (not free)</li></li></ul><li>Lazy Admin<br /><ul><li>http://ruby-toolbox.com/
  48. 48. activescaffold
  49. 49. Typus is the laziest</li></ul> - search<br /> - authentication<br /> - paperclip<br /> - configure forms via yaml file <br />
  50. 50.
  51. 51. Lazy Hosting = Heroku<br />git push heroku master<br />
  52. 52. Periodic Workers = Heroku<br />heroku rake tweet:eat<br />namespace :tweet do<br />desc "kick off background jobs”<br /> task :eat => :environment do<br /> require 'workers'<br />Delayed::Job.enqueue(TwitterJob.new()<br />Delayed::Job.enqueue(TwitteratiJob.new())<br />Delayed::Job.enqueue(ExtracterJob.new())<br />Delayed::Job.enqueue(Sentiment.new())<br /> end<br />end<br />
  53. 53. Workers Cont…<br />Delayed::Job.enqueueTwitterJob(), <br /> :run_at => 10.seconds.from_now<br />gem install delayed_job_admin<br />Heroku rake jobs:clear<br />
  54. 54. Heroku not that cheap <br /><ul><li>Shared database 20GB $15
  55. 55. 1 Worker $36
  56. 56. 1 Dyno = Free
  57. 57. Minimum of $56
  58. 58. Will need at least 2 workers and 2 Dynos and soon I’ll need more storage too </li></li></ul><li>The Pragmatic/Lazy Way<br /><ul><li>Reuse, reuse, reuse
  59. 59. 3rd party libraries (highchart, typus, nokogiri)
  60. 60. 3rd party api’s (tweetfeel, longurl)
  61. 61. Keep looking for an easier way
  62. 62. Simple design
  63. 63. Let someone else worry about hosting</li></li></ul><li>The Missing Twitter API<br /><ul><li>Case sensitive search
  64. 64. Term extraction (Zemanta, YQL)
  65. 65. User age, gender, interests
  66. 66. Potty mouth
  67. 67. Traveller?</li></li></ul><li>Did I do it in 1 month?<br /><ul><li>Well kind of…
  68. 68. Live on Heroku eating tweets
  69. 69. http://falling-galaxy-55.heroku.com/
  70. 70. Time consuming adding data
  71. 71. Some conversations work great, some don’t
  72. 72. Need a bit more filtering cleverness
  73. 73. Target is a great way of following SXSW
  74. 74. Then onto rating brands, products, mobile…</li></li></ul><li>Adverts<br /><ul><li>Go to talkbackhq.com (next week) 
  75. 75. Interested in getting involved?
  76. 76. Suffolk Twestival @twestuffolk. Evening of Thu 24th March @ Brewery Tap</li>
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×