<commit_before>#!/usr/bin/env ruby
# frozen_string_literal: true

require 'rest_client'
require 'json'
require 'octokit'
require 'fileutils'
require 'yaml'

# Export from these organizations
ORGS = %w[teamdigitale italia].freeze

# Project's prefixes we can translate to a user friendly string in the UI.
# See todo_projects_dict in _data/l10n.yml.
PROJECS_PREFIX = %w[spid- 18app anpr- daf- dati- pianotriennale- lg- design- security- cie-].freeze

# List of technologies shown in the UI
TECH_LIST = %w[
  angular react design html arduino bootstrap frontend
  perl python cpp scala php csharp java android ios dotnet
  wordpress metabase ansible docker magento joomla django
].sort.freeze

# Import issues with at least one of these labels
ONLY_WITH_LABEL = ['help wanted', 'Hacktoberfest'].freeze

# Show these labels in the UI, if present.
ISSUE_TYPES = ['bug', 'enhancement', 'new project', 'Hacktoberfest'].freeze

# Ignore these repos using the full_name (ie. 'organization/repo')
BLACKLISTED_REPOS = [].freeze

GITHUB_ACCESS_TOKEN = ENV.fetch('GITHUB_ACCESS_TOKEN', '')

def fetch(url, headers = {})
  rest_params = {
    'per_page' => 100,
    'page' => 1,
    'type' => 'public'
  }

  results = []
  loop do
    print "."
    response = JSON.parse(RestClient.get(url, {
      Authorization: "token #{GITHUB_ACCESS_TOKEN}", params: rest_params
    }.merge(headers)))
<commit_msg>fix: don't export Hacktoberfest issues<commit_after>#!/usr/bin/env ruby
# frozen_string_literal: true

require 'rest_client'
require 'json'
require 'octokit'
require 'fileutils'
require 'yaml'

# Export from these organizations
ORGS = %w[teamdigitale italia].freeze

# Project's prefixes we can translate to a user friendly string in the UI.
# See todo_projects_dict in _data/l10n.yml.
PROJECS_PREFIX = %w[spid- 18app anpr- daf- dati- pianotriennale- lg- design- security- cie-].freeze

# List of technologies shown in the UI
TECH_LIST = %w[
  angular react design html arduino bootstrap frontend
  perl python cpp scala php csharp java android ios dotnet
  wordpress metabase ansible docker magento joomla django
].sort.freeze

# Import issues with at least one of these labels
ONLY_WITH_LABEL = ['help wanted'].freeze

# Show these labels in the UI, if present.
ISSUE_TYPES = ['bug', 'enhancement', 'new project'].freeze

# Ignore these repos using the full_name (ie. 'organization/repo')
BLACKLISTED_REPOS = [].freeze

GITHUB_ACCESS_TOKEN = ENV.fetch('GITHUB_ACCESS_TOKEN', '')

def fetch(url, headers = {})
  rest_params = {
    'per_page' => 100,
    'page' => 1,
    'type' => 'public'
  }

  results = []
  loop do
    print "."
    response = JSON.parse(RestClient.get(url, {
      Authorization: "token #{GITHUB_ACCESS_TOKEN}", params: rest_params
    }.merge(headers)))

{'fraction_non_alphanumeric': 0.10978692668833515, 'fraction_numerical': 0.00577825929938606, 'mean_word_length': 4.33718689788054, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, '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': '6481287', 'n_tokens_mistral': 972, 'n_tokens_neox': 927, 'n_words': 290}