Upload files to "/"
This commit is contained in:
34
Main.java
Normal file
34
Main.java
Normal 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user