<commit_before># This code is free software; you can redistribute it and/or modify it under the
# terms of the new BSD License.
#
# Copyright (c) 2008-2009, <NAME>

require 'open-uri'
require 'rexml/document'

require 'steam/community/steam_id'

# The SteamGroup class represents a group in the Steam Community
class SteamGroup

  # Creates a SteamGroup object with the given group ID
  def initialize(id, fetch = false)
    if id.is_a? Numeric
      @group_id64 = id
    else
      @custom_url = id
    end

    begin
      fetch_members if fetch
    rescue REXML::ParseException
      raise SteamCondenserException.new('SteamID could not be loaded.')
    end
  end

  # Returns the URL to the group's Steam Community page
  def base_url
    if @custom_url.nil?
      "http://steamcommunity.com/gid/#{@group_id64}"
    else
      "http://steamcommunity.com/groups/#{@custom_url}"
    end
  end

  # Parses the data about this groups members<commit_msg>Added getters for groups' custom URLs and IDs<commit_after># This code is free software; you can redistribute it and/or modify it under the
# terms of the new BSD License.
#
# Copyright (c) 2008-2009, <NAME>

require 'open-uri'
require 'rexml/document'

require 'steam/community/steam_id'

# The SteamGroup class represents a group in the Steam Community
class SteamGroup

  attr_reader :custom_url, :group_id64

  # Creates a SteamGroup object with the given group ID
  def initialize(id, fetch = false)
    if id.is_a? Numeric
      @group_id64 = id
    else
      @custom_url = id
    end

    begin
      fetch_members if fetch
    rescue REXML::ParseException
      raise SteamCondenserException.new('SteamID could not be loaded.')
    end
  end

  # Returns the URL to the group's Steam Community page
  def base_url
    if @custom_url.nil?
      "http://steamcommunity.com/gid/#{@group_id64}"
    else
      "http://steamcommunity.com/groups/#{@custom_url}"
    end
  end

  # Parses the data about this groups members
{'fraction_non_alphanumeric': 0.0788675429726997, 'fraction_numerical': 0.01314459049544995, 'mean_word_length': 3.2286324786324787, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1346084', 'n_tokens_mistral': 643, 'n_tokens_neox': 604, 'n_words': 217}