<commit_before>## wikigram-tg
## Source is distributed under the AGPL v3.0
## https://www.gnu.org/licenses/agpl-3.0.html
##
## Contributions to the code are welcome.

require 'telegram/bot'
require 'mediawiki_api'
require 'json'

## CONFIGURATION START ##
token = 'INSERT_YOUR_BOT_TOKEN_HERE' # Telegram bot API token
api_ep = 'https://wikigram.it/home/api.php' # Mediawiki API endpoint
# api_ep = 'https://it.wikipedia.org/w/api.php' # Example: Wikipedia API endpoint
page_uri = "#{api_ep[0..-8]}index.php/" # Base URL for pages
# page_uri = "#{api_ep[0..-10]}wiki/" # Example: URL pattern for Wikipedia
## CONFIGURATION END ##

mw = MediawikiApi::Client.new api_ep
bot_id = token.split(':').at(0).to_i

Telegram::Bot::Client.run(token) do |bot|
  bot.listen do |message|
    case message<commit_msg>Modifica endpoint API + link base<commit_after>## wikigram-tg
## Source is distributed under the AGPL v3.0
## https://www.gnu.org/licenses/agpl-3.0.html
##
## Contributions to the code are welcome.

require 'telegram/bot'
require 'mediawiki_api'
require 'json'

## CONFIGURATION START ##
token = 'INSERT_YOUR_BOT_TOKEN_HERE' # Telegram bot API token
api_ep = 'https://wikigram.it/api.php' # Mediawiki API endpoint
# api_ep = 'https://it.wikipedia.org/w/api.php' # Example: Wikipedia API endpoint
page_uri = "#{api_ep[0..-8]}/" # Base URL for pages
# page_uri = "#{api_ep[0..-10]}wiki/" # Example: URL pattern for Wikipedia
## CONFIGURATION END ##

mw = MediawikiApi::Client.new api_ep
bot_id = token.split(':').at(0).to_i

Telegram::Bot::Client.run(token) do |bot|
  bot.listen do |message|
    case message
{'fraction_non_alphanumeric': 0.15609452736318408, 'fraction_numerical': 0.012437810945273632, 'mean_word_length': 4.625874125874126, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 2, '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': '3890988', 'n_tokens_mistral': 579, 'n_tokens_neox': 573, 'n_words': 141}