Skip to content

Commit

Permalink
Updated DatabaseManager
Browse files Browse the repository at this point in the history
Adds the scraped parameters directly to the charity object.
  • Loading branch information
roaraf committed Apr 8, 2026
1 parent 5638e8f commit 40dec77
Showing 1 changed file with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,18 +153,23 @@ INSERT INTO Charities (UUID_charities, org_number, charity_name, charity_link, p
ps.setString(1, charity.getUUID().toString());
}
// Scrapes description, logo, categories, and key values from IK
URLCharityScraper urlScraper = new URLCharityScraper(charity.getURL());
URLCharityScraper urlScraper = new URLCharityScraper(charity.getURL());
urlScraper.scrapeCharityPage();

charity.setDescription(urlScraper.getDescription());
charity.setCategory(urlScraper.getCategories());
charity.setLogoURL(urlScraper.getLogoURL());
charity.setKeyValues(urlScraper.getKeyValues());

ps.setString(2, charity.getOrg_number().replaceAll("\\s", ""));
ps.setString(3, charity.getName());
ps.setString(4, charity.getURL());
ps.setBoolean(5, charity.getPreApproved()); // Description is the link
ps.setBoolean(5, charity.getPreApproved());
ps.setString(6, charity.getStatus());
ps.setString(7, urlScraper.getDescription());
ps.setString(8, urlScraper.getLogoURL());
ps.setString(9, urlScraper.getCategories());
ps.setString(10, urlScraper.getKeyValues());
ps.setString(7, charity.getDescription());
ps.setString(8, charity.getLogoURL());
ps.setString(9, charity.getCategory());
ps.setString(10, charity.getKeyValues());

ps.addBatch();
}
Expand Down

0 comments on commit 40dec77

Please sign in to comment.