Coder Social home page Coder Social logo

mykeels / farm-invest-cli Goto Github PK

View Code? Open in Web Editor NEW
19.0 2.0 2.0 70 KB

A CLI tool, built to detect updates to the products on eFarms, FarmCrowdy, ThriveAgric and AgroPartnerships

License: MIT License

JavaScript 98.89% Shell 1.11%
efarms farm-crowdy thrive-agric investment cli node farm

farm-invest-cli's Introduction

Farm Invest CLI

A CLI tool, built to detect updates to the products on:

Installation

with npm

npm i -g farm-invest-cli

with yarn

yarn add global farm-invest-cli

for developers

git clone https://github.com/mykeels/farm-invest-cli
cd farm-invest-cli
npm install
npm link

Usage as a CLI tool

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:

farm-invest-cli output

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

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:

{
   removed:[
       { title: 'Foo', link: 'Bar' },
       { title: 'Bar', link: 'Foo' }
   ],
   added: [ { title: 'Baz', link: 'Foo' } ]
}
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
})

farm-invest-cli's People

Contributors

dependabot[bot] avatar lilpolymath avatar mykeels avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

farm-invest-cli's Issues

Farmcrowdy

Expected Behaviour

  • To return an array of products with their Title, their price, link to products and returns over investment.

Current Behaviour

  • Returns an empty array

Possible Causes

  • There is an update to the UI on the products page.
  • Products are paginated.

Possible Solution

  • Update src/sites/farm-crowdy.js to match the new UI.

Agro Partnerships

Expected Behaviour

  • Returns all the products that are open with their title, price, link, returns and type.

Current Behaviour

  • Returns an empty array.

Possible Causes

  • Requires that you login before you can see the investments.
  • Possible that the UI for this has also changed seeing that the business logic has.

Possible Solution

  • Update the src/sites/agro.js to fit gather data properly.

Thrive Agric

Expected Behaviour

  • Returns all the products that are open with their title, price, link, returns and type.

Current Behaviour

  • Returns an empty array.

Possible Causes

  • There is an update to the UI on the products page.

Possible Solution

  • Update src/sites/thrive-agric.js to match the new UI.

EFarms

Expected Behaviour

  • To return an array of products with their Name, Price, Link to the product, Returns on Investment and the days left till the period is over.

Current Behaviour

  • Returns an empty array.

Possible Causes

  • There is an update to the UI on the products page.
  • Products are paginated.

Possible Solution

  • Update src/sites/efarms.js to match the new UI.

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.