diff options
| author | SammysHP <sven@sammyshp.de> | 2011-08-26 15:08:38 +0200 |
|---|---|---|
| committer | SammysHP <sven@sammyshp.de> | 2011-08-26 15:08:38 +0200 |
| commit | 733f9c8c16240e3d49c23bd486f66784384c00ec (patch) | |
| tree | e8889bec9ac2ad86111878bbd0f91cb60d11b425 /src/cgeo/geocaching/cgBase.java | |
| parent | 1c93d30a4df918837f81360d43d145dd255dd63f (diff) | |
| download | cgeo-733f9c8c16240e3d49c23bd486f66784384c00ec.zip cgeo-733f9c8c16240e3d49c23bd486f66784384c00ec.tar.gz cgeo-733f9c8c16240e3d49c23bd486f66784384c00ec.tar.bz2 | |
Temporary fix for #296 (only premium-members)
Diffstat (limited to 'src/cgeo/geocaching/cgBase.java')
| -rw-r--r-- | src/cgeo/geocaching/cgBase.java | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/cgeo/geocaching/cgBase.java b/src/cgeo/geocaching/cgBase.java index 92082a3..7f18024 100644 --- a/src/cgeo/geocaching/cgBase.java +++ b/src/cgeo/geocaching/cgBase.java @@ -86,6 +86,7 @@ public class cgBase { private final static Pattern patternFavourite = Pattern.compile("<a id=\"uxFavContainerLink\"[^>]*>[^<]*<div[^<]*<span class=\"favorite-value\">[^\\d]*([0-9]+)[^\\d^<]*</span>", Pattern.CASE_INSENSITIVE | Pattern.MULTILINE); private final static Pattern patternFound = Pattern.compile("<p>[^<]*<a id=\"ctl00_ContentBody_hlFoundItLog\"[^<]*<img src=\".*/images/stockholm/16x16/check\\.gif\"[^>]*>[^<]*</a>[^<]*</p>", Pattern.CASE_INSENSITIVE); + private final static Pattern patternFoundAlternative = Pattern.compile("<div class=\"StatusInformationWidget FavoriteWidget\"", Pattern.CASE_INSENSITIVE); private final static Pattern patternLatLon = Pattern.compile("<span id=\"ctl00_ContentBody_LatLon\"[^>]*>(<b>)?([^<]*)(<\\/b>)?<\\/span>", Pattern.CASE_INSENSITIVE); private final static Pattern patternLocation = Pattern.compile("<span id=\"ctl00_ContentBody_Location\"[^>]*>In ([^<]*)", Pattern.CASE_INSENSITIVE); private final static Pattern patternHint = Pattern.compile("<p>([^<]*<strong>)?\\W*Additional Hints([^<]*<\\/strong>)?[^\\(]*\\(<a[^>]+>Encrypt</a>\\)[^<]*<\\/p>[^<]*<div id=\"div_hint\"[^>]*>(.*)</div>[^<]*<div id=[\\'|\"]dk[\\'|\"]", Pattern.CASE_INSENSITIVE); @@ -1313,14 +1314,17 @@ public class cgBase { } // cache found - try { - final Matcher matcherFound = patternFound.matcher(page); - if (matcherFound.find()) { - if (matcherFound.group() != null && matcherFound.group().length() > 0) { - cache.found = true; - } + try + { + final Matcher matcherFound = patternFound.matcher(page); + final Matcher matcherFoundAlternative = patternFoundAlternative.matcher(page); + + if (matcherFound.find() || matcherFoundAlternative.find()) { + cache.found = true; } - } catch (Exception e) { + } + catch (Exception e) + { // failed to parse found Log.w(cgSettings.tag, "cgeoBase.parseCache: Failed to parse found"); } |
