Menu

How To

Ortega

:::java

//Contructor
ShoutCastAPI sc = new ShoutCastAPI("YOU-API-KEY");
//Get station by genre
StationlistTypeByGenre stations = sc.getStationByGenre("Blues", null, null, "audio/mpeg");
List<StationTypeByGenre> stationLists = stations.getStation();
for (StationTypeByGenre stationList : stationLists) {
      System.out.println(stationList.getName());
}

//Get primary genres
List<GenreTypePrimary> genres = sc.getPrimaryGenres();
for (GenreTypePrimary genre : genres) {
     System.out.println("PG: " + genre.getName() + "(" + genre.getCount() + ")");
}

//Get secondary genres
List<GenreTypeSecondary> genres = sc.getSecondaryGenres(false);
System.out.println(genres.size());
for (GenreTypeSecondary genre : genres) {
     System.out.println("PG: " + genre.getName() + "(" + genre.getCount() + ")");
}

//Get top 500
List<StationType> sType = sc.getTop500Stations(5, null, "audio/mpeg");
for (StationType station : sType) {
      System.out.println("STATION: " + station.getCt() + ", " + station.getGenre() + ", " + station.getMt() + ", " + station.getName() + ", " + station.getBr() + ", " + station.getId() + ", " + station.getLc());
}

//List all genres
List<GenreType> gType = sc.getAllGenres();
for (GenreType genre : gType) {
      System.out.println("GENRE: " + genre.getName());
}

Auth0 Logo