2012-08-18 04:57:49 -04:00
|
|
|
package com.blogspot.applications4android.comicreader.comics;
|
|
|
|
|
|
|
|
import java.io.BufferedReader;
|
|
|
|
import java.io.IOException;
|
2012-12-16 09:53:48 -05:00
|
|
|
|
2012-08-18 04:57:49 -04:00
|
|
|
import com.blogspot.applications4android.comicreader.comictypes.IndexedComic;
|
|
|
|
import com.blogspot.applications4android.comicreader.core.Strip;
|
|
|
|
import com.blogspot.applications4android.comicreader.exceptions.ComicLatestException;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public class SomethingofthatIlk extends IndexedComic {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected String getFrontPageUrl() {
|
|
|
|
return "http://somethingofthatilk.com/";
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public String getComicWebPageUrl() {
|
|
|
|
return "http://somethingofthatilk.com/";
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected int parseForLatestId(BufferedReader reader) throws IOException, ComicLatestException {
|
|
|
|
String str;
|
|
|
|
String final_str = null;
|
|
|
|
while((str = reader.readLine()) != null) {
|
2012-12-16 09:53:48 -05:00
|
|
|
int index1 = str.indexOf("src=\"/comics");
|
2012-08-18 04:57:49 -04:00
|
|
|
if (index1 != -1) {
|
|
|
|
final_str = str;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(final_str == null) {
|
|
|
|
String msg = "Failed to get the latest id for "+this.getClass().getSimpleName();
|
|
|
|
ComicLatestException e = new ComicLatestException(msg);
|
|
|
|
throw e;
|
|
|
|
}
|
|
|
|
final_str = final_str.replaceAll(".*comics/","");
|
|
|
|
final_str = final_str.replaceAll(".jpg.*","");
|
2012-12-16 09:53:48 -05:00
|
|
|
final_str = final_str.replaceAll(".png.*","");
|
2012-08-18 04:57:49 -04:00
|
|
|
return Integer.parseInt(final_str);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public String getStripUrlFromId(int num) {
|
|
|
|
return "http://somethingofthatilk.com/index.php?id=" + num;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected int getIdFromStripUrl(String url) {
|
2012-12-16 09:53:48 -05:00
|
|
|
return Integer.parseInt(url.replaceAll(".*id=", ""));
|
2012-08-18 04:57:49 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected boolean htmlNeeded() {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected String parse(String url, BufferedReader reader, Strip strip)
|
|
|
|
throws IOException {
|
|
|
|
String str;
|
|
|
|
String final_str = null;
|
|
|
|
String final_title = null;
|
|
|
|
while ((str = reader.readLine()) != null) {
|
2012-12-16 09:53:48 -05:00
|
|
|
int index1 = str.indexOf("src=\"/comics");
|
2012-08-18 04:57:49 -04:00
|
|
|
if (index1 != -1) {
|
|
|
|
final_str = str;
|
|
|
|
final_title = str;
|
|
|
|
}
|
|
|
|
}
|
2012-12-16 09:53:48 -05:00
|
|
|
final_str = "http://somethingofthatilk.com/"+final_str.replaceAll(".*src=\"/","");
|
|
|
|
final_str = final_str.replaceAll("\".*","");
|
|
|
|
final_title = final_title.replaceAll(".*alt=\"","");
|
|
|
|
final_title = final_title.replaceAll("\".*","");
|
2012-08-18 04:57:49 -04:00
|
|
|
strip.setTitle("Something of that Ilk: "+final_title);
|
|
|
|
strip.setText("-NA-");
|
|
|
|
return final_str;
|
|
|
|
}
|
|
|
|
}
|