-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: Renamed Main method and added a simple test to getting API info…
…rmation
- Loading branch information
AdrianBalunan
committed
Mar 11, 2026
1 parent
2a37af8
commit 743573a
Showing
2 changed files
with
33 additions
and
7 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/HmHApplication.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| package ntnu.sytemutvikling.team6; | ||
|
|
||
| import ntnu.sytemutvikling.team6.models.Charity; | ||
| import ntnu.sytemutvikling.team6.models.CharityRegistry; | ||
| import ntnu.sytemutvikling.team6.scraper.APICharityScraper; | ||
|
|
||
| import java.io.IOException; | ||
| import java.net.URISyntaxException; | ||
| import java.net.http.HttpClient; | ||
|
|
||
| public class HmHApplication { | ||
| public static void main(String[] args) { | ||
| init(); | ||
| System.out.println("Hello world!"); | ||
|
|
||
| } | ||
| public static void init(){ | ||
| try { | ||
| HttpClient https = HttpClient.newHttpClient(); | ||
| APICharityScraper scraper = new APICharityScraper(https); | ||
|
|
||
| if (scraper.checkConnection()){ | ||
| CharityRegistry charityRegistry = scraper.parseJSON(scraper.getJSONData()); | ||
| for (Charity charity : charityRegistry.getAllCharities()){ | ||
| System.out.println(charity.toString()); | ||
| } | ||
| } | ||
| } catch (Exception e){ | ||
| e.printStackTrace(); | ||
| } | ||
|
|
||
| } | ||
| } |
7 changes: 0 additions & 7 deletions
7
helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/Main.java
This file was deleted.
Oops, something went wrong.