Upload files to "/"

This commit is contained in:
2026-05-23 15:11:39 +00:00
commit a808355f00
5 changed files with 196 additions and 0 deletions

34
Main.java Normal file
View File

@@ -0,0 +1,34 @@
public class Main {
public static void main(String[] args) {
String botToken = "8586609598:AAHRN6eqpkqCOP4xjX_FH20jdpjbJncmqBY";
String chatId = "462049828";
TelegramNotifier.init(botToken, chatId);
System.out.println("Telegram-уведомления активированы!");
String url = "https://cbr.ru/currency_base/daily/";
while (true) {
try {
String html = WebLoader.loadPage(url);
double usd = CurrencyParser.parseUSD(html);
if (usd != -1) {
System.out.println("USD: " + usd);
ExcelWriter.write(usd);
CurrencyAnalyzer.analyze(usd);
} else {
System.err.println("Не удалось спарсить курс USD");
}
Thread.sleep(60 * 1000);
} catch (Exception e) {
e.printStackTrace();
}
}
}
}