Add GUID to items
This commit is contained in:
parent
fbeb1b31d9
commit
47e47236ab
1
Jenkinsfile
vendored
1
Jenkinsfile
vendored
@ -36,6 +36,7 @@ pipeline {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// For this to work, edit sonar-scanner script to set use_embedded_jre=false
|
||||||
stage('SonarQube Analysis') {
|
stage('SonarQube Analysis') {
|
||||||
steps {
|
steps {
|
||||||
withSonarQubeEnv(installationName: 'SQ Bib Watcher', envOnly: true) {
|
withSonarQubeEnv(installationName: 'SQ Bib Watcher', envOnly: true) {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
use config::Config;
|
use config::Config;
|
||||||
use reqwest::header;
|
use reqwest::header;
|
||||||
use rss::{Channel, ChannelBuilder, ItemBuilder};
|
use rss::{Channel, ChannelBuilder, GuidBuilder, ItemBuilder};
|
||||||
use scraper::{Html, Selector};
|
use scraper::{Html, Selector};
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::{error::Error, fs::File, io::BufReader};
|
use std::{error::Error, fs::File, io::BufReader};
|
||||||
@ -84,12 +84,17 @@ fn search(url: &str, title: &str) -> Result<(), Box<dyn Error>> {
|
|||||||
.build()),
|
.build()),
|
||||||
}?;
|
}?;
|
||||||
let mut items = channel.clone().into_items();
|
let mut items = channel.clone().into_items();
|
||||||
|
let guid = GuidBuilder::default()
|
||||||
|
.value(title.to_string() + &Utc::now().to_rfc2822())
|
||||||
|
.permalink(false)
|
||||||
|
.build();
|
||||||
items.push(
|
items.push(
|
||||||
ItemBuilder::default()
|
ItemBuilder::default()
|
||||||
.title(Some(title.to_string()))
|
.title(Some(title.to_string()))
|
||||||
.pub_date(Some(Utc::now().to_rfc2822()))
|
.pub_date(Some(Utc::now().to_rfc2822()))
|
||||||
.link(Some(url.to_string()))
|
.link(Some(url.to_string()))
|
||||||
.description(Some(status))
|
.description(Some(status))
|
||||||
|
.guid(Some(guid))
|
||||||
.build(),
|
.build(),
|
||||||
);
|
);
|
||||||
channel.set_items(items);
|
channel.set_items(items);
|
||||||
|
Loading…
Reference in New Issue
Block a user