Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Commit a217da0

Browse files
committed
added in tc member count to total
1 parent 345a140 commit a217da0

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

lib/cs_platform.rb

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ class CsPlatform
22

33
def self.stats
44
stats = Rails.cache.fetch('platform_stats', :expires_in => 60.minute) do
5-
HTTParty.get("#{ENV['CS_API_URL']}/stats")['response']
5+
tc_members = tc_member_count
6+
results = HTTParty.get("#{ENV['CS_API_URL']}/stats")['response']
7+
results['members'] = (results['members'].to_i + tc_members).to_s
8+
results
69
end
710
end
811

@@ -23,4 +26,13 @@ def self.docusign_document(access_token, id)
2326
from docusign_document__c where id = '#{id}'", access_token).first
2427
end
2528

29+
private
30+
31+
def self.tc_member_count
32+
tc_stats = HTTParty.get("http://community.topcoder.com/tc?module=BasicData&c=member_count&dsid=30")
33+
tc_stats['member_count']['row']['member_count'].to_i
34+
rescue Exception => e
35+
return 0
36+
end
37+
2638
end

0 commit comments

Comments
 (0)