Coder Social home page Coder Social logo

naseif / more4less Goto Github PK

View Code? Open in Web Editor NEW
5.0 3.0 0.0 320 KB

A price search engine for various german online shops

Home Page: https://naseif.github.io/more4less/

License: MIT License

Shell 0.08% TypeScript 99.87% PowerShell 0.05%
preisvergleich preissuchmachine price-search-engine more4less-price more4less-search-engine price-scraper otto ebay-scraper amazon-scraper mediamarkt

more4less's Introduction

more4less

A fast flexible price search engine for various german online shops!

Motivation

Curiosity 🤷‍♂️

Supported online shops:

  • eBay
  • Amazon
  • MediaMarkt
  • MediMax
  • Mindfactory
  • Saturn
  • Cyberport
  • Proshop.de
  • Otto.de
  • Alternate
  • Kaufland
  • Clevertronic
  • Bücher.de

Installation

npm i more4less

Importing

TypeScript

import * as more4less from "more4less";

import { AmazonPriceSearchEngine, EbayPriceSearchEngine } from 'more4less'; // Individual classes

JavaScript

const more4less = require("more4less");

const { EbayPriceSearchEngine } = require('more4less'); // Individual classes

Examples

Search on a single shop

import * as more4less from "more4less";

const ebay = new more4less.EbayPriceSearchEngine();

(async () => {
    const getProduct = await ebay.search("alexa firestick");
    console.log(getProduct);
})();


// or

import { SearchEngineFactory } from "more4less";

const engine = new SearchEngineFactory().GetSearchEngine("Amazon");

(async () => {
    const getProduct = await engine.search("alexa firestick");
    console.log(getProduct);
})();

Search on all supported shops

import * as more4less from "more4less";

const engine = new SearchEngineFactory().GetSearchEngine("All");

(async () => {
    const getProduct = await engine.search("alexa firestick");
    console.log(getProduct);
})();

Search on multiple shops

import * as more4less from "more4less";

const searchEngines = new more4less.SearchEngineList([new more4less.EbayPriceSearchEngine(), new more4less.AmazonPriceSearchEngine2()]);

(async () => {
    const getProduct = await searchEngines.search("alexa firestick");
    console.log(getProduct);
})();

Storing the Output

There are two ways of saving the output, either as JSON or CSV

import * as more4less from "more4less";

const searchEngines = new more4less.SearchEngineList([new more4less.EbayPriceSearchEngine(), new more4less.AmazonPriceSearchEngine2()]);
const output = new more4less.JSONOutput("test.json") // path and filename

(async () => {
    const getProduct = await searchEngines.search("alexa firestick");
    output.outputData(getProduct);
})();

Result template

// Each price engine provides the follwoing results:

interface ISearchResult {
    engine: string;
    link: string;
    name: string;
    rating: number;
    price: number;
    thumbnail: string;
}

Contributions

Software contributions are welcome. If you are not a dev, testing and reproting bugs can also be very helpful!

Questions?

Please open an issue if you have questions, wish to request a feature, etc.

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.