/*
- * Copyright (c) 2017-2019. Developed by Hedgecode.
+ * Copyright (c) 2017-2020. Developed by Hedgecode.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
private static final String TWITTER_URL = "https://twitter.com/";
private static final String TWITTER_HASHTAG = "hashtag/";
+ private static final String WORLDSNOOKER_URL = "http://livescores.worldsnookerdata.com/";
+ private static final String WORLDSNOOKER_EVENT_MATCHES = "Matches/Index/";
+ private static final String WORLDSNOOKER_MATCH_RESULT = "Matches/Result/";
+
public static List<SnookerURL> parseUrls(Map<String, String> htmlStrings) throws APIException {
List<SnookerURL> result = new ArrayList<>();
htmlStrings.forEach( (name, htmlString) -> {
: null;
}
+ public static String worldSnookerEventUrl(int wsEventId) {
+ return wsEventId > 0
+ ? String.format("%s%s%d", WORLDSNOOKER_URL, WORLDSNOOKER_EVENT_MATCHES, wsEventId)
+ : null;
+ }
+
+ public static String worldSnookerMatchUrl(int wsEventId, int wsMatchId) {
+ return wsEventId > 0 && wsMatchId > 0
+ ? String.format("%s%s%d/%d", WORLDSNOOKER_URL, WORLDSNOOKER_MATCH_RESULT, wsEventId, wsMatchId)
+ : null;
+ }
+
}