json.total_count @result_object[:total_data].to_i
result_arr = @result_object[:data]
result_arr = result_arr.sort_by!{|c| User.develop_score(c["commits"],c["additions"]+c["deletions"])}.reverse
json.contributors result_arr.each do |contributor| 
  user = $redis_cache.hgetall("v2-owner-common:#{contributor["name"]}-#{contributor["email"]}")
  if user.blank?
    json.score User.develop_score(contributor["commits"],contributor["additions"]+contributor["deletions"] )-300
    json.contributions contributor["commits"]
    json.additions contributor["additions"]
    json.deletions contributor["deletions"]
    # json.id contributor["id"]
    json.login contributor["name"]
    json.email contributor["email"]
    json.type nil
    json.name contributor["name"]
    json.image_url User::Avatar.get_letter_avatar_url(contributor["name"])
  else
    json.score User.develop_score(contributor["commits"],contributor["additions"]+contributor["deletions"])-300
    json.contributions contributor["commits"]
    json.additions contributor["additions"]
    json.deletions contributor["deletions"]
    json.id user["id"]
    json.login user["login"]
    json.email user["email"]
    json.name user["name"]
    json.type user["type"]
    json.name user["name"]
    json.image_url user["avatar_url"]
  end
end