2023-09-07 18:02:36 +01:00
|
|
|
mod processes;
|
|
|
|
mod services;
|
2023-08-18 20:11:49 +01:00
|
|
|
|
2023-08-31 08:42:56 +01:00
|
|
|
use anyhow::Result;
|
|
|
|
|
2023-09-07 18:02:36 +01:00
|
|
|
use crate::processes::post_saver::PostSaver;
|
|
|
|
use crate::processes::profile_classifier::ProfileClassifier;
|
|
|
|
use crate::services::ai::AI;
|
|
|
|
use crate::services::bluesky::Bluesky;
|
|
|
|
use crate::services::database::Database;
|
2023-08-18 20:11:49 +01:00
|
|
|
|
|
|
|
#[tokio::main]
|
2023-08-31 08:42:56 +01:00
|
|
|
async fn main() -> Result<()> {
|
2023-09-07 18:02:36 +01:00
|
|
|
// TODO: Use env vars
|
|
|
|
let ai = AI::new("fake-api-key", "https://api.openai.com");
|
|
|
|
let bluesky = Bluesky::new("https://bsky.social");
|
|
|
|
let database =
|
|
|
|
Database::connect("postgres://postgres:password@localhost/nederlandskie").await?;
|
2023-08-31 08:42:56 +01:00
|
|
|
|
2023-09-07 18:02:36 +01:00
|
|
|
let post_saver = PostSaver::new(&database, &bluesky);
|
|
|
|
let profile_classifier = ProfileClassifier::new(&database, &ai, &bluesky);
|
2023-09-06 07:26:03 +01:00
|
|
|
|
2023-09-07 18:02:36 +01:00
|
|
|
tokio::try_join!(post_saver.start(), profile_classifier.start())?;
|
2023-08-18 20:11:49 +01:00
|
|
|
|
|
|
|
Ok(())
|
|
|
|
}
|