mirror of
https://codeberg.org/scip/kleingebaeck.git
synced 2025-12-17 12:31:03 +01:00
@@ -43,7 +43,7 @@ const (
|
|||||||
"Category: {{.Category}}\r\nCondition: {{.Condition}}\r\nCreated: {{.Created}}\r\n\r\n{{.Text}}\r\n"
|
"Category: {{.Category}}\r\nCondition: {{.Condition}}\r\nCreated: {{.Created}}\r\n\r\n{{.Text}}\r\n"
|
||||||
Useragent string = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) " +
|
Useragent string = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) " +
|
||||||
"AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
|
"AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
|
||||||
DefaultAdNameTemplate string = "{{.Slug}}-{{.Id}}"
|
DefaultAdNameTemplate string = "{{.Slug}}"
|
||||||
)
|
)
|
||||||
|
|
||||||
const Usage string = `This is kleingebaeck, the kleinanzeigen.de backup tool.
|
const Usage string = `This is kleingebaeck, the kleinanzeigen.de backup tool.
|
||||||
|
|||||||
@@ -438,16 +438,18 @@ func SetIntercept(ads []Adsource) {
|
|||||||
|
|
||||||
// we just use 2 images, put this here
|
// we just use 2 images, put this here
|
||||||
for _, image := range []string{"t/1.jpg", "t/2.jpg"} {
|
for _, image := range []string{"t/1.jpg", "t/2.jpg"} {
|
||||||
httpmock.RegisterResponder("GET", image, httpmock.NewBytesResponder(200, GetImage(image)))
|
httpmock.RegisterResponder("GET", image,
|
||||||
|
httpmock.NewBytesResponder(200, GetImage(image)))
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func VerifyAd(ad AdConfig) error {
|
func VerifyAd(ad AdConfig) error {
|
||||||
body := ad.Title + ad.Price + ad.Id + "Kleinanzeigen => " + ad.Category + ad.Condition + ad.Created
|
body := ad.Title + ad.Price + ad.Id + "Kleinanzeigen => " +
|
||||||
|
ad.Category + ad.Condition + ad.Created
|
||||||
|
|
||||||
// prepare ad dir name using DefaultAdNameTemplate
|
// prepare ad dir name using DefaultAdNameTemplate
|
||||||
c := Config{Adnametemplate: DefaultAdNameTemplate}
|
c := Config{Adnametemplate: "{{ .Slug }}"}
|
||||||
adstruct := Ad{Slug: ad.Slug, Id: ad.Id}
|
adstruct := Ad{Slug: ad.Slug, Id: ad.Id}
|
||||||
addir, err := AdDirName(&c, &adstruct)
|
addir, err := AdDirName(&c, &adstruct)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user