/[projects]/android/TrainInfoService/src/dk/thoerup/traininfoservice/banedk/DepartureFetcher.java
ViewVC logotype

Diff of /android/TrainInfoService/src/dk/thoerup/traininfoservice/banedk/DepartureFetcher.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 588 by torben, Mon Feb 8 19:12:15 2010 UTC revision 697 by torben, Mon May 3 07:42:02 2010 UTC
# Line 6  import java.util.List; Line 6  import java.util.List;
6  import java.util.Map;  import java.util.Map;
7  import java.util.logging.Logger;  import java.util.logging.Logger;
8    
9    import com.gargoylesoftware.htmlunit.BrowserVersion;
10  import com.gargoylesoftware.htmlunit.WebClient;  import com.gargoylesoftware.htmlunit.WebClient;
11  import com.gargoylesoftware.htmlunit.html.DomNodeList;  import com.gargoylesoftware.htmlunit.html.DomNodeList;
12  import com.gargoylesoftware.htmlunit.html.HtmlElement;  import com.gargoylesoftware.htmlunit.html.HtmlElement;
# Line 81  public class DepartureFetcher { Line 82  public class DepartureFetcher {
82                                    
83                  List<DepartureBean> departureList = new ArrayList<DepartureBean>();                  List<DepartureBean> departureList = new ArrayList<DepartureBean>();
84                                    
85              final WebClient webClient = new WebClient();              final WebClient webClient = new WebClient( BrowserVersion.FIREFOX_3 );
86              webClient.setTimeout(2500);              webClient.setTimeout(2500);
87              webClient.setJavaScriptEnabled(false);              webClient.setJavaScriptEnabled(false);
88                                                            
# Line 131  public class DepartureFetcher { Line 132  public class DepartureFetcher {
132                                  String note = extractNote( fields.get(7) );                                  String note = extractNote( fields.get(7) );
133                                  departure.setNote(note);                                  departure.setNote(note);
134                                                                    
135                                    departure.setType(type);
136                                    
137                                  departureList.add(departure);                                  departureList.add(departure);
138                          }                          }
139                      }                      }
140              } else {              } else {
141                  logger.warning("No departures found for station=" + stationcode + ", type=" + type);                  logger.warning("No departures found for station=" + stationcode + ", type=" + type);
142              }              }
143                webClient.closeAllWindows();
144                            
145              return departureList;              return departureList;
146          }          }
# Line 145  public class DepartureFetcher { Line 149  public class DepartureFetcher {
149                                    
150                  List<DepartureBean> departureList = new ArrayList<DepartureBean>();                  List<DepartureBean> departureList = new ArrayList<DepartureBean>();
151                                    
152              final WebClient webClient = new WebClient();              final WebClient webClient = new WebClient(BrowserVersion.FIREFOX_3);
153              webClient.setTimeout(2500);              webClient.setTimeout(2500);
154              webClient.setJavaScriptEnabled(false);              webClient.setJavaScriptEnabled(false);
155                            
# Line 201  public class DepartureFetcher { Line 205  public class DepartureFetcher {
205              } else {              } else {
206                  logger.warning("No departures found for station=" + stationcode + ", type=" + type);                  logger.warning("No departures found for station=" + stationcode + ", type=" + type);
207              }              }
208                webClient.closeAllWindows();
209                
210                            
211              return departureList;              return departureList;
212          }          }
# Line 249  public class DepartureFetcher { Line 255  public class DepartureFetcher {
255                  }                  }
256                                    
257                                    
                   
258                  return number;                  return number;
259          }          }
260                    

Legend:
Removed from v.588  
changed lines
  Added in v.697

  ViewVC Help
Powered by ViewVC 1.1.20