From 9ce79d215ec761e4720f763838ebab37ee014c13 Mon Sep 17 00:00:00 2001 From: Tejaswi Date: Sat, 19 Jan 2013 17:02:03 +0530 Subject: [PATCH] Added DMFA comic --- ComicReader/assets/classes.json | 4 + .../comicreader/comics/DMFA.java | 97 +++++++++++++++++++ .../comicreader/comics/ElGoonishShive.java | 4 - .../comics/GeneralProtectionFault.java | 1 - 4 files changed, 101 insertions(+), 5 deletions(-) create mode 100755 ComicReader/src/com/blogspot/applications4android/comicreader/comics/DMFA.java diff --git a/ComicReader/assets/classes.json b/ComicReader/assets/classes.json index 8df24cc..8869ef7 100755 --- a/ComicReader/assets/classes.json +++ b/ComicReader/assets/classes.json @@ -49,6 +49,7 @@ {"class":"Sheldon", "name":"Sheldon", "pref":"sheldonPref"}, {"class":"Sinfest", "name":"Sinfest", "pref":"sinfestPref"}, {"class":"SluggyFreelance", "name":"Sluggy Freelance", "pref":"sluggyfreelancePref", "new":"1"}, + {"class":"DMFA", "name":"DMFA", "pref":"dmfaPref", "new":"1"}, {"class":"SomethingofthatIlk", "name":"Something Of That Ilk", "pref":"somethingofthatilkPref"}, @@ -78,6 +79,8 @@ {"class":"IrregularWebComic", "name":"Irregular Web Comic", "pref":"irregularWebComicPref"}, {"class":"PbfComics", "name":"PBF Comics", "pref":"pbfComicsPref"}, {"class":"AgentXComics", "name":"Agent X Comics", "pref":"agentXComicsPref"}, + + {"class":"DailyKingFeatures.Zits", "name":"Zits", "pref":"zitsComicsPref"}, {"class":"DailyKingFeatures.BeetleBailey", "name":"Beetle Bailey", "pref":"beetleBaileyComicsPref"}, {"class":"DailyKingFeatures.BrilliantMindOfEdisonLee", "name":"Brilliant Mind Of Edison Lee", "pref":"edisonLeeComicsPref"}, @@ -90,6 +93,7 @@ {"class":"DailyKingFeatures.ArcticCircle", "name":"Arctic Circle", "pref":"arcticCircleComicsPref"}, {"class":"DailyKingFeatures.PajamaDiaries", "name":"Pajama Diaries", "pref":"pajamaDiariesComicsPref"}, + {"class":"GoComics.TwoCowsandaChicken", "name":"2 Cows and a Chicken", "pref":"2cowsandachickenPref"}, {"class":"GoComics.NineChickweedLane", "name":"9 Chickweed Lane", "pref":"9chickweedlanePref"}, {"class":"GoComics.NinetoFive", "name":"9 to 5", "pref":"9to5Pref"}, diff --git a/ComicReader/src/com/blogspot/applications4android/comicreader/comics/DMFA.java b/ComicReader/src/com/blogspot/applications4android/comicreader/comics/DMFA.java new file mode 100755 index 0000000..8e3a317 --- /dev/null +++ b/ComicReader/src/com/blogspot/applications4android/comicreader/comics/DMFA.java @@ -0,0 +1,97 @@ +package com.blogspot.applications4android.comicreader.comics; + +import java.io.BufferedReader; +import java.io.IOException; + +import com.blogspot.applications4android.comicreader.comictypes.IndexedComic; +import com.blogspot.applications4android.comicreader.core.Strip; +import com.blogspot.applications4android.comicreader.exceptions.ComicLatestException; + + + + +public class DMFA extends IndexedComic { + + @Override + protected String getFrontPageUrl() { + return "http://www.missmab.com/"; + } + + @Override + public String getComicWebPageUrl() { + return "http://www.missmab.com/"; + } + + @Override + protected int parseForLatestId(BufferedReader reader) throws ComicLatestException, IOException { + String str; + String final_str = null; + while ((str = reader.readLine()) != null) { + if(str.indexOf("Images/comicprev.gif") != -1) { + final_str = str; + } + } + if(final_str == null) { + String msg = "Failed to get the latest id for " + getName(); + ComicLatestException e = new ComicLatestException(msg); + throw e; + } + // using prev-id to get to the latest id. + final_str = final_str.replaceAll(".*") != -1) { + final_itext = str; + } + } + final_itext = final_itext.replaceAll(".*", ""); + final_itext = final_itext.replaceAll(".*", ""); + strip.setTitle("DMFA: #" + getIdFromStripUrl(url)); + strip.setText(final_itext); + return final_str; + } + + private String getImageUrlFromStripUrl(String url) { + int id = getIdFromStripUrl(url); + String idStr; + if(id < 10) { + idStr = "0" + id; + } + else { + idStr = "" + id; + } + return "http://www.missmab.com/Comics/Vol" + idStr + ".jpg"; + } +} diff --git a/ComicReader/src/com/blogspot/applications4android/comicreader/comics/ElGoonishShive.java b/ComicReader/src/com/blogspot/applications4android/comicreader/comics/ElGoonishShive.java index e74a0df..ecb3dad 100644 --- a/ComicReader/src/com/blogspot/applications4android/comicreader/comics/ElGoonishShive.java +++ b/ComicReader/src/com/blogspot/applications4android/comicreader/comics/ElGoonishShive.java @@ -5,13 +5,9 @@ package com.blogspot.applications4android.comicreader.comics; import java.io.BufferedReader; import java.io.IOException; import java.util.ArrayList; -import java.util.Calendar; import java.util.regex.Matcher; import java.util.regex.Pattern; -import android.util.Log; - -import com.blogspot.applications4android.comicreader.comictypes.DailyComic; import com.blogspot.applications4android.comicreader.comictypes.YearlyArchivedComic; import com.blogspot.applications4android.comicreader.core.Strip; diff --git a/ComicReader/src/com/blogspot/applications4android/comicreader/comics/GeneralProtectionFault.java b/ComicReader/src/com/blogspot/applications4android/comicreader/comics/GeneralProtectionFault.java index 28d9a75..06096a8 100644 --- a/ComicReader/src/com/blogspot/applications4android/comicreader/comics/GeneralProtectionFault.java +++ b/ComicReader/src/com/blogspot/applications4android/comicreader/comics/GeneralProtectionFault.java @@ -1,6 +1,5 @@ package com.blogspot.applications4android.comicreader.comics; -import android.util.Log; import com.blogspot.applications4android.comicreader.comictypes.YearlyArchivedComic; import com.blogspot.applications4android.comicreader.core.Strip; import java.io.BufferedReader;