This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ApplicationController < ActionController::Base | |
after_filter :store_referrer | |
protected | |
def store_referrer | |
return if referred_from_here? or request.format != 'text/html' | |
referrer_data = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{:name => "Alaska", :abbreviation => "AK"}, | |
{:name => "Alabama", :abbreviation => "AL"}, | |
{:name => "American Samoa", :abbreviation => "AS"}, | |
{:name => "Arizona", :abbreviation => "AZ"}, | |
{:name => "California", :abbreviation => "CA"}, | |
{:name => "Colorado", :abbreviation => "CO"}, | |
{:name => "Connecticut", :abbreviation => "CT"}, | |
{:name => "District of Columbia", :abbreviation => "DC"}, | |
{:name => "Delaware", :abbreviation => "DE"}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem 'resque' | |
gem 'resque-scheduler', "~> 2.0.0", :require => 'resque_scheduler' | |
gem 'parallel', "~> 0.5.16" | |
gem 'fb_graph', "~> 2.4.4" | |
gem "twitter" | |
gem 'mongoid' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Gibbon.api_key = ENV["MAILCHIMP_API_KEY"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class EmailCrawler | |
require 'rubygems' | |
require 'mechanize' | |
require 'parallel' | |
attr_accessor :links, :crawl_host, :parsed_sites | |
def crawl(url) | |
@links = Array.new | |
@parsed_sites = Array.new |