const pandas = require("pandas");
const random = require("random");
const translate = require("translate");
const os = require("os");
// Clear the terminal screen
if (os.name === "nt") {
os.system("cls");
} else {
os.system("clear");
}
// Google Sheets ID
const SHEET_ID = "1xIgcG6shp1af0eggfUkI3QUycZ0v1233UEwnH6wiU8g";
// Google Sheets sheet name
const SHEET_NAME = "less-real_data";
// Google Sheets URL
const sheet_url = "https://docs.google.com/spreadsheets/d/1xIgcG6shp1af0eggfUkI3QUycZ0v1233UEwnH6wiU8g/edit#gid=2002820014";
// CSV URL
const url_1 = sheet_url.replace("/edit#gid=", "/export?format=csv&gid=");
// Load data from Google Sheets into a DataFrame
const df = pandas.read_csv(url_1);
// Skip the first row if A1 is blank
df = df.iloc[1:];
// Select a random index from the DataFrame
const random_index = random.randint(0, df.shape[0] - 1);
const random_row = df.iloc[random_index];
// Combine the anime name, character name, and quote into a string
const output = `${random_row["Anime"]} - ${random_row["Character"]}\n${random_row["Quote"]}`;
// Print the original output
console.log("Original Output:");
console.log(output);
// Translate the output to Turkish
const translator = new translate.Translator();
const translated_output = translator.translate(output, "tr");
// Print the translated output
console.log("-------------------------------------------------------");
console.log("Translated Output:");
console.log(translated_output);