Skip to content

MIKOLAJW197/armybazar--scraper-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

armybazar--scraper-api

Simple node.js app based on Express and Cheerio, created to scrape for some data on ArmyBazar.eu

I want to use this app as a backend in the future. I am planning to make new site or mobile app.

Getting Started

To start app:

git clone https://github.com/MIKOLAJW197/armybazar--scraper-api.git
npm install
npm start

App will work on port 3000

How it work

For now there are 4 defined endpoints

/getShortOffers/:pageNumber --> Return array of 20 pistols offers
/getLongOffers/:pageNumber --> Return array of 20 long rifles offers
/getAmmunitionOffers/:pageNumber --> Return array of 20 ammunition offers
/getAccesoriesOffers/:pageNumber --> Return array of 20 accessories offers
/getOfferDetails --> Method: POST. Return offer details. (Url to offer passed as JSON in 'offerUrl' field )

Examples

GET reguest for offers list:
/getShortOffers/1

Will return:

[
  {
    "title": "Lorem ipsum dolor sit amet. ",
    "shortDescription": "Nam vitae lobortis elit. Sed id suscipit risus. Maecenas auctor urna leo. ",
    "img": "IMG_URL",
    "detailsLink": "URL_FOR_DETAILS",
    "localization": "Lorem",
    "date": "18.08.201920:08",
    "price": "1234 zł"
  },
  {
    "_comment" : "second offer etc."
  }
]
POST reguest for offer details:
/getOfferDetails

Will return:

{
    "id": "115457",
    "title": "Lorem ipsum dolor sit amet. ",
    "date": "19.03.2019, 20:08",
    "description": "Opis: Nam vitae lobortis elit. Sed id suscipit risus. Maecenas auctor urna leo. ",
    "price": "1234 zł",
    "offerImgUrls": [
        "IMG_URL"
    ],
    "contact": {
        "user": "ipsum",
        "phone": "+48 999123999",
        "email": "ipsum@ipsum.com",
        "localization": "Lorem"
    }
}

Running the tests

Run Jasmine tests by:

npm test

Built With

Authors

TODO

  • Add endpoint with filtering offers by location
  • Add endpoint with filtering offers by key word

About

Simple node.js app based on Express and Cheerio, created to scrape for some data on ArmyBazar.eu

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors