Compare commits

...

2 commits

Author SHA1 Message Date
918efeab4f
Merge a1fa2796ef into 6d32c897ac 2024-08-04 12:55:42 -03:00
6d32c897ac scraper: shuffle links
to get other links if we start getting blocked
2024-08-02 16:25:14 -03:00

View file

@ -6,6 +6,8 @@ use crate::db::Db;
use crate::scraper::Scraper; use crate::scraper::Scraper;
use futures::Future; use futures::Future;
use preciazo::supermercado::Supermercado; use preciazo::supermercado::Supermercado;
use rand::seq::SliceRandom;
use rand::thread_rng;
use reqwest::Url; use reqwest::Url;
#[derive(Clone)] #[derive(Clone)]
@ -48,6 +50,7 @@ impl Auto {
if let Some(n) = self.args.n_products { if let Some(n) = self.args.n_products {
links.truncate(n); links.truncate(n);
} }
links.shuffle(&mut thread_rng());
links links
}; };
// { // {