2023-12-15 14:50:40 +01:00
|
|
|
=head1 NAME
|
|
|
|
|
|
|
|
|
|
kleingebaeck - kleinanzeigen.de backup tool
|
|
|
|
|
|
|
|
|
|
=head1 SYNOPSYS
|
|
|
|
|
|
|
|
|
|
Usage: kleingebaeck [-dvVhmoc] [<ad-listing-url>,...]
|
|
|
|
|
Options:
|
2023-12-19 18:23:41 +01:00
|
|
|
--user -u <uid> Backup ads from user with uid <uid>.
|
|
|
|
|
--debug -d Enable debug output.
|
|
|
|
|
--verbose -v Enable verbose output.
|
|
|
|
|
--outdir -o <dir> Set output dir (default: current directory)
|
|
|
|
|
--limit -l <num> Limit the ads to download to <num>, default: load all.
|
|
|
|
|
--config -c <file> Use config file <file> (default: ~/.kleingebaeck).
|
|
|
|
|
--manual -m Show manual.
|
|
|
|
|
--help -h Show usage.
|
|
|
|
|
--version -V Show program version.
|
|
|
|
|
|
2023-12-15 14:50:40 +01:00
|
|
|
=head1 DESCRIPTION
|
|
|
|
|
|
|
|
|
|
This tool can be used to backup ads on the german ad page L<https://kleinanzeigen.de>.
|
|
|
|
|
|
|
|
|
|
It downloads all (or only the specified ones) ads of one user into a
|
|
|
|
|
directory, each ad into its own subdirectory. The backup will contain
|
|
|
|
|
a textfile B<Adlisting.txt> which contains the ad contents such as
|
|
|
|
|
title, body, price etc. All images will be downloaded as well.
|
|
|
|
|
|
|
|
|
|
=head1 CONFIGURATION
|
|
|
|
|
|
2023-12-19 18:23:41 +01:00
|
|
|
You can create a config file to save typing. By default
|
|
|
|
|
C<~/.kleingebaeck> is being used but you can specify one with C<-c> as
|
|
|
|
|
well. We use TOML as our configuration language. See
|
|
|
|
|
L<https://toml.io/en/>.
|
2023-12-15 14:50:40 +01:00
|
|
|
|
2023-12-19 18:23:41 +01:00
|
|
|
Format is pretty simple:
|
2023-12-15 14:50:40 +01:00
|
|
|
|
|
|
|
|
user = 1010101
|
2023-12-19 18:23:41 +01:00
|
|
|
loglevel = verbose
|
2023-12-15 14:50:40 +01:00
|
|
|
outdir = "test"
|
2023-12-19 18:23:41 +01:00
|
|
|
template = """
|
|
|
|
|
Title: {{.Title}}
|
|
|
|
|
Price: {{.Price}}
|
|
|
|
|
Id: {{.Id}}
|
|
|
|
|
Category: {{.Category}}
|
|
|
|
|
Condition: {{.Condition}}
|
|
|
|
|
Created: {{.Created}}
|
|
|
|
|
|
|
|
|
|
{{.Text}}
|
|
|
|
|
"""
|
2023-12-16 20:32:10 +01:00
|
|
|
|
2023-12-19 18:23:41 +01:00
|
|
|
Be carefull if you want to change the template. The variable is a
|
|
|
|
|
multiline string surrounded by three double quotes. You can left out
|
|
|
|
|
certain fields and use any formatting you like. Refer to
|
|
|
|
|
L<https://pkg.go.dev/text/template> for details how to write a
|
|
|
|
|
template.
|
2023-12-16 20:32:10 +01:00
|
|
|
|
2023-12-19 18:23:41 +01:00
|
|
|
If you're on windows and want to customize the output directory, put
|
|
|
|
|
it into single quotes to avoid the backslashes interpreted as escape
|
|
|
|
|
chars like this:
|
2023-12-16 20:32:10 +01:00
|
|
|
|
2023-12-19 18:23:41 +01:00
|
|
|
outdir = 'C:\Data\Ads'
|
2023-12-15 14:50:40 +01:00
|
|
|
|
|
|
|
|
=head1 SETUP
|
|
|
|
|
|
|
|
|
|
To setup the tool, you need to lookup your userid on
|
|
|
|
|
kleinanzeigen.de. Go to your ad overview page while NOT being logged
|
|
|
|
|
in:
|
|
|
|
|
|
|
|
|
|
https://www.kleinanzeigen.de/s-bestandsliste.html?userId=XXXXXX
|
|
|
|
|
|
|
|
|
|
The B<XXXXX> part is your userid.
|
|
|
|
|
|
|
|
|
|
Put it into the configfile as outlined above. Also specify an output
|
|
|
|
|
directory. Then just execute C<kleingebaeck>.
|
|
|
|
|
|
|
|
|
|
You can use the B<-v> option to get verbose output or B<-d> to enable
|
|
|
|
|
debugging.
|
|
|
|
|
|
|
|
|
|
=head1 BUGS
|
|
|
|
|
|
|
|
|
|
In order to report a bug, unexpected behavior, feature requests
|
|
|
|
|
or to submit a patch, please open an issue on github:
|
|
|
|
|
L<https://github.com/TLINDEN/kleingebaeck/issues>.
|
|
|
|
|
|
|
|
|
|
Please repeat the failing command with debugging enabled C<-d> and
|
|
|
|
|
include the output in the issue.
|
|
|
|
|
|
|
|
|
|
=head1 LIMITATIONS
|
|
|
|
|
|
|
|
|
|
The C<kleingebaeck> doesn't currently check if it has downloaded a
|
|
|
|
|
file already, so it downloads everything again every time you execute
|
|
|
|
|
it. Be aware of it. This will change in the future.
|
|
|
|
|
|
|
|
|
|
Also there's currently no parallelization implemented. This will
|
|
|
|
|
change in the future.
|
|
|
|
|
|
|
|
|
|
=head1 LICENSE
|
|
|
|
|
|
|
|
|
|
Licensed under the GNU GENERAL PUBLIC LICENSE version 3.
|
|
|
|
|
|
|
|
|
|
=head1 Author
|
|
|
|
|
|
|
|
|
|
T.v.Dein <tom AT vondein DOT org>
|
|
|
|
|
|
2023-12-14 19:00:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
=cut
|