<commit_before>S3_REGION = ENV.fetch("S3_REGION")
S3_BUCKET_NAME = ENV.fetch("S3_BUCKET_NAME")
HOST = "https://s3-#{S3_REGION}.amazonaws.com/#{S3_BUCKET_NAME}/"

SitemapGenerator::Sitemap.default_host = "https://annict.com"
SitemapGenerator::Sitemap.sitemaps_host = HOST
SitemapGenerator::Sitemap.sitemaps_path = "sitemaps/"

adapter_options = {
  fog_provider: "AWS",
  aws_access_key_id: ENV.fetch("S3_ACCESS_KEY_ID"),
  aws_secret_access_key: ENV.fetch("S3_SECRET_ACCESS_KEY"),
  fog_directory: S3_BUCKET_NAME,
  fog_region: S3_REGION
}
SitemapGenerator::Sitemap.adapter = SitemapGenerator::S3Adapter.new(adapter_options)

SitemapGenerator::Sitemap.create do
  add about_path, priority: 0.7
  add db_activities_path, priority: 0.6
  add db_edit_requests_path, priority: 0.6
  add db_root_path, priority: 0.6
  add popular_works_path, priority: 0.9
  add privacy_path
  add resourceless_db_works_path
  add search_works_path, priority: 0.8
  add terms_path

  EditRequest.find_each do |er|
    add db_edit_request_path(er.id), priority: 0.7
  end

  User.find_each do |u|
    add following_user_path(u.username), priority: 0.8
    add followers_user_path(u.username), priority: 0.8
    add user_path(u.username), priority: 0.9, lastmod: u.updated_at

    Status.kind.values.each do |k|
      add user_works_path(u.username, k), priority: 0.8
    end
  end

  Season.find_each do |s|
    add season_works_path(s.slug), priority: 0.9
  end

  Work.find_each do |w|
    add work_path(w.id), priority: 1.0, lastmod: w.updated_at

    w.episodes.find_each do |e|
      add work_episode_path(w.id, e.id), priority: 1.0

      e.checkins.find_each do |c|
        add work_episode_checkin_path(w.id, e.id, c.id), priority: 0.8
      end
    end
  end
end<commit_msg>サイトマップからAnnict DB関係のURLを取り除く<commit_after>S3_REGION = ENV.fetch("S3_REGION")
S3_BUCKET_NAME = ENV.fetch("S3_BUCKET_NAME")
HOST = "https://s3-#{S3_REGION}.amazonaws.com/#{S3_BUCKET_NAME}/"

SitemapGenerator::Sitemap.default_host = "https://annict.com"
SitemapGenerator::Sitemap.sitemaps_host = HOST
SitemapGenerator::Sitemap.sitemaps_path = "sitemaps/"

adapter_options = {
  fog_provider: "AWS",
  aws_access_key_id: ENV.fetch("S3_ACCESS_KEY_ID"),
  aws_secret_access_key: ENV.fetch("S3_SECRET_ACCESS_KEY"),
  fog_directory: S3_BUCKET_NAME,
  fog_region: S3_REGION
}
SitemapGenerator::Sitemap.adapter = SitemapGenerator::S3Adapter.new(adapter_options)

SitemapGenerator::Sitemap.create do
  add about_path, priority: 0.7
  add popular_works_path, priority: 0.9
  add privacy_path
  add search_works_path, priority: 0.8
  add terms_path

  User.find_each do |u|
    add following_user_path(u.username), priority: 0.8
    add followers_user_path(u.username), priority: 0.8
    add user_path(u.username), priority: 0.9, lastmod: u.updated_at

    Status.kind.values.each do |k|
      add user_works_path(u.username, k), priority: 0.8
    end
  end

  Season.find_each do |s|
    add season_works_path(s.slug), priority: 0.9
  end

  Work.find_each do |w|
    add work_path(w.id), priority: 1.0, lastmod: w.updated_at

    w.episodes.find_each do |e|
      add work_episode_path(w.id, e.id), priority: 1.0

      e.checkins.find_each do |c|
        add work_episode_checkin_path(w.id, e.id, c.id), priority: 0.8
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.11532625189681335, 'fraction_numerical': 0.023065250379362672, 'mean_word_length': 4.412151067323481, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '63236', 'n_tokens_mistral': 1344, 'n_tokens_neox': 1326, 'n_words': 238}