CAU Food Scraper(CAUFS)
A CAU restaurant menu scraper for Node.js
NOTE: You should follow the migration guide in favor of v2 release.
What's new in v2
- 🎯 Promise-based precise data scraping without any wasting of time
- 🚀 Boost up to 5x faster
- 🗑 Reduce dependencies which are totally unnecessary
Installation
npm install @payw/cau-food-scraper
# OR
yarn add @payw/cau-food-scraper
const foodScrape = require('@payw/cau-food-scraper').default
import foodScrape from '@payw/cau-food-scraper'
foodScrape({
id: 'portalId',
pw: 'portalPw',
days: 1
}).then(data => {
})
Migration from v1 to v2
You should import the library differently.
const foodScrape = require('@payw/cau-food-scraper').default
import foodScrape from '@payw/cau-food-scraper'
const { CAUFS } = require('@payw/cau-food-scraper')
import { CAUFS } from '@payw/cau-food-scraper'
Returning data type of Day
and its children types had been slightly changed. The package includes a type definition with more detailed information.
type Day = {
date: string
breakfast: Food[]
lunch: Food[]
supper: Food[]
}
type Day = {
date: string
timeGroup: {
breakfast: Restaurant[]
lunch: Restaurant[]
supper: Restaurant[]
}
}