Kijiji Manager app for viewing, posting, reposting, and deleting your Kijiji ads.
Built using the Flask framework with Python 3.7+. Completely API driven, with no web scraping. Runs a local webserver which provides the web user interface.
Kijiji Manager is able to handle all types of ads under every Kijiji category (although not every ad type has been extensively tested).
If you find any bugs with posting ads, please create a new issue to report it.
Kijiji Manager requires Python 3.7+. Most manual testing is done on Python 3.7.
Flask
Flask-WTF
Flask-Login
Flask-Executor
WTForms
httpx
xmltodict
is-safe-url
phonenumbers
pgeocode
git clone https://github.com/jackm/kijiji-manager.git
cd kijiji-manager
python3 -m venv venv
source venv/bin/activate
venv/bin/activate
script each time you start a new shell, otherwise the installed Python packages will not be availablepython3-venv
firstpy
command in place of python
or python3
venv/Scripts/Activate
insteadpip install .
kijiji_manager/kijiji-manager-sample.cfg
and rename it to kijiji-manager.cfg
, putting it in the instance folder
instance
at the root of this repository if it does not existinstance/kijiji-manager.cfg
to a random value
python -c "import secrets; print(secrets.token_urlsafe(16))"
python -m kijiji_manager
or kijiji-manager -c instance/kijiji-manager.cfg
--help
to see all possible command line argumentsFor all subsequent runs, start the app again using python -m kijiji_manager
or kijiji-manager -c instance/kijiji-manager.cfg
and then go to the web interface in your browser.
You can also leave the app running in the terminal if you wish.
No background HTTP calls are made unless you refresh or load new pages.
Kijiji employs duplicate ad detection algorithms to try and spot same ads that were recently deleted and then posted again. Some mitigations have been done here to try and avoid detection, but it is still highly recommended to wait at least 24 hours before attempting to repost an ad. If you find that after reposting an ad that it has immediately disappeared, it is likely that it has been flagged as a duplicate and Kijiji has automatically deleted it.
Note that the original ad contents is still saved in the ad XML payload file located in your user instance folder. You can attempt to post this ad again using the "Post Manual" page and selecting the corresponding XML payload file.
usage: kijiji-manager [-h] [-c CONFIG] [-b BIND] [-p PORT] [-d]
optional arguments:
-h, --help show this help message and exit
-c CONFIG, --config CONFIG
path to config file
-b BIND, --bind BIND interface to bind to (default: localhost)
-p PORT, --port PORT port to bind to (default: 5000)
-d, --debug enable debugging
Default values for certain form fields can be chosen by adding any of the following variables to their instance/kijiji-manager.cfg
config file:
DEFAULT_AD_TITLE
DEFAULT_AD_DESCRIPTION
DEFAULT_AD_PRICE
DEFAULT_POSTAL_CODE
DEFAULT_FULL_ADDRESS
DEFAULT_PHONE
DEFAULT_LOCATION2_CONTAINS
DEFAULT_LOCATION3_CONTAINS
Note that these config values are only read once during startup - you will need to restart the app for any changes to take effect.
e.g.
DEFAULT_AD_TITLE = 'This is a test ad title'
DEFAULT_AD_DESCRIPTION = 'This is a test ad description'
DEFAULT_AD_PRICE = 149.99
DEFAULT_POSTAL_CODE = 'A1A 1A1'
DEFAULT_FULL_ADDRESS = '123 Main St.'
DEFAULT_PHONE = '555-5555'
DEFAULT_LOCATION2_CONTAINS = 'Toronto'
DEFAULT_LOCATION3_CONTAINS = 'Markham'
A Dockerfile is provided as well as a docker-compose.yml file to allow running this app within a Docker container. At minimum this method will require Docker to be installed.
Using this method does not require installing any Python packages locally - the whole app will be installed and run within an isolated container.
You should still create a instance/kijiji-manager.cfg
file containing a randomly generated secret key within the instance folder (steps 2 and 3 of Installation).
By default, the web interface will still be reachable at http://localhost:5000/ or http://127.0.0.1:5000/.
If you want to provide a custom config file path other than instance/kijiji-manager.cfg
, this can be done by setting the CONFIG_FILE
environment variable when running the container.
Docker Compose is an additional tool that can be used to easily deploy app containers. In this case, Docker Compose is used to automatically build and run the app container.
Run docker-compose up
from the root of this repository.
If changes are made to the _kijijimanager package, you will have to run docker-compose up --build
instead to force rebuild the container image.
If you do not want to use Docker Compose, you can build the container image and then run the container using the following commands from the root of this repository:
docker build -t kijiji-manager .
docker run --rm --name kijiji-manager -p 5000:80 -v "$(pwd)"/instance:/app/instance kijiji-manager
Append the --detach
option to the docker run
command to run the container in the background (detached mode).
Many of the core architecture concepts have been borrowed from the Kijiji-Reposter project. Many thanks to rybodiddly for the work they have done, especially on the Kijiji API.