Class InnsamlingskontrollenClient
java.lang.Object
integration.InnsamlingskontrollenClient
The InnsamlingskontrollenClient class provides functionality to fetch a list
of organizations from the Innsamlingskontrollen API. The fetched data is
represented as an array of Organization objects.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic OrganizationDetailsfetchDetails(String url) Fetches additional details for an organization from its Innsamlingskontrollen page.static Organization[]Fetches all organizations from the Innsamlingskontrollen API.
-
Constructor Details
-
InnsamlingskontrollenClient
public InnsamlingskontrollenClient()
-
-
Method Details
-
fetchOrganizations
Fetches all organizations from the Innsamlingskontrollen API.- Returns:
- an array of Organization objects
- Throws:
Exception- if the request fails
-
fetchDetails
Fetches additional details for an organization from its Innsamlingskontrollen page. Scrapes the organization's description and logo URL using Jsoup. Returns empty strings if the details cannot be fetched.- Parameters:
url- the URL to the organization's page on Innsamlingskontrollen- Returns:
- an OrganizationDetails object containing description and logo URL
-