-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME
95 lines (80 loc) · 4.01 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# What is this?
This is an npm module where it scrapes popular credit card webpages and try my best to neatly put the useful information into a clean data structure for people to use in their projects. Hopefully, it'll be useful to build out fin-tech applications 🙏
The vision is to build this out in multiple languages (next is Python, thirdly will be Rust).
But, after I am done with this javascript package, I will try to migrate this over to an actual live, hosted API.
Please look through the issues and projects tabs for the future plans of `cc-scraper`.
# cc-scraper
The [cc-scraper](https://github.com/JinwookKim/cc-scraper) library is used as an npm module or [Node.js](https://nodejs.org/en/) module.
## installation
Using npm:
```javascript
npm i -s cc-scraper
```
In Node.js:
```javascript
// Load the cc-scraper library
const cards = require('cc-scraper');
// Get Chase's 5% Cash Back Calendar information
cards.getChaseCashBackCal((error, result) => {
console.log('chase result = ', result);
});
// Get Discover's 5% Cash Back Calendar information
cards.getDiscoverCashBackCal((error, result) => {
console.log('discover result = ', result);
});
```
Output (something similar to):
```javascript
chase_result = [ { quarterName: 'January - March',
quarter: 1,
categoryNames: [ 'gas stations', 'tolls', 'drugstores' ],
categories: [ [Object], [Object], [Object] ] },
{ quarterName: 'April - June',
quarter: 2,
categoryNames: [ 'grocery stores', 'home improvement stores' ],
categories: [ [Object], [Object] ] },
{ quarterName: 'July - September',
quarter: 3,
categoryNames: [ 'gas stations', 'select streaming services' ],
categories: [ [Object], [Object] ] },
{ quarterName: 'October - December',
quarter: 4,
categoryNames: [ 'department stores', 'paypal', 'chase pay' ],
categories: [ [Object], [Object], [Object] ] } ]
discover_result = [ { quarter: 4,
startDate: 'October 1, 2019',
endDate: 'December 31, 2019',
category: 'Amazon.com, Target and Walmart.com',
terms:
'[terms and services in html]' },
{ quarter: 1,
startDate: 'January 1, 2020',
endDate: 'March 31, 2020',
category: 'Grocery Stores, Walgreens and CVS',
terms:
'[terms and services in html]' },
{ quarter: 2,
startDate: 'April 1, 2020',
endDate: 'June 30, 2020',
category: 'Gas Stations, Uber, Lyft and Wholesale Clubs',
terms:
'[terms and services in html]' },
{ quarter: 3,
startDate: 'July 1, 2020',
endDate: 'September 30, 2020',
category: 'Restaurants and PayPal',
terms:
'[terms and services in html]' },
{ quarter: 4,
startDate: 'October 1, 2020',
endDate: 'December 31, 2020',
category: 'Amazon.com, Walmart.com and Target.com',
terms:
'[terms and services in html]' } ]
```
Quarter 1: January - March
Quarter 2: April - June
Quarter 3: July - September
Quarter 4: October - December
There will be occasions where some quarters are missing. For example, in the output above is missing `quarter 4`. That is because on their website calendar, they haven't finalized quarter 4 categories that will attribute to the 5% cash back (at the time of this writing). Therefore, my code will neglect that quarter.
See the [source code](https://github.com/JinwookKim/cc-scraper) for more details.