Class InnsamlingskontrollenClient

java.lang.Object
integration.InnsamlingskontrollenClient

public class InnsamlingskontrollenClient extends Object
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 Details

    • InnsamlingskontrollenClient

      public InnsamlingskontrollenClient()
  • Method Details

    • fetchOrganizations

      public static Organization[] fetchOrganizations() throws Exception
      Fetches all organizations from the Innsamlingskontrollen API.
      Returns:
      an array of Organization objects
      Throws:
      Exception - if the request fails
    • fetchDetails

      public static OrganizationDetails fetchDetails(String url)
      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