https://github.com/mykeels/farm-invest-cli
A CLI tool, built to detect updates to the products on eFarms, FarmCrowdy, ThriveAgric and AgroPartnerships
https://github.com/mykeels/farm-invest-cli
cli efarms farm farm-crowdy investment node thrive-agric
Last synced: 9 months ago
JSON representation
A CLI tool, built to detect updates to the products on eFarms, FarmCrowdy, ThriveAgric and AgroPartnerships
- Host: GitHub
- URL: https://github.com/mykeels/farm-invest-cli
- Owner: mykeels
- License: mit
- Created: 2019-01-28T12:25:55.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-02-11T00:34:22.000Z (over 4 years ago)
- Last Synced: 2024-04-16T04:28:13.902Z (about 2 years ago)
- Topics: cli, efarms, farm, farm-crowdy, investment, node, thrive-agric
- Language: JavaScript
- Homepage:
- Size: 68.4 KB
- Stars: 18
- Watchers: 2
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Farm Invest CLI
A CLI tool, built to detect updates to the products on:
- [AgroPartnerships](https://agropartnerships.co)
- [EFarms](https://www.efarms.com.ng)
- [ThriveAgric](https://www.thriveagric.com)
- [FarmCrowdy](https://www.farmcrowdy.com)
## Installation
with npm
```sh
npm i -g farm-invest-cli
```
with yarn
```sh
yarn add global farm-invest-cli
```
for developers
```sh
git clone https://github.com/mykeels/farm-invest-cli
cd farm-invest-cli
npm install
npm link
```
## Usage as a CLI tool
```sh
farm-invest-cli
farm-invest-cli agro # only agro-partnerships
farm-invest-cli efarms # only efarms
farm-invest-cli farm-crowdy # only farm-crowdy
farm-invest-cli thrive-agric # only thrive-agric
```
You'll get an output like:

Where the green text shows new products, and text is only shown when there is a difference between the products currently existing and the last time it checked.
## Usage in Node environment
```js
const { syncAll, syncAgro, syncEFarms, syncFarmCrowdy, syncThriveAgric } = require('farm-invest-cli')
syncAll().then(diff => {
console.log(diff) // an array of (array | fast-array-diff) objects for all sources
})
syncAgro().then(diff => {
console.log(diff) // an (array | fast-array-diff) object for Agro-Partnerships
})
syncEFarms().then(diff => {
console.log(diff) // an (array | fast-array-diff) object for eFarms
})
syncFarmCrowdy().then(diff => {
console.log(diff) // an (array | fast-array-diff) object for Farm-Crowdy
})
syncThriveAgric().then(diff => {
console.log(diff) // an (array | fast-array-diff) object for Thrive-Agric
})
```
NB: A fast-array-diff object looks like:
```js
{
removed:[
{ title: 'Foo', link: 'Bar' },
{ title: 'Bar', link: 'Foo' }
],
added: [ { title: 'Baz', link: 'Foo' } ]
}
```
```js
const { getAgro, getEFarms, getFarmCrowdy, getThriveAgric } = require('farm-invest-cli')
getAgro().then(productList => {
console.log(productList) // an array of active products on Agro-Partnerships
})
getEFarms().then(productList => {
console.log(productList) // an array of active products on eFarms
})
getFarmCrowdy().then(productList => {
console.log(productList) // an array of active products on Farm-Crowdy
})
getThriveAgric().then(productList => {
console.log(productList) // an array of active products on Thrive-Agric
})
```