Code Monkey home page Code Monkey logo

leboncrevard's Introduction

leboncrevard

This is a simple Python scrapper for the french ad website leboncoin.fr that mails you the latest ads you are interested in.

Synopsis & Motivation

I developed this small tool for two reasons:

  • laziness: I don't want to go to the website and manually search for stuff every days,
  • speed: I want to receive some ads quickly to be contact the sellers ASAP.

Usage

  • Install the project:

    $ pip install leboncrevard
    
  • You can set the configuration with the following environment variables (an SMTP server that supports STARTTLS is mandatory, Gmail is fine):

    $ export LBC_SMTP_USER="user"
    $ export LBC_SMTP_PASS="pass"
    $ export LBC_SMTP_SERVER="smtp.gmail.com:587"
    $ export LBC_JOB_FILE="jobs.csv"
    $ export LBC_DELETE_FILE="delete.csv"
    
  • Fill the "job file" defined by LBC_JOB_FILE (see syntax below), default is jobs.csv

  • Run the application:

    $ leboncrevard &>> leboncrevard.log
    

The entries in both of these files should look like this:

"Title","http://www.leboncoin.fr/voitures/offres/pays_de_la_loire/occasions/?f=a&th=1&q=fuego",60,[email protected]

The numeric field is the time interval (in minutes) you want between scraping sessions. You can add new entries, the script parses the file regularly and will add them. You can also delete jobs by moving then from the "job file" to the "delete file" (interval and recipients are ignored when deleting a job, all instances are removed).

The script will create csv files using job names in order to store an history of already mailed ads.

Limitations and bugs

Seems to run quite well for me, but there may be bugs that I did not foresee or triggered through usage. Feel free to open issues and pull requests.

Disclaimer

Usual stuff, I am not a professional Python developer and made this for my personal use. Feel free to use it at your own risks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.