Skip to content

Commit c57f2d3

Browse files
committed
chore(bot): default min-score should be 0
1 parent f96f168 commit c57f2d3

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

crates/bots/rostra-bot/src/main.rs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ pub struct Opts {
8585
pub max_articles_per_run: usize,
8686

8787
/// Minimum score threshold for articles
88-
#[arg(long, default_value = "50")]
88+
#[arg(long, default_value = "0")]
8989
pub min_score: u32,
9090

9191
/// Data dir to store the database in
@@ -124,12 +124,13 @@ async fn main() -> BotResult<()> {
124124
let opts = Opts::parse();
125125

126126
match opts.command {
127-
Some(Command::Dev { dev_command }) => {
128-
handle_dev_command(dev_command).await
129-
}
127+
Some(Command::Dev { dev_command }) => handle_dev_command(dev_command).await,
130128
None => {
131129
// Default behavior - run the bot
132-
let secret_file = opts.secret_file.clone().ok_or_else(|| BotError::MissingSecretFile)?;
130+
let secret_file = opts
131+
.secret_file
132+
.clone()
133+
.ok_or_else(|| BotError::MissingSecretFile)?;
133134
run_bot(opts, secret_file).await
134135
}
135136
}
@@ -200,7 +201,11 @@ async fn handle_dev_command(dev_command: DevCommand) -> BotResult<()> {
200201

201202
match scraper.scrape_frontpage().await {
202203
Ok(articles) => {
203-
println!("Successfully scraped {} articles from {}:", articles.len(), source);
204+
println!(
205+
"Successfully scraped {} articles from {}:",
206+
articles.len(),
207+
source
208+
);
204209
println!();
205210

206211
for (i, article) in articles.iter().enumerate() {

crates/bots/rostra-bot/src/scraper.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,8 @@ impl LobstersScraper {
237237
let url = title_link.value().attr("href").map(|s| s.to_string());
238238

239239
// Extract score from voting element - correct selector for Lobsters
240-
let vote_selector = Selector::parse("div.voters > a.upvoter").map_err(|_| ScraperError::HtmlParse)?;
240+
let vote_selector =
241+
Selector::parse("div.voters > a.upvoter").map_err(|_| ScraperError::HtmlParse)?;
241242
let score = story_element
242243
.select(&vote_selector)
243244
.next()

0 commit comments

Comments
 (0)