Daily statistics per region in Ukraine
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
include "own-modules/openai/OpenAI.own" | |
OPENAI_API_KEY = getenv("OPENAI_API_KEY", "") | |
if OPENAI_API_KEY.isEmpty() { | |
println "OPENAI_API_KEY is required" | |
exit(1) | |
} | |
openai = new OpenAI(OPENAI_API_KEY) | |
extract(isOk, response) = openai.chatCompletionsBasic( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bin | |
*.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__pycache__ | |
.idea | |
input | |
library | |
logs | |
images.db |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*.pyc | |
config.yml | |
feed.db |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public void processUpdates(List<Update> updates) { | |
for (Update update : updates) { | |
processUpdate(update); | |
} | |
} | |
private void processUpdate(Update update) { | |
if (update == null) { | |
return; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public void processUpdates(List<Update> updates) { | |
for (Update update : updates) { | |
if (update != null) { | |
Message message = update.getMessage(); | |
// don't process old messages | |
long current = System.currentTimeMillis() / 1000; | |
if (message.getDate() + 60 >= current) { | |
long chatId = message.getChatId(); | |
if (chatId == config.tournamentChat()) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use okhttp, http, json | |
class TelegramBot { | |
def TelegramBot(token) { | |
this.token = token | |
this.client = okhttp.newClient() | |
.callTimeout(6, "minutes") | |
.connectTimeout(5, "minutes") | |
.readTimeout(5, "minutes") | |
.build() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
own-modules | |
main_*.own | |
redditimages.db |
NewerOlder