Signed-off-by: Ken Swenson <flat@esoteric.moe>
---
This is untested as I cannot get the bot to run on my computer. I believe it to be sound however.
Please test and let me know if changes are needed.
src/comic.rs | 2 +-src/theme.rs | 14 +++++++-------
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/comic.rs b/src/comic.rs
index 8572b72..24a5fec 100644
--- a/src/comic.rs+++ b/src/comic.rs
@@ -101,7 +101,7 @@ impl ComicEmbed {
));
self.0.url = Some(format!(
- "https://garfield.com/comic/{}/{}/{}",+ "https://gocomics.com/garfield/{}/{:02}/{:02}", date.year(),
date.month(),
date.day()
diff --git a/src/theme.rs b/src/theme.rs
index 0af270f..e441590 100644
--- a/src/theme.rs+++ b/src/theme.rs
@@ -1,4 +1,4 @@
-const COMICS_PER_PAGE: u64 = 6;+const COMICS_PER_PAGE: u64 = 10;use regex::Regex;
use reqwest::Client as ReqwestClient;
@@ -16,9 +16,9 @@ pub struct ThemeClient {
impl ThemeClient {
pub fn new_rwc(rwc: ReqwestClient) -> GarfieldResult<Self> {
- let count_re = Regex::new(r#"<span class="pull-right">(?:\d+) of (\d+)</span>"#)?;+ let count_re = Regex::new(r#"(\d.*) Results for Garfield"#)?; let comic_re = Regex::new(
- r#"src="https://d1ejxu6vysztl5.cloudfront.net/comics/garfield/[0-9]{4}/([0-9]{4}-[0-9]{2}-[0-9]{2}).gif"#,+ r#"src="<a itemprop='image' class=\"\" href=\"/garfield/([0-9]+/[0-9]+/[0-9]+)""#, )?;
The program hangs on the second regex, I am not sure why it does not
terminate async_main.
This would be the correct regex for the above:
r#"src="<a itemprop='image' class="" href="/garfield/([0-9]+/[0-9]+/[0-9]+)""#,
Though it does not seem to find what is needed.
Valdemar Erk.