Skip to content
Browse files

add remaining tests, update readme, fix rakefile etc

  • Loading branch information...
1 parent 369602f commit 54edfa296fd39ba67277a9a70f2f3fc6b8974552 @ashaw committed
View
18 README.md
@@ -20,8 +20,8 @@ real-time calls and options
historical calls and options
- c.alerts :since =>
- c.snapshots :timestamp =>
+ c.alerts :since => 1276980619
+ c.snapshots :timestamp => 1276980619
c.stats
c.data_series
c.day_data_series
@@ -31,15 +31,11 @@ other calls and options
c.histogram :keys => 'n', :breaks => 'n', :path => '/'
c.summary :keys => 'n', :types => 'n', :path => '/'
-## Note on Patches/Pull Requests
-
-* Fork the project.
-* Make your feature addition or bug fix.
-* Add tests for it. This is important so I don't break it in a
- future version unintentionally.
-* Commit, do not mess with rakefile, version, or history.
- (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
-* Send me a pull request. Bonus points for topic branches.
+## Notes
+
+* Chartbeat is currently returning blank arrays for `alerts` and an error for `data_series` at this time. I'll put out an update with tests for these calls when this is fixed.
+
+* For calls requiring timestamp, this gem defaults to 24 hours ago.
## Copyright
View
2 Rakefile
@@ -12,7 +12,7 @@ begin
gem.authors = ["Al Shaw"]
gem.add_dependency "httparty"
gem.add_development_dependency "rspec", ">= 1.2.9"
- gem.add_developement_dependency "fakeweb"
+ gem.add_development_dependency "fakeweb"
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
end
Jeweler::GemcutterTasks.new
View
65 spec/chartbeat_spec.rb
@@ -17,7 +17,12 @@
titles[0][1].should eql('Talking Points Memo | Breaking News and Analysis')
end
- it "should get and parse the 'pathsummary' endpoint"
+ it "should get and parse the 'pathsummary' endpoint" do
+ register_uri("http://chartbeat.com/api/pathsummary/?apikey=#{KEY}&host=#{HOST}&keys=n&types=n", "pathsummary")
+
+ pathsummary = @c.pathsummary.to_a
+ pathsummary[0][0].should eql('/2010/06/the_gaza_flotilla_raid_what_do_we_know.php')
+ end
it "should get and parse the 'recent' endpoint" do
register_uri("http://chartbeat.com/api/recent/?apikey=#{KEY}&host=#{HOST}&path=%2F&limit=", "recent")
@@ -34,20 +39,62 @@
summize['idle'].should eql(382)
end
- it "should get and parse the 'toppages' endpoint"
-
+ it "should get and parse the 'toppages' endpoint" do
+ register_uri("http://chartbeat.com/api/toppages/?apikey=#{KEY}&host=#{HOST}&limit=", "toppages")
+
+ toppages = @c.toppages
+ toppages[0]['i'].should eql('Talking Points Memo | Breaking News and Analysis')
+ toppages[0]['path'].should eql('/')
+ end
+
+ # Not implemented yet because chartbeat is returning blank arrays for this call
it "should get and parse the 'alerts' endpoint"
- it "should get and parse the 'snapshots' endpoint"
-
- it "should get and parse the 'stats' endpoint"
+ it "should get and parse the 'snapshots' endpoint" do
+ register_uri("http://chartbeat.com/api/dashapi/snapshots/?apikey=#{KEY}&host=#{HOST}&timestamp=#{Chartbeat::YESTERDAY}","snapshots")
+
+ snapshots = @c.snapshots.to_a
+
+ titles = snapshots[0]
+ geo = snapshots[1]
+ visitlength = snapshots[2]
+
+ titles[1]['/2010/06/jon-stewart-barton-was-actually-reading-disdainful-asshle-digest-at-the-bp-hearings-video.php?ref=fpblg'].should eql ("Jon Stewart: Barton Was Actually Reading 'Disdainful Assh*le Digest' At The BP Hearings (VIDEO) | TPM LiveWire")
+ geo[1]['countries']['US'].should eql(474)
+ visitlength[1][0]['idle'].should eql(101.0)
+ end
+ it "should get and parse the 'stats' endpoint" do
+ register_uri("http://chartbeat.com/api/dashapi/stats/?apikey=#{KEY}&host=#{HOST}","stats")
+
+ stats = @c.stats
+
+ stats['read_min'].should eql(5)
+ stats['people_max'].should eql(3742)
+ end
+
+ # Not implemented yet. Chartbeat is returning an error for this call at this time.
it "should get and parse the 'data_series' endpoint"
- it "should get and parse the 'day_data_series' endpoint"
+ it "should get and parse the 'day_data_series' endpoint" do
+ register_uri("http://chartbeat.com/api/dashapi/day_data_series/?apikey=#{KEY}&host=#{HOST}&type=paths&timestamp=#{Chartbeat::YESTERDAY}","day_data_series")
+
+ day_data_series = @c.day_data_series.to_a
+ day_data_series[0][0].should eql("/archives/2010/06/painfully_funny php")
+ end
- it "should get and parse the 'histogram' endpoint"
+ it "should get and parse the 'histogram' endpoint" do
+ register_uri("http://chartbeat.com/api/histogram/?apikey=#{KEY}&host=#{HOST}&keys=n&breaks=n&path=","histogram")
+
+ histogram = @c.histogram
+ histogram['n']['data']['sumOfSquares'].should eql(91.0)
+ end
- it "should get and parse the 'summary' endpoint"
+ it "should get and parse the 'summary' endpoint" do
+ register_uri("http://chartbeat.com/api/summary/?apikey=#{KEY}&host=#{HOST}&keys=n&types=n&path=","summary")
+ summary = @c.summary
+ summary['n']['data']['sumOfSquares'].should eql(99.0)
+ end
+
end
View
1 spec/fixtures/day_data_series.json
1 addition, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
1 spec/fixtures/histogram.json
@@ -0,0 +1 @@
+{"n": {"data": {"upperHinge": 0.0, "min": 0.0, "max": 1.0, "sum": 91.0, "nzObservations": 91, "median": 0.0, "sumOfSquares": 91.0, "observations": 761, "lowerHinge": 0.0}, "type": "numeric"}}
View
1 spec/fixtures/snapshots.json
@@ -0,0 +1 @@
+{"referers": {"": {"": 1018}, "tpmcafe.talkingpointsmemo.com": {"\/": 3}, "www.talkingpointsmemo.com": {"\/i.php": 4, "\/live\/gulf-oil-spill-wire\/": 2, "\/": 403}, "www.reddit.com": {"\/r\/politics\/comments\/cg6n2\/gop_just_issued_statement_saying_the_oil_leak_is\/": 2, "\/?count=25&after=t3_cgggz": 6, "\/r\/politics\/comments\/cga3x\/sarah_palin_if_somebodys_gonna_to_smoke_a_joint\/": 2}, "www.eschatonblog.com": {"\/": 10}, "dailykos.com": {"\/": 3}, "digg.com": {"\/page14": 2}, "www.tumblr.com": {"\/dashboard": 4}, "tpmdc.talkingpointsmemo.com": {"\/2010\/06\/how-joe-barton-managed-to-have-a-worse-day-than-tony-hayward.php": 2, "\/2010\/06\/second-republican-demands-barton-step-down-from-energy-post.php?ref=fpa": 2, "\/2010\/06\/angle-dodges-questions-about-transitioning-out-of-social-security-second-amendment-remedies-video.php?ref=fpa": 4, "\/2010\/06\/bachmann-opponents-new-ad-blasts-her-for-standing-up-for-bp-video.php?ref=fpb": 8, "\/2010\/06\/angle-dodges-questions-about-transitioning-out-of-social-security-second-amendment-remedies-video.php": 3, "\/2010\/06\/angle-dodges-questions-about-transitioning-out-of-social-security-second-amendment-remedies-video.php?ref=fpb": 2, "\/2010\/06\/pelosi-punts-on-gutting-ethics-office.php?ref=fpb": 2, "\/2010\/06\/wh-on-kagan-docs-transparentest-administration-ever.php": 2, "\/": 9}, "us.mc458.mail.yahoo.com": {"\/mc\/welcome?.gx=1&.tm=1276830229&.rand=0j8585f2g5opf": 3}, "twitter.com": {"\/": 4}, "www.dailykos.com": {"\/": 8}, "tpmlivewire.talkingpointsmemo.com": {"\/2010\/06\/jon-stewart-barton-was-actually-reading-disdainful-asshle-digest-at-the-bp-hearings-video.php": 4, "\/2010\/06\/utah-attorney-general-uses-twitter-to-announce-executions.php?ref=fpblg": 3, "\/2010\/06\/pot-smoker-palin-doesnt-support-legalization.php": 5, "\/2010\/06\/report-japan-using-aid-bribes-call-girls-to-buy-whaling-votes.php?ref=fpblg": 4, "\/2010\/06\/colbert-eggs-gop-rep-bob-inglis-into-suggesting-obama-wasnt-born-in-hawaii-video.php?ref=fpb": 2, "\/2010\/06\/colbert-eggs-gop-rep-bob-inglis-into-suggesting-obama-wasnt-born-in-hawaii-video.php": 5, "\/2010\/06\/jon-stewart-barton-was-actually-reading-disdainful-asshle-digest-at-the-bp-hearings-video.php?ref=fpblg": 3}, "tpmmuckraker.talkingpointsmemo.com": {"\/2010\/06\/cuccinelli_still_wont_give_fake_vets_group_donatio.php?ref=fpa": 3, "\/2010\/06\/alvin_greene_the_laura_ingraham_interview.php?ref=fpi": 3, "\/2010\/06\/alvin_greene_the_laura_ingraham_interview.php?ref=fpb": 2, "\/2010\/06\/alvin_greene_the_laura_ingraham_interview.php": 6, "\/": 4}, "www.huffingtonpost.com": {"\/politics\/": 2, "\/business\/": 9, "\/2010\/06\/18\/financial-reform-feingold_n_617383.html": 3, "\/": 12}, "www.democraticunderground.com": {"\/": 2}, "www.balloon-juice.com": {"\/": 4}, "www.fark.com": {"\/politics\/": 20}, "andrewsullivan.theatlantic.com": {"\/": 3}, "www.google.com": {"\/ig?refresh=1": 2, "\/reader\/view\/?hl=en&tab=wy": 2, "\/reader\/view\/": 13, "\/search?q=tpm&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a": 5}, "my.yahoo.com": {"\/": 4}, "tpmelectioncentral.talkingpointsmemo.com": {"\/": 3}}, "domload": [29.0, 97.0, 127.0, 181.0, 195.0, 1013.0, 148.0, 75.0, 57.0, 212.0], "summary": {"newToPage": 0, "return": 1834, "people": 2134, "read": 493, "domload": 7566, "connspeed": 0, "write": 34, "idle": 1607, "new": 300}, "titles": {"\/2010\/06\/cuccinelli_still_wont_give_fake_vets_group_donatio.php?ref=fpb": "Cuccinelli Still Won't Give Fake Vets Group Donations To Real Veterans | TPMMuckraker", "\/": "Talking Points Memo | Breaking News and Analysis", "\/2010\/06\/not-making-it-easy-bps-lamest-verbal-blunders-and-self-inflicted-wounds.php": "The 7 Dumbest Things BP Has Said About The Spill -- So Far | TPM LiveWire", "\/2010\/06\/bachmann-opponents-new-ad-blasts-her-for-standing-up-for-bp-video.php?ref=fpi": "Bachmann Opponent's New Ad Blasts Her For 'Standing Up For BP' (VIDEO) | TPMDC", "\/cgi-bin\/mt-current\/mt-cp.cgi?__mode=my_dashboard": "Packerfanchick's Dashboard | All", "\/gallery\/2009\/12\/best-boss-ever-michael-steele-the-rnc-interns.php?img=5": "Best Boss Ever? Michael Steele & The RNC Interns | TPM Photo Galleries", "\/2010\/06\/pot-smoker-palin-doesnt-support-legalization.php": "Former Pot-Smoker Palin Doesn't Support Legalization (VIDEO) | TPM LiveWire", "\/2010\/06\/bachmann-opponents-new-ad-blasts-her-for-standing-up-for-bp-video.php?ref=fpb": "Bachmann Opponent's New Ad Blasts Her For 'Standing Up For BP' (VIDEO) | TPMDC", "\/2010\/06\/colbert-eggs-gop-rep-bob-inglis-into-suggesting-obama-wasnt-born-in-hawaii-video.php?ref=fpc": "Colbert Eggs GOP Rep Bob Inglis Into Suggesting Obama Wasn't Born In Hawaii (VIDEO) | TPM LiveWire", "\/gallery\/2010\/06\/scandal-carolina-classic-moments-in-sc-politics.php?img=5": "Scandal Carolina: Classic Moments In SC Politics | TPM Photo Galleries", "\/2010\/06\/pelosi-punts-on-gutting-ethics-office.php?ref=fpb": "Pelosi Punts On Gutting Ethics Office | TPMDC", "\/2010\/06\/alvin_greene_the_laura_ingraham_interview.php?ref=fpb": "Alvin Greene, The Laura Ingraham Interview | TPMMuckraker", "\/2010\/06\/alvin_greene_the_laura_ingraham_interview.php?ref=fpi": "Alvin Greene, The Laura Ingraham Interview | TPMMuckraker", "\/2010\/06\/utah-attorney-general-uses-twitter-to-announce-executions.php?ref=fpblg": "Utah Attorney General Uses Twitter to Announce Executions | TPM LiveWire", "\/2010\/06\/18\/the_obama_plot_for_a_carbon_tax\/?ref=fpblg": "The Obama Plot for a Carbon Tax | TPMCafe", "\/2010\/06\/jon-stewart-barton-was-actually-reading-disdainful-asshle-digest-at-the-bp-hearings-video.php": "Jon Stewart: Barton Was Actually Reading 'Disdainful Assh*le Digest' At The BP Hearings (VIDEO) | TPM LiveWire", "\/2010\/06\/16\/liberals_and_obama_on_the_oil_spill_--_continued\/?ref=fpblg": "Liberals and Obama on the Oil Spill -- continued | TPMCafe", "\/2010\/06\/angle-dodges-questions-about-transitioning-out-of-social-security-second-amendment-remedies-video.php": "Sharron Angle Flees Local TV Station Questions (VIDEO) | TPMDC", "\/2010\/06\/angle-dodges-questions-about-transitioning-out-of-social-security-second-amendment-remedies-video.php?ref=fpb": "Sharron Angle Flees Local TV Station Questions (VIDEO) | TPMDC", "\/2010\/06\/16\/liberals_and_obama_on_the_oil_spill_--_continued\/": "Liberals and Obama on the Oil Spill -- continued | TPMCafe", "\/2010\/06\/bp-chairman-ceo-hayward-handing-over-day-to-day-gulf-responsibilities-video.php?ref=fpb": "BP Chairman: CEO Hayward Handing Over Day-To-Day Gulf Responsibilities (VIDEO) | TPM LiveWire", "\/2010\/06\/jon-stewart-barton-was-actually-reading-disdainful-asshle-digest-at-the-bp-hearings-video.php?ref=fpblg": "Jon Stewart: Barton Was Actually Reading 'Disdainful Assh*le Digest' At The BP Hearings (VIDEO) | TPM LiveWire", "\/2010\/06\/second-republican-demands-barton-step-down-from-energy-post.php?ref=fpa": "Second Republican Demands Barton Step Down From Energy Post | TPMDC", "\/2010\/06\/chuck-devore-to-tpm-jury-still-out-on-whether-fiorina-will-be-a-trainwreck.php?ref=fpb": "Chuck DeVore To TPM: Jury Still Out On Whether Fiorina Will Be A 'Trainwreck' | TPMDC", "\/2010\/06\/chuck-devore-to-tpm-jury-still-out-on-whether-fiorina-will-be-a-trainwreck.php?ref=fpi": "Chuck DeVore To TPM: Jury Still Out On Whether Fiorina Will Be A 'Trainwreck' | TPMDC", "\/2010\/06\/barton-likely-wouldnt-be-chairman-even-without-bp-apology.php": "Barton Likely Wouldn't Be Chairman Even Without BP Apology | TPMDC", "\/2010\/06\/wall-street-reform-backers-seek-feingolds-support.php?ref=fpi": "Wall Street Reform Backers Seek Feingold's Support | TPMDC", "\/?id=6000882": "Rep. Barton Apologizes If BP Apology Was Misconstrued | TPMTV"}, "active": [{"domload": 7900.0, "read": 254.0, "positions": [["0.0000", "0.1102"], ["0.0000", "0.0280"], ["0.0000", "0.0867"], ["0.0000", "0.1270"], ["0.0000", "0.0956"], ["0.0245", "0.1909"], ["0.0000", "0.0897"], ["0.0000", "0.0777"], ["0.0000", "0.1116"], ["0.0500", "0.1429"], ["0.0153", "0.0942"], ["0.2616", "0.3523"], ["0.0000", "0.0712"], ["0.0000", "0.0796"], ["0.0000", "0.1330"], ["0.2586", "0.3364"], ["0.0000", "0.1045"]], "visit": 11.765217, "write": 14.0, "idle": 929.0, "position": ["0.0551", "0.0140", "0.0433", "0.0635", "0.0478", "0.1077", "0.0449", "0.0388", "0.0558", "0.0965", "0.0547", "0.3070", "0.0356", "0.0398", "0.0665", "0.2975", "0.0523"], "new": 60.0, "path": "\/", "total": 1197.0}, {"domload": 5111.0, "read": 12.0, "positions": [], "visit": 7.51635, "write": 0.0, "idle": 47.0, "position": [], "new": 41.0, "path": "\/2010\/06\/pot-smoker-palin-doesnt-support-legalization.php", "total": 59.0}, {"domload": 6847.0, "read": 12.0, "positions": [], "visit": 8.302358, "write": 0.0, "idle": 26.0, "position": [], "new": 4.0, "path": "\/2010\/06\/jon-stewart-barton-was-actually-reading-disdainful-asshle-digest-at-the-bp-hearings-video.php?ref=fpblg", "total": 38.0}, {"domload": 6066.5, "read": 8.0, "positions": [["0.2212", "0.4254"]], "visit": 12.70555, "write": 1.0, "idle": 21.0, "position": ["0.3233"], "new": 6.0, "path": "\/2010\/06\/jon-stewart-barton-was-actually-reading-disdainful-asshle-digest-at-the-bp-hearings-video.php", "total": 30.0}, {"domload": 5624.0, "read": 10.0, "positions": [["0.0000", "0.1840"]], "visit": 0.757983, "write": 0.0, "idle": 17.0, "position": ["0.0920"], "new": 9.0, "path": "\/2010\/06\/alvin_greene_the_laura_ingraham_interview.php?ref=fpb", "total": 27.0}, {"domload": 5537.0, "read": 3.0, "positions": [["0.0447", "0.2000"]], "visit": 7.523667, "write": 0.0, "idle": 23.0, "position": ["0.1223"], "new": 12.0, "path": "\/2010\/06\/utah-attorney-general-uses-twitter-to-announce-executions.php?ref=fpblg", "total": 26.0}, {"domload": 12971.5, "read": 6.0, "positions": [], "visit": 15.280733, "write": 2.0, "idle": 16.0, "position": [], "new": 16.0, "path": "\/2010\/06\/16\/liberals_and_obama_on_the_oil_spill_--_continued\/", "total": 24.0}, {"domload": 8805.0, "read": 9.0, "positions": [], "visit": 3.515117, "write": 2.0, "idle": 12.0, "position": [], "new": 3.0, "path": "\/2010\/06\/second-republican-demands-barton-step-down-from-energy-post.php?ref=fpa", "total": 23.0}, {"domload": 8704.5, "read": 7.0, "positions": [], "visit": 18.90845, "write": 1.0, "idle": 14.0, "position": [], "new": 9.0, "path": "\/2010\/06\/16\/liberals_and_obama_on_the_oil_spill_--_continued\/?ref=fpblg", "total": 22.0}, {"domload": 7020.0, "read": 9.0, "positions": [], "visit": 1.724933, "write": 0.0, "idle": 13.0, "position": [], "new": 1.0, "path": "\/2010\/06\/bachmann-opponents-new-ad-blasts-her-for-standing-up-for-bp-video.php?ref=fpb", "total": 22.0}, {"domload": 9117.0, "read": 4.0, "positions": [], "visit": 8.533017, "write": 1.0, "idle": 13.0, "position": [], "new": 5.0, "path": "\/2010\/06\/angle-dodges-questions-about-transitioning-out-of-social-security-second-amendment-remedies-video.php", "total": 18.0}, {"domload": 4794.0, "read": 9.0, "positions": [], "visit": 1.505608, "write": 0.0, "idle": 9.0, "position": [], "new": 2.0, "path": "\/2010\/06\/cuccinelli_still_wont_give_fake_vets_group_donatio.php?ref=fpb", "total": 18.0}, {"domload": 14114.0, "read": 6.0, "positions": [], "visit": 9.304267, "write": 0.0, "idle": 11.0, "position": [], "new": 1.0, "path": "\/2010\/06\/angle-dodges-questions-about-transitioning-out-of-social-security-second-amendment-remedies-video.php?ref=fpb", "total": 17.0}, {"domload": 8116.0, "read": 3.0, "positions": [], "visit": 11.290733, "write": 0.0, "idle": 14.0, "position": [], "new": 4.0, "path": "\/2010\/06\/colbert-eggs-gop-rep-bob-inglis-into-suggesting-obama-wasnt-born-in-hawaii-video.php?ref=fpc", "total": 17.0}, {"domload": 5213.0, "read": 6.0, "positions": [], "visit": 4.255617, "write": 0.0, "idle": 9.0, "position": [], "new": 3.0, "path": "\/2010\/06\/pelosi-punts-on-gutting-ethics-office.php?ref=fpb", "total": 15.0}, {"domload": 4691.5, "read": 3.0, "positions": [], "visit": 13.130517, "write": 1.0, "idle": 10.0, "position": [], "new": 2.0, "path": "\/2010\/06\/chuck-devore-to-tpm-jury-still-out-on-whether-fiorina-will-be-a-trainwreck.php?ref=fpb", "total": 14.0}, {"domload": 8801.5, "read": 0.0, "positions": [], "visit": 12.451133, "write": 0.0, "idle": 14.0, "position": [], "new": 2.0, "path": "\/2010\/06\/18\/the_obama_plot_for_a_carbon_tax\/?ref=fpblg", "total": 14.0}, {"domload": 5225.0, "read": 8.0, "positions": [["0.0000", "0.2828"]], "visit": 2.130083, "write": 0.0, "idle": 6.0, "position": ["0.1414"], "new": 2.0, "path": "\/2010\/06\/alvin_greene_the_laura_ingraham_interview.php?ref=fpi", "total": 14.0}, {"domload": 6732.0, "read": 3.0, "positions": [], "visit": 27.01235, "write": 0.0, "idle": 10.0, "position": [], "new": 10.0, "path": "\/2010\/06\/wall-street-reform-backers-seek-feingolds-support.php?ref=fpi", "total": 13.0}, {"domload": 7899.5, "read": 3.0, "positions": [], "visit": 8.0325, "write": 1.0, "idle": 8.0, "position": [], "new": 8.0, "path": "\/2010\/06\/not-making-it-easy-bps-lamest-verbal-blunders-and-self-inflicted-wounds.php", "total": 12.0}], "visitlength": [{"read": 241.0, "write": 10.0, "idle": 101.0, "total": 352.0}, {"read": 99.0, "write": 6.0, "idle": 98.0, "total": 203.0}, {"read": 29.0, "write": 5.0, "idle": 31.0, "total": 65.0}, {"read": 20.0, "write": 2.0, "idle": 119.0, "total": 141.0}, {"read": 16.0, "write": 2.0, "idle": 28.0, "total": 46.0}, {"read": 6.0, "write": 1.0, "idle": 24.0, "total": 31.0}, {"read": 25.0, "write": 2.0, "idle": 158.0, "total": 185.0}, {"read": 24.0, "write": 1.0, "idle": 130.0, "total": 155.0}, {"read": 21.0, "write": 2.0, "idle": 409.0, "total": 432.0}, {"read": 12.0, "write": 3.0, "idle": 509.0, "total": 524.0}, {"read": 0, "write": 0, "idle": 0, "total": 0}], "geo": {"regions": {"PA": 10, "SK": 1, "09": 1, "WA": 20, "BC": 2, "DC": 12, "WI": 8, "WV": 4, "FL": 20, "NH": 1, "25": 1, "NJ": 23, "07": 2, "04": 1, "LA": 3, "NC": 6, "28": 1, "NE": 2, "NM": 3, "TN": 2, "NY": 52, "A2": 1, "A8": 2, "RI": 1, "NV": 2, "E2": 1, "VA": 19, "None": 30, "AB": 1, "CO": 4, "ON": 2, "AK": 3, "26": 2, "AL": 4, "02": 1, "SC": 3, "05": 1, "AR": 2, "IL": 16, "GA": 5, "IN": 6, "IA": 4, "OK": 2, "AZ": 9, "CA": 78, "CT": 5, "ME": 4, "MD": 17, "MA": 19, "TX": 22, "OH": 14, "19": 1, "UT": 1, "MO": 2, "MN": 7, "MI": 9, "KS": 2, "MT": 2, "16": 1, "MS": 1, "11": 1, "KY": 3, "OR": 13}, "lat_lngs": [["54", "10", 1], ["37", "-120", 1], ["37", "-122", 11], ["48", "17", 1], ["38", "-97", 29], ["35", "-90", 1], ["32", "-106", 1], ["32", "-107", 1], ["32", "-100", 1], ["49", "-122", 1], ["49", "-123", 1], ["42", "-74", 1], ["42", "-76", 1], ["42", "-70", 1], ["42", "-71", 16], ["42", "-73", 2], ["43", "-90", 1], ["41", "-82", 1], ["37", "-86", 1], ["37", "-80", 1], ["31", "-98", 1], ["27", "-80", 3], ["39", "-121", 4], ["34", "-87", 2], ["51", "-114", 1], ["32", "-95", 3], ["26", "-80", 2], ["35", "-98", 2], ["48", "-122", 13], ["42", "-112", 1], ["13", "78", 1], ["40", "-122", 1], ["38", "-122", 25], ["40", "-120", 2], ["41", "-95", 1], ["41", "-96", 2], ["29", "-81", 3], ["29", "-83", 1], ["53", "-6", 1], ["31", "-85", 1], ["31", "-88", 1], ["35", "-112", 1], ["35", "-107", 1], ["35", "-106", 1], ["54", "-2", 1], ["35", "-82", 1], ["44", "-123", 1], ["44", "-122", 1], ["44", "-121", 1], ["61", "-150", 2], ["46", "-119", 1], ["13", "80", 1], ["43", "-78", 2], ["43", "-74", 1], ["43", "-76", 2], ["43", "-71", 3], ["43", "-72", 1], ["42", "-94", 1], ["42", "-92", 2], ["40", "-105", 3], ["35", "-113", 1], ["35", "-119", 1], ["39", "-105", 1], ["47", "-87", 1], ["39", "-95", 3], ["35", "-118", 2], ["44", "-79", 2], ["39", "-91", 1], ["30", "-82", 6], ["33", "-112", 3], ["35", "-92", 2], ["30", "-87", 1], ["33", "-117", 6], ["38", "-85", 1], ["47", "-122", 2], ["47", "-123", 2], ["33", "-92", 2], ["33", "-97", 4], ["33", "-98", 1], ["42", "-85", 1], ["42", "-84", 8], ["42", "-86", 1], ["42", "-81", 1], ["42", "-80", 1], ["39", "-88", 1], ["42", "-89", 1], ["42", "-88", 11], ["45", "-123", 5], ["39", "-82", 2], ["51", "0", 1], ["39", "-87", 1], ["48", "-123", 1], ["39", "-85", 3], ["39", "-84", 3], ["30", "-90", 1], ["30", "-89", 1], ["30", "-96", 2], ["30", "-98", 9], ["48", "-117", 1], ["48", "-114", 2], ["36", "-87", 1], ["36", "-80", 1], ["48", "-2", 1], ["44", "-84", 1], ["45", "-69", 3], ["44", "-89", 2], ["44", "-88", 1], ["40", "-87", 2], ["40", "-86", 2], ["40", "-83", 2], ["40", "-88", 3], ["23", "108", 1], ["37", "-76", 1], ["46", "-123", 4], ["46", "-122", 1], ["39", "-76", 1], ["39", "-77", 43], ["34", "-84", 4], ["34", "-82", 1], ["34", "-83", 1], ["34", "-80", 1], ["34", "-119", 3], ["34", "-118", 24], ["28", "-80", 1], ["28", "-83", 1], ["28", "-82", 2], ["34", "-112", 1], ["52", "5", 1], ["52", "4", 1], ["45", "-88", 1], ["18", "-70", 1], ["62", "-150", 1], ["40", "-76", 2], ["40", "-74", 3], ["40", "-75", 12], ["38", "-88", 1], ["47", "11", 1], ["41", "-73", 4], ["41", "-72", 2], ["41", "-71", 1], ["38", "-81", 2], ["41", "-75", 2], ["41", "-74", 55], ["45", "-93", 5], ["45", "-94", 1], ["32", "-111", 3], ["45", "-96", 1], ["49", "2", 2], ["43", "-84", 1], ["43", "-85", 1], ["36", "-79", 4], ["50", "-105", 1], ["59", "18", 2], ["36", "-77", 1], ["43", "-88", 1], ["43", "-89", 2], ["38", "-79", 1], ["38", "-78", 1], ["62", "34", 1]], "countries": {"RU": 1, "FR": 3, "NL": 2, "CN": 1, "DO": 1, "CA": 6, "DE": 1, "US": 474, "SK": 1, "GB": 2, "IN": 2, "IE": 1, "SE": 2, "AT": 1}}, "recent": [{"count": "0.021200", "utc": 1276892186, "int_referer": "\/", "domload": "11987", "country": "US", "region": "GA", "longitude": -83.375, "state": "write", "referer": null, "latitude": 33.9499015808, "path": "\/", "id": "9s1bk1rztnrdqwyn"}, {"count": "0.020417", "utc": 1276892186, "int_referer": null, "domload": "1340", "country": "US", "region": "CA", "longitude": -121.905197144, "state": "write", "referer": "", "latitude": 37.3422012329, "path": "\/", "id": "9axm4bi4o4zoodz6"}, {"count": "0.054217", "utc": 1276892186, "int_referer": null, "domload": "1758", "country": "US", "region": "MN", "longitude": -93.2165985107, "state": "write", "referer": "", "latitude": 44.9758987427, "path": "\/", "id": "4ib08efmeg6276r2"}, {"count": "0.020517", "utc": 1276892186, "int_referer": null, "domload": "5717", "country": "US", "region": "ME", "longitude": -68.6333999634, "state": "write", "referer": "http:\/\/www.talkingpointsmemo.com\/", "latitude": 45.0027999878, "path": "\/2010\/06\/bachmann-opponents-new-ad-blasts-her-for-standing-up-for-bp-video.php?ref=fpi", "id": "p5lt3d7gssmp7rfy"}, {"count": "0.014183", "utc": 1276892186, "int_referer": null, "domload": "4634", "country": "US", "region": "MA", "longitude": -71.0677032471, "state": "write", "referer": "http:\/\/www.talkingpointsmemo.com\/", "latitude": 42.3424987793, "path": "\/2010\/06\/bp-chairman-ceo-hayward-handing-over-day-to-day-gulf-responsibilities-video.php?ref=fpb", "id": "uf6yjp78q6byh25h"}, {"count": "0.013333", "utc": 1276892186, "int_referer": "\/", "domload": "2228", "country": "US", "region": "NY", "longitude": -73.1262969971, "state": "write", "referer": null, "latitude": 40.7699012756, "path": "\/", "id": "lb69v1hu911hyc6a"}, {"count": "0.059983", "utc": 1276892185, "int_referer": null, "domload": "16978", "country": "US", "region": null, "longitude": -97.0, "state": "write", "referer": "http:\/\/www.talkingpointsmemo.com\/i.php", "latitude": 38.0, "path": "\/2010\/06\/barton-likely-wouldnt-be-chairman-even-without-bp-apology.php", "id": "zd41uqs643izpo5u"}, {"count": "0.030283", "utc": 1276892185, "int_referer": null, "domload": "5649", "country": "US", "region": "CA", "longitude": -122.393302917, "state": "write", "referer": "", "latitude": 37.7696990967, "path": "\/2010\/06\/utah-attorney-general-uses-twitter-to-announce-executions.php?ref=fpblg", "id": "ulszmcumijf94mkl"}, {"count": "0.023300", "utc": 1276892185, "int_referer": "\/cgi-bin\/mt-current\/mt-cp.cgi?__mode=my_dashboard", "domload": "1641", "country": "US", "region": "WI", "longitude": -88.0358963013, "state": "write", "referer": null, "latitude": 43.0845985413, "path": "\/cgi-bin\/mt-current\/mt-cp.cgi?__mode=my_dashboard", "id": "zy17hknj16rtuf5p"}, {"count": "0.014867", "utc": 1276892184, "int_referer": null, "domload": "1098", "country": "US", "region": "NY", "longitude": -73.9553985596, "state": "write", "referer": "", "latitude": 40.6525001526, "path": "\/", "id": "totipj09pjkbdd70"}, {"count": "0.030283", "utc": 1276892184, "int_referer": "\/", "domload": "9379", "country": "US", "region": "CA", "longitude": -118.136199951, "state": "write", "referer": null, "latitude": 34.2005004883, "path": "\/", "id": "65popu7p3ixt15tl"}, {"count": "0.054917", "utc": 1276892184, "int_referer": null, "domload": "7609", "country": "US", "region": "MA", "longitude": -71.1230010986, "state": "write", "referer": "", "latitude": 42.3431015015, "path": "\/", "id": "k55hzrpbflepad6j"}, {"count": "0.015017", "utc": 1276892183, "int_referer": "\/gallery\/2009\/12\/best-boss-ever-michael-steele-the-rnc-interns.php?img=4", "domload": "2574", "country": "US", "region": "NY", "longitude": -73.9763031006, "state": "write", "referer": null, "latitude": 40.7619018555, "path": "\/gallery\/2009\/12\/best-boss-ever-michael-steele-the-rnc-interns.php?img=5", "id": "3x9j6l7fmqhto2xl"}, {"count": "0.039217", "utc": 1276892183, "int_referer": null, "domload": "31159", "country": "US", "region": null, "longitude": -97.0, "state": "write", "referer": "", "latitude": 38.0, "path": "\/2010\/06\/jon-stewart-barton-was-actually-reading-disdainful-asshle-digest-at-the-bp-hearings-video.php", "id": "58g3olywr4p2w3sz"}, {"count": "0.020133", "utc": 1276892183, "int_referer": null, "domload": "4645", "country": "US", "region": "PA", "longitude": -75.2712020874, "state": "write", "referer": "", "latitude": 39.9984016418, "path": "\/", "id": "7uia76x2fqipv2tb"}, {"count": "0.046217", "utc": 1276892183, "int_referer": null, "domload": "6151", "country": "US", "region": "FL", "longitude": -81.5149993896, "state": "write", "referer": "", "latitude": 30.2866001129, "path": "\/", "id": "5gxx17cph0kxb8xv"}, {"count": "0.046350", "utc": 1276892183, "int_referer": null, "domload": "17537", "country": "US", "region": "OK", "longitude": -97.5189971924, "state": "write", "referer": "", "latitude": 35.4715003967, "path": "\/", "id": "rgkoxxt4dm3cxaoj"}, {"count": "0.024717", "utc": 1276892183, "int_referer": null, "domload": "8418", "country": "US", "region": "LA", "longitude": -92.1065979004, "state": "write", "referer": "http:\/\/www.talkingpointsmemo.com\/", "latitude": 32.5205993652, "path": "\/2010\/06\/alvin_greene_the_laura_ingraham_interview.php?ref=fpb", "id": "uq827wd5evgp5zcz"}, {"count": "0.020267", "utc": 1276892182, "int_referer": null, "domload": "5762", "country": "US", "region": "NJ", "longitude": -74.349899292, "state": "write", "referer": "", "latitude": 40.5186004639, "path": "\/", "id": "xgm943qnduusw1yb"}, {"count": "0.009083", "utc": 1276892182, "int_referer": null, "domload": "3745", "country": "US", "region": "NC", "longitude": -79.1664962769, "state": "write", "referer": "http:\/\/twitter.com\/", "latitude": 36.3903007507, "path": "\/2010\/06\/bachmann-opponents-new-ad-blasts-her-for-standing-up-for-bp-video.php?ref=fpi", "id": "bzm9bgd65s0r4yi7"}, {"count": "0.036733", "utc": 1276892182, "int_referer": null, "domload": "11229", "country": "US", "region": "WI", "longitude": -88.5305023193, "state": "write", "referer": "", "latitude": 44.184299469, "path": "\/", "id": "tmiz1rtsyfv6y24l"}, {"count": "0.019933", "utc": 1276892182, "int_referer": null, "domload": "11423", "country": "US", "region": "NC", "longitude": -78.799697876, "state": "write", "referer": "", "latitude": 35.8059005737, "path": "\/", "id": "6ncsidxrvk21jasa"}, {"count": "0.021233", "utc": 1276892182, "int_referer": null, "domload": "10745", "country": "US", "region": "IL", "longitude": -87.6368026733, "state": "write", "referer": "", "latitude": 41.8997993469, "path": "\/", "id": "4gckdrfpw4ht5zig"}, {"count": "0.020350", "utc": 1276892181, "int_referer": null, "domload": "3221", "country": "US", "region": "CA", "longitude": -122.115699768, "state": "write", "referer": "http:\/\/www.talkingpointsmemo.com\/", "latitude": 37.9020996094, "path": "\/", "id": "2sxxs4p0trmcahuv"}, {"count": "0.023167", "utc": 1276892181, "int_referer": null, "domload": "5713", "country": "US", "region": "MA", "longitude": -71.0677032471, "state": "write", "referer": "", "latitude": 42.3424987793, "path": "\/", "id": "235wl336ro4gqx2o"}, {"count": "0.940967", "utc": 1276892181, "int_referer": "\/?id=6002159", "domload": "3724", "country": "US", "region": "MI", "longitude": -83.7472991943, "state": "write", "referer": null, "latitude": 42.2747001648, "path": "\/?id=6000882", "id": "2jm4c43hxwfyybh8"}, {"count": "0.014350", "utc": 1276892181, "int_referer": null, "domload": "6840", "country": "US", "region": "TX", "longitude": -95.3882980347, "state": "write", "referer": "http:\/\/www.talkingpointsmemo.com\/", "latitude": 32.2258987427, "path": "\/2010\/06\/alvin_greene_the_laura_ingraham_interview.php?ref=fpi", "id": "2yzwoslcugunyh0e"}, {"count": "0.014800", "utc": 1276892180, "int_referer": null, "domload": "4094", "country": "US", "region": "WI", "longitude": -89.7398986816, "state": "write", "referer": "", "latitude": 43.4805984497, "path": "\/", "id": "1006ntk1au1ripfn"}, {"count": "0.011883", "utc": 1276892180, "int_referer": null, "domload": "2939", "country": "US", "region": "DC", "longitude": -77.0231018066, "state": "write", "referer": "http:\/\/www.talkingpointsmemo.com\/", "latitude": 38.9096984863, "path": "\/2010\/06\/chuck-devore-to-tpm-jury-still-out-on-whether-fiorina-will-be-a-trainwreck.php?ref=fpi", "id": "idyaet3jwkuxi2az"}, {"count": "0.021883", "utc": 1276892180, "int_referer": "\/gallery\/2010\/06\/scandal-carolina-classic-moments-in-sc-politics.php?img=4", "domload": "3800", "country": "US", "region": "MD", "longitude": -76.5627975464, "state": "write", "referer": null, "latitude": 39.3507003784, "path": "\/gallery\/2010\/06\/scandal-carolina-classic-moments-in-sc-politics.php?img=5", "id": "feq786fw597leohp"}], "pages_timestamp": "06/18/2010 04:15 pm", "historical": true }
View
1 spec/fixtures/stats.json
@@ -0,0 +1 @@
+{"new_avg": 182.387760306, "domload_max": 13798, "srvload_avg": 320.139736507, "idle_cnt": 11765, "new_min": 7, "write_avg": 26.3508712282, "new_max": 770, "people_cnt": 11765, "cnt": 0, "domload_cnt": 11765, "write_cnt": 11765, "srvload_max": 15331, "write_min": 0, "read_max": 1166, "return_min": 24, "srvload_min": 66, "idle_max": 2692, "return_avg": 1069.95333617, "write_max": 99, "new_cnt": 11765, "domload_avg": 7580.78368041, "return_max": 3376, "idle_min": 16, "people_avg": 1252.34109647, "people_min": 31, "read_min": 5, "srvload_cnt": 11765, "people_max": 3742, "domload_min": 4396, "read_avg": 332.336506587, "idle_avg": 893.650063748, "read_cnt": 11765, "return_cnt": 11765}
View
1 spec/fixtures/summary.json
@@ -0,0 +1 @@
+{"n": {"data": {"upperHinge": 0.0, "min": 0.0, "max": 1.0, "sum": 99.0, "nzObservations": 99, "median": 0.0, "sumOfSquares": 99.0, "observations": 764, "lowerHinge": 0.0}, "type": "numeric"}}
View
1 spec/spec_helper.rb
@@ -1,6 +1,5 @@
$LOAD_PATH.unshift(File.dirname(__FILE__))
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
-require 'rubygems'
require 'chartbeat'
require 'fakeweb'
require 'spec'

0 comments on commit 54edfa2

Please sign in to comment.
Something went wrong with that request. Please try again.