← back to Cypress Awards
backend/src/scraper/insert_cases.js
96 lines
// Insert cy pres legal cases into database
const { query } = require('../models/database');
const cases = [
{
case_name: "Hawes v. Macy's Inc.",
case_number: '1:17-CV-754',
court: 'U.S. District Court, Southern District of Ohio',
filed_date: '2023-12-20',
judge: 'Honorable Susan J. Dlott',
cy_pres_amount: 'Undistributed residuals from $10.5M settlement',
recipients: JSON.stringify(['Public Interest Research Group (PIRG) - Rejected']),
is_class_action: true,
case_summary: "Consumer class action alleging Macy's overstated thread count in bed sheets. Court rejected proposed cy pres settlement because PIRG had no history of work addressing false advertising in textiles and was not sufficiently related to the injury alleged in the lawsuit.",
docket_url: null,
opinion_url: 'https://www.insideclassactions.com/2024/01/04/federal-court-rejects-class-action-settlement-over-cy-pres-provision/'
},
{
case_name: 'Hyland v. Navient Corporation',
case_number: '1:18-cv-09031',
court: 'U.S. Court of Appeals, Second Circuit',
filed_date: '2022-09-07',
judge: null,
cy_pres_amount: '$2,250,000',
recipients: JSON.stringify(['Nonprofit organization providing student loan borrower counseling (to be established)']),
is_class_action: true,
case_summary: 'Class action by student loan borrowers alleging they received inaccurate information about their loans. Second Circuit approved a cy pres-only settlement with no distribution to class members, with $2.25M to establish a nonprofit organization providing counseling to borrowers. Supreme Court denied certiorari in April 2023.',
docket_url: 'https://www.courtlistener.com/docket/7974080/hyland-v-navient-corporation/',
opinion_url: 'https://law.justia.com/cases/federal/appellate-courts/ca2/20-3765/20-3765-2022-09-07.html'
},
{
case_name: 'Washington v. ESA Management, LLC',
case_number: 'RG18898624',
court: 'Superior Court of California, Alameda County',
filed_date: '2021-12-14',
judge: 'Honorable Brad Seligman',
cy_pres_amount: '$737,478.68',
recipients: JSON.stringify(['National Center for Youth Law']),
is_class_action: true,
case_summary: 'Employment-related class action settlement. Cy pres award of $737,478.68 distributed to National Center for Youth Law, selected by Littler Mendelson and Setareh Law Group.',
docket_url: null,
opinion_url: 'https://www.phoenixclassaction.com/washington-esa/'
},
{
case_name: 'Butler v. Apple Inc.',
case_number: '2014-1-CV-262989',
court: 'California Superior Court',
filed_date: '2020-06-01',
judge: null,
cy_pres_amount: '$1,759,900',
recipients: JSON.stringify(['National Center for Youth Law', 'Public Counsel']),
is_class_action: true,
case_summary: 'Consumer class action arising from alleged failure of Wi-Fi and Bluetooth functions on the iPhone 4S. Cy pres award of $1,759,900 distributed equally between National Center for Youth Law (child advocacy program) and Public Counsel (nonprofit legal services for the indigent).',
docket_url: 'http://wifibluetoothgrayoutsettlement.com/',
opinion_url: null
}
];
async function insertCases() {
console.log('Inserting cy pres legal cases...');
for (const c of cases) {
try {
const result = await query(`
INSERT INTO legal_cases (
case_name, case_number, court, filed_date, judge, cy_pres_amount,
recipients, is_class_action, case_summary, docket_url, opinion_url
) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11)
RETURNING id, case_name, filed_date
`, [
c.case_name, c.case_number, c.court, c.filed_date, c.judge,
c.cy_pres_amount, c.recipients, c.is_class_action, c.case_summary,
c.docket_url, c.opinion_url
]);
console.log(`✓ Inserted: ${result.rows[0].case_name} (${result.rows[0].filed_date})`);
} catch (error) {
console.error(`✗ Error inserting ${c.case_name}:`, error.message);
}
}
// Display all cases
const allCases = await query('SELECT case_name, filed_date, court, cy_pres_amount FROM legal_cases ORDER BY filed_date DESC');
console.log('\n=== All Cases in Database ===');
allCases.rows.forEach(row => {
console.log(`${row.filed_date.toISOString().split('T')[0]} - ${row.case_name} (${row.cy_pres_amount})`);
});
process.exit(0);
}
insertCases().catch(error => {
console.error('Fatal error:', error);
process.exit(1);
});