/extractMonth.js (530f6b3bddfca745b628f7a4a226796d17a18605) (2009 bytes) (mode 100644) (type blob)
/*
This file is part of datajams-evictions.
datajams-evictions is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
datajams-evictions is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with datajams-evictions. If not, see <https://www.gnu.org/licenses/>.
Copyright 2020 Luigi Bai
*/
const Court = require("./lib/Court.class");
const sqDAO = require("./lib/sqlDAO");
const moment = require("dayjs");
if (process.argv.length < 4) throw "Must pass in YYYY and MM.";
let year = process.argv[2];
let month = process.argv[3];
let sDate = moment(year+"-"+month+"-01", "YYYY-MM-DD");
if (! sDate.isValid()) throw "Invalid month requested.";
let eDate = moment(sDate).add(1, "month").subtract(1, "day");
let opts = require("./creds")["SQLITE3"];
opts.connectCallback = sqDB => {
let exPromises = [];
for (var pct of [1, 2, 3, 4, 5, 6, 7, 8]){
for (var plc of [1, 2]) {
let court = new Court({
precinct: pct,
place: plc
});
for (var et of [Court.EXTRACT_FILED, Court.EXTRACT_DISPOSED]) {
let exOpts = {
database: sqDB,
startDate: sDate.format("MM/DD/YYYY"),
endDate: eDate.format("MM/DD/YYYY"),
extractType: et
};
exPromises.push(
court.getExtract(exOpts)
.then(vals => {
console.log(exOpts);
vals.forEach(val => {
console.log("Case", val, "stored");
});
})
.catch(err => {
console.error("ERROR", err);
})
);
}
}
}
Promise.all(exPromises)
.finally(() => {
sqDAO.disconnect(sqDB);
})
;
};
sqDAO.connect(opts);
Mode |
Type |
Size |
Ref |
File |
100644 |
blob |
31 |
ce60eb947708d4530bee8739c111f9c0ab750eaa |
.gitignore |
100644 |
blob |
33877 |
e37e32e4e836c2394b62c0a848c2094f687eb530 |
LICENSE |
100644 |
blob |
1171 |
354a297411cdddbe0355507766510a182aba0874 |
Promise.shim.js |
100644 |
blob |
1710 |
7dcf242a339081ab4c71cde50af7195a3eb26843 |
README.md |
100644 |
blob |
364 |
c97984072c2cd4c8daa74c3e6ff6eb0434dc5d72 |
creds.example.js |
100644 |
blob |
1410 |
bc1777db47110f7e7bfdfee7895204fbfa0f68ba |
extractFile.js |
100644 |
blob |
2009 |
530f6b3bddfca745b628f7a4a226796d17a18605 |
extractMonth.js |
040000 |
tree |
- |
3f64deda762120081ceadfb2c6f71ae44af03b95 |
lib |
100644 |
blob |
3387 |
d9081a5bae4b71e3a4f932769caef902f079fa20 |
loadDockets.js |
100644 |
blob |
49735 |
4e6be3f3100b172d1571d6ddf21eeabe70876b5c |
package-lock.json |
100644 |
blob |
626 |
129b1f2d2524cefe2b3ab9aa4eacae3ad9748089 |
package.json |
100644 |
blob |
4159 |
888ba8ce11fdf4d3e1d197ef755e74ee1e7af1d9 |
schema.mssql.sql |
100644 |
blob |
3367 |
a05db9482fe6f9fc3c2f275d697543332b3d4a0d |
schema.sqlite3.sql |
100644 |
blob |
2349 |
334eca19c709741ee6a386fe4c9527c3ac1b0b4d |
searchNames.js |
100755 |
blob |
162 |
7c25a482064c9580388f09c4d91683f3858ff7ca |
sqdump |
100644 |
blob |
3348 |
0beff714ed634a1763dbf0f2b3b1a3a049b4c258 |
updateAddress.js |
100644 |
blob |
3915 |
77c7694889dcc3c422bff5c1ebc15ccd0c366e4c |
updateDates.ms.sql |
100644 |
blob |
3663 |
af9d94ba2bf7fbaf736c02e433b89248f3fbad13 |
updateDates.sqlite.sql |
100644 |
blob |
2416 |
99b21aa86e56024cc770a95a8a1128aecd515422 |
updateStatus.js |
100644 |
blob |
6799 |
dba4385e740197b0fe1e19c89a39052ab799bdb0 |
xferData.js |
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"
Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/datajams-lbai/datajams-evictions
Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/datajams-lbai/datajams-evictions
Clone this repository using git:
git clone git://git.rocketgit.com/user/datajams-lbai/datajams-evictions
You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a
merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main