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.
To start app:
git clone https://github.com/MIKOLAJW197/armybazar--scraper-api.git
npm install
npm start
App will work on port 3000
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 )
/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."
}
]
/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"
}
}
Run Jasmine tests by:
npm test
- Express - The framework used
- Cheerio - Scraper
- Jasmine - Used to test
- Axios - Used to make requests
- Morgan - Used to simple LOG
- Mikolaj Wolicki - Initial work - MIKOLAJW197
- Add endpoint with filtering offers by location
- Add endpoint with filtering offers by key word