# craigslist-cli-tool

> tool to search craigslist

Latest version **1.0.6** (published 2023-05-29) · ISC license · 0 weekly downloads

## Install

```sh
npm install craigslist-cli-tool
pnpm add craigslist-cli-tool
yarn add craigslist-cli-tool
bun add craigslist-cli-tool
```

Provides the command `craigslist-cli-tool`.

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.6 |
| Published | 2023-05-29 |
| First published | 2023-05-12 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 6 |
| Unpacked size | 11.9 KB |
| Known vulnerabilities | 0 (+12 in 1 direct dependencies) |
| Install scripts | no |
| Maintainers | my-cats-friend |

## Links

- npm: https://www.npmjs.com/package/craigslist-cli-tool
- npm.io page: https://npm.io/package/craigslist-cli-tool

## Dependencies (6)

- [dotenv](https://npm.io/package/dotenv.md) ^16.0.3
- [express](https://npm.io/package/express.md) ^4.18.2
- [inquirer](https://npm.io/package/inquirer.md) ^9.2.2
- [node-cron](https://npm.io/package/node-cron.md) ^3.0.2
- [nodemailer](https://npm.io/package/nodemailer.md) ^6.9.2
- [selenium-webdriver](https://npm.io/package/selenium-webdriver.md) ^4.9.2

## Recent versions

- 1.0.6 (latest) — 2023-05-29
- 1.0.5 — 2023-05-18
- 1.0.4 — 2023-05-16
- 1.0.3 — 2023-05-14
- 1.0.2 — 2023-05-14
- 1.0.1 — 2023-05-14
- 1.0.0 — 2023-05-12

## README

# 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](https://github.com/AlinaTrukhina/craigslist-cli-tool/assets/46235932/67b4afbe-b7d7-4828-b304-ce04c320f8fd)

### Prerequisites

- [Node.js](https://nodejs.org/en/)
- Gmail with 2 factor authentication
- [Selenium WebDriver for Chrome](https://chromedriver.chromium.org/downloads)

## Installation

1. Install the latest version of [Selenium Webdriver for Chrome](https://chromedriver.chromium.org/downloads)
2. Set up an [app-specific password in your google account](https://support.google.com/accounts/answer/185833?hl=en)
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: 
```javascript 
  searchCraigslist(searchQuery).then(results => sendEmailorText(results));
  ```
  to: 
  ```javascript 
  searchCraigslist(searchQuery).then(results => sendEmailorText(results, 'PHONE NUMBER'));
  ```
4. 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
```javascript
cron.schedule('0 12,18 * * *', () => {
```
5. Run app in background with [PM2](https://pm2.keymetrics.io/):
    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
- JavaScript
- Express
- Selenium Webdriver
- Nodemailer(https://nodemailer.com/about/)
- [node-cron](https://www.npmjs.com/package/node-cron)

## Link to Code on GitHub:
https://github.com/AlinaTrukhina/craigslist-cli-tool

---
_Source: https://npm.io/package/craigslist-cli-tool · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
