Lock in $30 Savings on PRO—Offer Ends Soon! ⏳

Hungrlr

mikesilvis
July 12, 2012
62

 Hungrlr

The dead-simple way to check your Twitter, Facebook, GitHub, & Instagram activity with just one click.

mikesilvis

July 12, 2012
Tweet

Transcript

  1. the #twitter class Message < Growl validates_presence_of :comment, message: "You

    must provide a message." validates_length_of :comment, :maximum => 512 before_save :send_to_services def send_to_services services = parse_hashtags services.each do |service| case service when 'twitter' then send_twitter_update end end end def send_twitter_update return if comment.length > 180 client = user.twitter_client client.update(comment) if client end def icon "glyphicons/glyphicons_010_envelope.png" end end Thursday, July 12, 12
  2. the #twitter fiasco class Message < Growl validates_presence_of :comment, message:

    "You must provide a message." validates_length_of :comment, :maximum => 512 before_save :send_to_services def send_to_services services = parse_hashtags services.each do |service| case service when 'twitter' then send_twitter_update end end end def send_twitter_update return if comment.length > 180 client = user.twitter_client client.update(comment) if client end def icon "glyphicons/glyphicons_010_envelope.png" end end Thursday, July 12, 12
  3. the #twitter post-mortem Description: The Tweet Heard Around the World.

    Literally. Date: May 24, 2012 Incident Commander: Ed Weng Thursday, July 12, 12
  4. the #twitter fiasco class Message < Growl validates_presence_of :comment, message:

    "You must provide a message." validates_length_of :comment, :maximum => 512 before_save :send_to_services def send_to_services return unless original_growl? services = parse_hashtags services.each do |service| case service when 'twitter' then send_twitter_update end end end def send_twitter_update return if comment.length > 180 client = user.twitter_client client.update(comment) if client end def icon "glyphicons/glyphicons_010_envelope.png" end end Thursday, July 12, 12
  5. trending topics class Topic < ActiveRecord::Base attr_accessible :name, :user, :user_id

    belongs_to :user scope :by_date, order("original_created_at DESC") TEN_MINUTES = BigDecimal.new("600") HALF_HOUR = BigDecimal.new("1800") ONE_HOUR = BigDecimal.new("3600") def self.trending_topics trending_topics = { } collect_topic_speeds.each do |topic| puts topic.inspect trending_topics[ topic[:name] ] = topic[:acceleration] * 4 + topic[:velocity] * 2 + topic[:count] end trending_topics.sort{ |a, b| b[1]<=>a[1] } end def self.hot_topics Topic.count(group: "name", order: 'count(*) DESC', limit: 100) end def self.collect_topic_speeds hot_topics.collect do |name, number_of_growls| { name: name, count: number_of_growls, velocity: velocity(name, Time.now), acceleration: acceleration(name, Time.now) } end end Thursday, July 12, 12