File tree Expand file tree Collapse file tree 2 files changed +7
-8
lines changed
src/main/java/cz/zcu/fav/kiv/eitm/menubot Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ public class QueryHandler {
2525
2626 public QueryHandler () throws IOException {
2727 this .restaurantMap = new HashMap <>();
28- org .jsoup .nodes .Document doc = Jsoup .connect ("https://www.menicka.cz/plzen.html?datum=2021-04-06 " ).get ();
28+ org .jsoup .nodes .Document doc = Jsoup .connect ("https://www.menicka.cz/plzen.html" ).get ();
2929 Elements restaurants = doc .select ("div.menicka_detail" );
3030 Elements names = restaurants .select ("div.nazev" );
3131 StringBuilder sb = new StringBuilder ();
@@ -39,7 +39,7 @@ public QueryHandler() throws IOException {
3939 Elements prices = restaurant .select ("div.cena" );
4040
4141 int menuSize = meals .size ();
42- var r = new Restaurant (name , "" , menuSize );
42+ var r = new Restaurant (name , menuSize );
4343
4444 for (int j = 0 ; j < meals .size (); j ++) {
4545 if (j >= prices .size ())
Original file line number Diff line number Diff line change 66public class Restaurant {
77
88 String name ;
9- String gsm ;
109 List <String > menu ;
1110 String menuString ;
1211
13- public Restaurant (String name , String gsm , int menuSize ) {
12+ public Restaurant (String name , int menuSize ) {
1413 this .name = name ;
15- this .gsm = gsm ;
1614 this .menu = new ArrayList <>(menuSize );
1715 this .menuString = null ;
1816 }
1917
2018 public void createMenuString (StringBuilder sb ) {
21- for (String menu : this .menu ) {
22- sb .append (menu );
23- sb .append ("# " );
19+ for (int i = 0 ; i < this .menu .size (); i ++) {
20+ sb .append (this .menu .get (i ));
21+ if (i != this .menu .size () -1 )
22+ sb .append (" ••• " );
2423 }
2524
2625 this .menuString = sb .toString ();
You can’t perform that action at this time.
0 commit comments