Skip to content

Commit 78d03a9

Browse files
committed
Added comment annotations
1 parent c7cc879 commit 78d03a9

4 files changed

Lines changed: 13 additions & 0 deletions

File tree

‎stubbornjava-webapp/src/main/java/com/stubbornjava/webapp/themes/HtmlCssTheme.java‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.stubbornjava.webapp.themes;
22

3+
// {{start:model}}
34
public class HtmlCssTheme {
45
private final String title;
56
private final String url;
@@ -25,3 +26,5 @@ public int getDownloads() {
2526
return downloads;
2627
}
2728
}
29+
//{{end:model}}
30+

‎stubbornjava-webapp/src/main/java/com/stubbornjava/webapp/themes/TemplateMonsterScraper.java‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@ private static HtmlCssTheme themeFromElement(Element element) {
4545
.addQueryParameter("aff", affilaiteCode)
4646
.build().toString();
4747
String imageUrl = element.select(".thumbnail-preview link").attr("href");
48+
49+
/*
50+
* Downloads aren't available on this page and we
51+
* currently don't want to scrape all the detail pages
52+
* just to get download counts.
53+
*/
4854
int downloads = 0;
4955
return new HtmlCssTheme(title, url, imageUrl, downloads);
5056
}

‎stubbornjava-webapp/src/main/java/com/stubbornjava/webapp/themes/ThemeRoutes.java‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
import io.undertow.server.HttpServerExchange;
1010

11+
// {{start:routes}}
1112
public class ThemeRoutes {
1213

1314
public static void popularThemes(HttpServerExchange exchange) {
@@ -21,3 +22,4 @@ public static void popularThemes(HttpServerExchange exchange) {
2122
Exchange.body().sendHtmlTemplate(exchange, "templates/src/pages/popular-themes", response);
2223
}
2324
}
25+
// {{end:routes}}

‎stubbornjava-webapp/src/main/java/com/stubbornjava/webapp/themes/WrapBootstrapScraper.java‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import okhttp3.OkHttpClient;
2020
import okhttp3.Request;
2121

22+
// {{start:scraper}}
2223
public class WrapBootstrapScraper {
2324
private static final Logger log = LoggerFactory.getLogger(WrapBootstrapScraper.class);
2425
private static final String affilaiteCode = "stubbornjava";
@@ -60,3 +61,4 @@ public static void main(String[] args) {
6061
log.debug(Json.serializer().toPrettyString(themes));
6162
}
6263
}
64+
// {{end:scraper}}

0 commit comments

Comments
 (0)