1.0.6 • Published 12 months ago

craigslist-cli-tool v1.0.6

Weekly downloads
-
License
ISC
Repository
-
Last release
12 months ago

Craigslist Searcher

Description

Duration: 4 days

This is a simple tool for searching Craigslist, designed to be run from the command line. The tool is currently set up to search 'free stuff' section of Minneapolis craigslist for 'dirt' and email the search results to my personal email, every day at 7 am and 1 pm.

Screenshot

image

Prerequisites

Installation

  1. Install the latest version of Selenium Webdriver for Chrome
  2. Set up an app-specific password in your google account
  3. Clone the GitHub repository to your computer.
  4. Create a .env file in the repository, and set up the following environment variables:
    1. NODE_MAILER_USER="your Gmail username"
    2. NODE_MAILER_USER_KEY="app-specific password created in step 2"
    3. MY_EMAIL="your email address"
  5. Open the code in your editor of choice and run an npm install.
  6. In your terminal, navigate to the repository directory, then run npm start.

Usage

  1. To search for a different item, update searchQuery variable
  2. To search a different city, update the URL in scrapeSelenium.js file.
  3. To receive a text of results, update the code in index.js file from:
  searchCraigslist(searchQuery).then(results => sendEmailorText(results));

to:

searchCraigslist(searchQuery).then(results => sendEmailorText(results, 'PHONE NUMBER'));
  1. To change the times when you receive emails, update the cron.schedule line. For example, to receive an email at 12:00 pm and 6:00 pm every day, update the code to
cron.schedule('0 12,18 * * *', () => {
  1. Run app in background with PM2:
    1. In terminal, navigate to the repository directory.
    2. Run npm install pm2 -g
    3. Run pm2 start index.js --name 'OPTIONAL_APP_NAME'. PM2 will start the app, daemonize it, and run it in background.
    4. To stop the tool, run pm2 stop OPTIONAL_APP_NAME.

Built With

Link to Code on GitHub:

https://github.com/AlinaTrukhina/craigslist-cli-tool

1.0.2

12 months ago

1.0.1

12 months ago

1.0.6

12 months ago

1.0.5

12 months ago

1.0.4

12 months ago

1.0.3

12 months ago

1.0.0

12 months ago