scrape_project (RubyForge)

    # File lib/rubyforge.rb, line 111
      def scrape_project(project)
        data = {
          "group_ids"     => {},
          "package_ids"   => {},
          "processor_ids" => Hash.new { |h,k| h[k] = {} },
          "release_ids"   => Hash.new { |h,k| h[k] = {} },
        }

        puts "Updating #{project}"

        unless data["group_ids"].has_key? project then
          html = URI.parse("http://rubyforge.org/projects/#{project}/index.html").read
          group_id = html[/(frs|tracker|mail)\/\?group_id=\d+/][/\d+/].to_i
          data["group_ids"][project] = group_id
        end

        group_id = data["group_ids"][project]

        html = URI.parse("http://rubyforge.org/frs/?group_id=#{group_id}").read

        package = nil
        html.scan(/<h3>[^<]+|release_id=\d+">[^>]+|filemodule_id=\d+/).each do |s|
          case s
          when /<h3>([^<]+)/ then
            package = $1.strip
          when /release_id=(\d+)">([^<]+)/ then
            data["release_ids"][package][$2] = $1.to_i
          when /filemodule_id=(\d+)/ then
            data["package_ids"][package] = $1.to_i
          end
        end

        if not data['release_ids'][package].empty? and
            (@autoconfig['processor_ids'].nil? or
             @autoconfig['processor_ids'].empty?) then
          puts "Fetching processor ids"

          login

          html = client.get_content "http://rubyforge.org/frs/admin/qrs.php?package=&group_id=#{group_id}"

          html =~ /<select name="processor_id">(.*?)<\/select>/m
          processors = $1
          processors.scan(/<option value="(\d{4})">([^<]+)/) do
            data["processor_ids"][$2] = $1.to_i
          end if processors
        end

        data.each do |key, val|
          @autoconfig[key] ||= {}
          @autoconfig[key].merge! val
        end

        save_autoconfig
      end