Browse files

merging

  • Loading branch information...
2 parents 5260e01 + bfe9bd4 commit 1cb2c60143199827a03944cbab8d7a23182bdc89 @woxxy woxxy committed May 14, 2012
View
3 src/main/java/net/easymodo/asagi/Dumper.java
@@ -332,9 +332,6 @@ public void run() {
// Comment too long. Click here to view the full text.
// This means we have to refresh the full thread
if(newPost.isOmitted()) mustRefresh = true;
-
- // We have to refresh to get the image filename, sadly
- if(newPost.getMediaOrig() != null) mustRefresh = true;
}
// Update the time we last hit this thread
View
9 src/main/java/net/easymodo/asagi/Yotsuba.java
@@ -31,6 +31,7 @@
private static final Pattern commentPattern;
private static final Pattern stickyPattern;
private static final Pattern omittedPattern;
+ private static final Pattern oldCapPattern;
private static final Pattern omPostsPattern;
private static final Pattern omImagesPattern;
@@ -65,6 +66,7 @@
String commentPatString = "<blockquote \\s class=\"postMessage\" [^>]*>(.*?)</blockquote>";
String stickyPatString = "<img [^>]* \\s* alt=\"Sticky\" \\s* title=\"Sticky\" \\s */>";
String omittedPatString = "<span \\s class=\"abbr\">Comment \\s too \\s long";
+ String oldCapPatString = "<span \\s class=\"commentpostername\"><span [^>]*>\\#\\# \\s (.)[^<]*</span></span>";
String omPostsPatString = "<span \\s class=\"info\">\\s*<strong>([0-9]*) \\s posts \\s omitted";
String omImagesPatString = "<em>\\(([0-9]*) \\s have \\s images\\)</em>";
@@ -75,6 +77,8 @@
commentPattern = Pattern.compile(commentPatString, Pattern.COMMENTS | Pattern.DOTALL);
stickyPattern = Pattern.compile(stickyPatString, Pattern.COMMENTS | Pattern.DOTALL);
omittedPattern = Pattern.compile(omittedPatString, Pattern.COMMENTS | Pattern.DOTALL);
+ oldCapPattern = Pattern.compile(oldCapPatString, Pattern.COMMENTS | Pattern.DOTALL);
+
omPostsPattern = Pattern.compile(omPostsPatString, Pattern.COMMENTS | Pattern.DOTALL);
omImagesPattern = Pattern.compile(omImagesPatString, Pattern.COMMENTS | Pattern.DOTALL);
@@ -332,6 +336,11 @@ public Post parsePost(String text, int threadNum) throws ContentParseException {
((mat.group(5) != null) ? new String(mat.group(5)) : null) :
new String(mat.group(4));
//String uid = mat.group(6);
+
+ mat = oldCapPattern.matcher(text);
+ if(mat.find()) {
+ capcode = (mat.group(1) != null) ? new String(mat.group(1)) : null;
+ }
mat = datePattern.matcher(text);
if(!mat.find()) {
View
2 src/main/resources/net/easymodo/asagi/defs/Yotsuba/post_parse_1.regex
@@ -1,7 +1,7 @@
(?:<a \s href="mailto:([^"]*)" \s class="useremail">)? \s*
<span \s class="name">(?:<span [^>]*)?([^<]*)(?:</span>)?</span> \s*
(?:<span \s class="postertrip">(?:<span [^>]*)?([^<]*)(?:</span>)?</span>)? \s*
-(?:<strong \s class="capcode" [^"]*>\#\# \s (.)[^<]*</strong>)? \s*
+(?:<strong \s class="capcode [^"]*">\#\# \s (.)[^<]*</strong>)? \s*
(?:</a>)? \s*
(?:<span \s class="posteruid">\(ID: \s (?: <span [^>]*>(.)[^)]*
| ([^)]*))\)</span>)?

0 comments on commit 1cb2c60

Please sign in to comment.