Skip to content

Commit

Permalink
bunch of config changes
Browse files Browse the repository at this point in the history
  • Loading branch information
blake41 committed Feb 25, 2012
1 parent ddba01c commit e1bc3d9
Show file tree
Hide file tree
Showing 7 changed files with 89 additions and 120 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
db/*.sqlite3
log/*.log
tmp/
db/schema.rb
Gemfile.lock
config/database.yml
29 changes: 13 additions & 16 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,18 @@ source 'http://rubygems.org'

gem 'rails', '3.0.9'
gem 'typhoeus'
gem 'hashie'
gem 'rake'
gem 'ruby-debug19'
gem 'cheat'
gem 'mysql2', '0.2.6'
gem 'wirble'
gem 'hirb'
gem 'thin'
gem 'awesome_print'
gem 'what_methods'
gem 'map_by_method'
gem 'will_paginate'
gem 'resque'
gem 'whenever'
gem 'eventmachine'
gem 'em-http-request'
gem 'haml'
gem 'ruby-prof'
gem 'metrical'
gem 'crewait', :git => 'https://github.com/blake41/crewait'
gem 'looksee'
gem 'rspec-rails'
gem 'crewait'#, :git => 'https://github.com/blake41/crewait'
gem 'yajl-ruby', :require => 'yajl'

group :test do
# group :test do
gem 'mocha'
gem 'rspec-rails'
gem 'factory_girl_rails'
Expand All @@ -37,4 +24,14 @@ group :test do
gem 'webmock'
gem 'hash_dealer'
gem 'colorize'
end
# end

# group :development do
gem 'wirble'
gem 'hirb'
gem 'awesome_print'
gem 'what_methods'
gem 'map_by_method'
gem 'ruby-debug19'
# end

83 changes: 3 additions & 80 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
GIT
remote: https://github.com/blake41/crewait
revision: 5eb52288fb4bc790c2316cc50bd3bd750bba2186
specs:
crewait (0.1.6)

GEM
remote: http://rubygems.org/
specs:
Saikuro (1.1.0)
ZenTest (4.6.2)
aaronh-chronic (0.3.9)
abstract (1.0.0)
Expand Down Expand Up @@ -40,24 +33,14 @@ GEM
addressable (2.2.6)
archive-tar-minitar (0.5.2)
arel (2.0.10)
arrayfields (4.7.4)
autotest (4.4.6)
ZenTest (>= 4.4.1)
awesome_print (1.0.1)
builder (2.1.2)
cheat (1.3.0)
chronic (0.3.0)
churn (0.0.13)
chronic (>= 0.2.3)
hirb
json_pure
main
ruby_parser (~> 2.0.4)
sexp_processor (~> 3.0.3)
colored (1.2)
colorize (0.5.8)
columnize (0.3.5)
crack (0.3.1)
crewait (0.1.7)
daemons (1.1.4)
diff-lcs (1.1.3)
em-http-request (1.0.0)
Expand All @@ -76,13 +59,6 @@ GEM
factory_girl (~> 2.3.0)
railties (>= 3.0.0)
fakeweb (1.3.0)
fattr (2.2.0)
flay (1.4.3)
ruby_parser (~> 2.0)
sexp_processor (~> 3.0)
flog (2.5.3)
ruby_parser (~> 2.0)
sexp_processor (~> 3.0)
guard (0.8.8)
thor (~> 0.14.6)
guard-rspec (0.5.8)
Expand All @@ -92,50 +68,25 @@ GEM
activesupport
colorize
i18n
hashie (1.2.0)
hirb (0.6.0)
http_parser.rb (0.5.3)
i18n (0.5.0)
json (1.6.3)
json_pure (1.6.3)
linecache19 (0.5.12)
ruby_core_source (>= 0.1.4)
looksee (1.0.3)
mail (2.2.19)
activesupport (>= 2.3.6)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
main (4.6.0)
arrayfields (>= 4.7.4)
fattr (>= 2.1.0)
map (>= 2.0.0)
map (4.7.1)
map_by_method (0.8.3)
metaclass (0.0.1)
metric_fu (2.1.1)
Saikuro (>= 1.1.0)
activesupport (>= 2.0.0)
chronic (~> 0.3.0)
churn (>= 0.0.7)
flay (>= 1.2.1)
flog (>= 2.3.0)
rails_best_practices (>= 0.6.4)
rcov (>= 0.8.3.3)
reek (>= 1.2.6)
roodi (>= 2.1.0)
syntax
metrical (0.0.7)
main (~> 4.6.0)
metric_fu (~> 2.1.1)
rake
mime-types (1.17.2)
mocha (0.10.0)
metaclass (~> 0.0.1)
multi_json (1.0.4)
mysql2 (0.2.6)
polyglot (0.3.3)
progressbar (0.9.2)
rack (1.2.4)
rack-mount (0.6.14)
rack (>= 1.0.0)
Expand All @@ -149,37 +100,23 @@ GEM
activesupport (= 3.0.9)
bundler (~> 1.0)
railties (= 3.0.9)
rails_best_practices (1.5.3)
activesupport
colored
erubis
i18n
progressbar
sexp_processor
railties (3.0.9)
actionpack (= 3.0.9)
activesupport (= 3.0.9)
rake (>= 0.8.7)
rdoc (~> 3.4)
thor (~> 0.14.4)
rake (0.9.2.2)
rcov (0.9.11)
rdoc (3.11)
json (~> 1.4)
redis (2.2.2)
redis-namespace (1.0.3)
redis (< 3.0.0)
reek (1.2.8)
ruby2ruby (~> 1.2)
ruby_parser (~> 2.0)
sexp_processor (~> 3.0)
resque (1.19.0)
multi_json (~> 1.0)
redis-namespace (~> 1.0.2)
sinatra (>= 0.9.2)
vegas (~> 0.1.2)
roodi (2.1.0)
ruby_parser
rspec (2.7.0)
rspec-core (~> 2.7.0)
rspec-expectations (~> 2.7.0)
Expand All @@ -201,19 +138,11 @@ GEM
columnize (>= 0.3.1)
linecache19 (>= 0.5.11)
ruby-debug-base19 (>= 0.11.19)
ruby-prof (0.10.8)
ruby2ruby (1.3.1)
ruby_parser (~> 2.0)
sexp_processor (~> 3.0)
ruby_core_source (0.1.5)
archive-tar-minitar (>= 0.5.2)
ruby_parser (2.0.6)
sexp_processor (~> 3.0)
sexp_processor (3.0.8)
sinatra (1.2.7)
rack (~> 1.1)
tilt (< 2.0, >= 1.2.2)
syntax (1.0.0)
tilt (>= 1.2.2, < 2.0)
thin (1.3.1)
daemons (>= 1.0.9)
eventmachine (>= 0.12.6)
Expand Down Expand Up @@ -246,29 +175,23 @@ PLATFORMS
DEPENDENCIES
autotest
awesome_print
cheat
colorize
crewait!
crewait
em-http-request
eventmachine
factory_girl_rails
fakeweb
guard-rspec
haml
hash_dealer
hashie
hirb
looksee
map_by_method
metrical
mocha
mysql2 (= 0.2.6)
rails (= 3.0.9)
rake
resque
rspec-rails
ruby-debug19
ruby-prof
thin
typhoeus
vcr
Expand Down
12 changes: 6 additions & 6 deletions app/workers/get_politicians_tweets.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,23 @@ def self.perform(user_id, start_page = 1)
@user = Politician.find(user_id)
@screen_name = @user.screen_name
start_page.upto(10000) do |page|
if GetPoliticiansTweets.base_run_done?
if self.base_run_done?
tweets = TweetsByPolitician.where(:screen_name => @screen_name).order("tweet_id DESC")
responseobj= GetPoliticiansTweets.get_newest_tweets(page, tweets)
responseobj= self.get_newest_tweets(page, tweets)
else
responseobj = GetPoliticiansTweets.get_first_tweets(page)
responseobj = self.get_first_tweets(page)
end
if Request.error_check(responseobj, page, @screen_name)
puts "Error Code #{responseobj.code} on page #{page}"
Resque.enqueue(GetPoliticiansTweets, user_id, page)
Resque.enqueue(self, user_id, page)
break
else
response = JSON.parse(responseobj.body)
if response.count ==0
GetPoliticiansTweets.empty_results
self.empty_results
break
else
GetPoliticiansTweets.save_results(response)
self.save_results(response)
end
end
end
Expand Down
23 changes: 5 additions & 18 deletions config/database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,24 @@
development:
adapter: mysql2
encoding: utf8
database: devel_gillibrand
database: devel_gillibrand2
username: root
socket: <%=
['/tmp/mysql.sock', # os x
'/var/run/mysqld/mysqld.sock'] # ubuntu/debian
.select { |f| File.exist? f }.first %>

host: localhost

# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
amazon:
adapter: mysql2
encoding: utf8
database: devel_gillibrand
username: politwit
password: mysqlpass123
host: politwit-rds.cxkme1xdnjsi.us-east-1.rds.amazonaws.com

test:
adapter: mysql2
encoding: utf8
database: test_gillibrand
username: root
password:
socket: /tmp/mysql.sock
host: localhost

production:
adapter: mysql2
encoding: utf8
database: prod_gillibrand
username: root
password:
socket: /tmp/mysql.sock

host: localhost
Binary file removed dump.rdb
Binary file not shown.
59 changes: 59 additions & 0 deletions politicians.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
-- MySQL dump 10.13 Distrib 5.1.59, for apple-darwin10.3.0 (i386)
--
-- Host: localhost Database: devel_gillibrand
-- ------------------------------------------------------
-- Server version 5.1.59

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `politicians`
--

DROP TABLE IF EXISTS `politicians`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `politicians` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`screen_name` varchar(255) DEFAULT NULL,
`user_id` int(11) DEFAULT NULL,
`full_name` varchar(255) DEFAULT NULL,
`party` varchar(255) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`base_run_done` int(11) DEFAULT NULL,
`search_base_run` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `index_politicians_on_user_id` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=101 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `politicians`
--

LOCK TABLES `politicians` WRITE;
/*!40000 ALTER TABLE `politicians` DISABLE KEYS */;
INSERT INTO `politicians` VALUES (1,'MicheleBachmann',18217624,'Michele Bachmann','R','2011-10-15 19:18:27','2011-10-15 19:43:24',NULL,NULL),(2,'DrRandPaul',39834947,'Rand Paul','R','2011-10-15 19:47:11','2011-10-15 19:48:40',NULL,NULL),(5,'kausmickey',NULL,NULL,'D',NULL,NULL,NULL,NULL),(6,'buckmaster2010',NULL,NULL,'D',NULL,NULL,NULL,NULL),(7,'freilichd',NULL,NULL,'D',NULL,NULL,NULL,NULL),(8,'GoGreene2010',NULL,NULL,'D',NULL,NULL,NULL,NULL),(9,'hoffman4IL',NULL,NULL,'D',NULL,NULL,NULL,NULL),(10,'BrianQuintana',NULL,NULL,'D',NULL,NULL,NULL,NULL),(11,'RandyParraz',NULL,NULL,'D',NULL,NULL,NULL,NULL),(12,'williamgbarnes',NULL,NULL,'D',NULL,NULL,NULL,NULL),(13,'JohnDoughertyUS',NULL,NULL,'D',NULL,NULL,NULL,NULL),(14,'Potter4Senate',NULL,NULL,'D',NULL,NULL,NULL,NULL),(15,'LisaForKansas',NULL,NULL,'D',NULL,NULL,NULL,NULL),(16,'EdenForAZ',NULL,NULL,'D',NULL,NULL,NULL,NULL),(17,'CalforNC',NULL,NULL,'D',NULL,NULL,NULL,NULL),(18,'mauriceferre',NULL,NULL,'D',NULL,NULL,NULL,NULL),(19,'Haley4Senate',NULL,NULL,'D',NULL,NULL,NULL,NULL),(20,'GoodeForSenate',NULL,NULL,'D',NULL,NULL,NULL,NULL),(21,'CheryleJackson',NULL,NULL,'D',NULL,NULL,NULL,NULL),(22,'SamGranato',NULL,NULL,'D',NULL,NULL,NULL,NULL),(23,'sullivan4senate',NULL,NULL,'D',NULL,NULL,NULL,NULL),(24,'Greene4Florida',NULL,NULL,'D',NULL,NULL,NULL,NULL),(25,'Mongiardo2010',NULL,NULL,'D',NULL,NULL,NULL,NULL),(26,'tlfiegen',NULL,NULL,'D',NULL,NULL,NULL,NULL),(27,'KrauseForIowa',NULL,NULL,'D',NULL,NULL,NULL,NULL),(28,'JenniferBrunner',NULL,NULL,'D',NULL,NULL,NULL,NULL),(29,'Elaine4NC',NULL,NULL,'D',NULL,NULL,NULL,NULL),(30,'BillHalter',NULL,NULL,'D',NULL,NULL,NULL,NULL),(31,'RoxanneConlin',NULL,NULL,'D',NULL,NULL,NULL,NULL),(32,'Giannoulias',NULL,NULL,'D',NULL,NULL,NULL,NULL),(33,'RobinCarnahan',NULL,NULL,'D',NULL,NULL,NULL,NULL),(34,'Andrewromanoff',NULL,NULL,'D',NULL,NULL,NULL,NULL),(35,'rodneyglassman',NULL,NULL,'D',NULL,NULL,NULL,NULL),(36,'McAdamsforAK',NULL,NULL,'D',NULL,NULL,NULL,NULL),(37,'FisherForOhio',NULL,NULL,'D',NULL,NULL,NULL,NULL),(38,'DickBlumenthal',NULL,NULL,'D',NULL,NULL,NULL,NULL),(39,'ConwayforKY',NULL,NULL,'D',NULL,NULL,NULL,NULL),(40,'chuckdevore',NULL,NULL,'R',NULL,NULL,NULL,NULL),(41,'marcorubio',NULL,NULL,'R',NULL,NULL,NULL,NULL),(42,'SharronAngle',NULL,NULL,'R',NULL,NULL,NULL,NULL),(43,'ToomeyForSenate',NULL,NULL,'R',NULL,NULL,NULL,NULL),(44,'JoeWMiller',NULL,NULL,'R',NULL,NULL,NULL,NULL),(45,'ChristineOD',NULL,NULL,'R',NULL,NULL,NULL,NULL),(46,'DrRandPaul',NULL,NULL,'R',NULL,NULL,NULL,NULL),(47,'robportman',NULL,NULL,'R',NULL,NULL,NULL,NULL),(48,'JimRutledge2010',NULL,NULL,'R',NULL,NULL,NULL,NULL),(49,'hughesforsenate',NULL,NULL,'R',NULL,NULL,NULL,NULL),(50,'GilbertBaker',NULL,NULL,'R',NULL,NULL,NULL,NULL),(51,'Ron4Senate',NULL,NULL,'R',NULL,NULL,NULL,NULL),(52,'MarlinStutzman',NULL,NULL,'R',NULL,NULL,NULL,NULL),(53,'DannyTarkanian',NULL,NULL,'R',NULL,NULL,NULL,NULL),(54,'BuckForColorado',NULL,NULL,'R',NULL,NULL,NULL,NULL),(55,'RobSimmons',NULL,NULL,'R',NULL,NULL,NULL,NULL),(56,'akersforsenate',NULL,NULL,'R',NULL,NULL,NULL,NULL),(57,'JayS2629',NULL,NULL,'R',NULL,NULL,NULL,NULL),(58,'Sue_Lowden',NULL,NULL,'R',NULL,NULL,NULL,NULL),(59,'TimBridgewater',NULL,NULL,'R',NULL,NULL,NULL,NULL),(60,'ayotte2010',NULL,NULL,'R',NULL,NULL,NULL,NULL),(61,'DanCoats',NULL,NULL,'R',NULL,NULL,NULL,NULL),(62,'DinoRossiWA',NULL,NULL,'R',NULL,NULL,NULL,NULL),(63,'Huffman2010',NULL,NULL,'R',NULL,NULL,NULL,NULL),(64,'curtiscoleman',NULL,NULL,'R',NULL,NULL,NULL,NULL),(65,'janenortonforco',NULL,NULL,'R',NULL,NULL,NULL,NULL),(66,'LindaForSenate',NULL,NULL,'R',NULL,NULL,NULL,NULL),(67,'JoeForUSSenate',NULL,NULL,'R',NULL,NULL,NULL,NULL),(68,'ovidein2010',NULL,NULL,'R',NULL,NULL,NULL,NULL),(69,'Townsend4NY',NULL,NULL,'R',NULL,NULL,NULL,NULL),(70,'Chachas4Nevada',NULL,NULL,'R',NULL,NULL,NULL,NULL),(71,'dbwestlake',NULL,NULL,'R',NULL,NULL,NULL,NULL),(72,'malpass4senate',NULL,NULL,'R',NULL,NULL,NULL,NULL),(73,'schiffforsenate',NULL,NULL,'R',NULL,NULL,NULL,NULL),(74,'VoteConrad',NULL,NULL,'R',NULL,NULL,NULL,NULL),(75,'hoeven4senate',NULL,NULL,'R',NULL,NULL,NULL,NULL),(76,'votechad',NULL,NULL,'R',NULL,NULL,NULL,NULL),(77,'jdhayworth2010',NULL,NULL,'R',NULL,NULL,NULL,NULL),(78,'KYTrey',NULL,NULL,'R',NULL,NULL,NULL,NULL),(79,'Britton4VT',NULL,NULL,'R',NULL,NULL,NULL,NULL),(80,'BillJohnson2010',NULL,NULL,'R',NULL,NULL,NULL,NULL),(81,'Bill_Escoffery',NULL,NULL,'R',NULL,NULL,NULL,NULL),(82,'Benderforsenate',NULL,NULL,'R',NULL,NULL,NULL,NULL),(83,'binnie2010',NULL,NULL,'R',NULL,NULL,NULL,NULL),(84,'Moser2010',NULL,NULL,'R',NULL,NULL,NULL,NULL),(85,'donbatesjr',NULL,NULL,'R',NULL,NULL,NULL,NULL),(86,'Blakeman2010',NULL,NULL,'R',NULL,NULL,NULL,NULL),(87,'alramirezUSA',NULL,NULL,'R',NULL,NULL,NULL,NULL),(88,'JimHolt2010',NULL,NULL,'R',NULL,NULL,NULL,NULL),(89,'CavassoCan',NULL,NULL,'R',NULL,NULL,NULL,NULL),(90,'johnhostettler',NULL,NULL,'R',NULL,NULL,NULL,NULL),(91,'burks4senate',NULL,NULL,'R',NULL,NULL,NULL,NULL),(92,'pegluksik',NULL,NULL,'R',NULL,NULL,NULL,NULL),(93,'wargotz4senate',NULL,NULL,'R',NULL,NULL,NULL,NULL),(94,'ChuckPurgason',NULL,NULL,'R',NULL,NULL,NULL,NULL),(95,'GaryBerntsen',NULL,NULL,'R',NULL,NULL,NULL,NULL),(96,'DeborahASolomon',NULL,NULL,'R',NULL,NULL,NULL,NULL),(97,'MacforCongress',NULL,NULL,'R',NULL,NULL,NULL,NULL),(98,'JohnPRoco',NULL,NULL,'R',NULL,NULL,NULL,NULL),(99,'Didier4Senate',NULL,NULL,'R',NULL,NULL,NULL,NULL),(100,'mikelee2010',NULL,NULL,'R',NULL,NULL,NULL,NULL);
/*!40000 ALTER TABLE `politicians` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2012-02-25 7:22:40

0 comments on commit e1bc3d9

Please sign in to comment.