From 9a5bb3b0f8ffc674f1496f916b52a57b1350f3c4 Mon Sep 17 00:00:00 2001 From: emily404 Date: Sun, 24 Feb 2013 19:06:08 -0800 Subject: [PATCH 1/2] local commit --- .../comicreader/comics/EerieCuties.java | 166 ++++++++++++++++++ 1 file changed, 166 insertions(+) create mode 100644 ComicReader/src/com/blogspot/applications4android/comicreader/comics/EerieCuties.java diff --git a/ComicReader/src/com/blogspot/applications4android/comicreader/comics/EerieCuties.java b/ComicReader/src/com/blogspot/applications4android/comicreader/comics/EerieCuties.java new file mode 100644 index 0000000..d9188bf --- /dev/null +++ b/ComicReader/src/com/blogspot/applications4android/comicreader/comics/EerieCuties.java @@ -0,0 +1,166 @@ +package com.blogspot.applications4android.comicreader.comics; + +import java.io.BufferedReader; +import java.io.IOException; +import java.net.URI; +import java.util.ArrayList; + + +import com.blogspot.applications4android.comicreader.comictypes.ArchivedComic; +import com.blogspot.applications4android.comicreader.core.Bound; +import com.blogspot.applications4android.comicreader.core.Downloader; +import com.blogspot.applications4android.comicreader.core.Strip; + +public class EerieCuties extends ArchivedComic { + + @Override + protected String[] getAllComicUrls(BufferedReader reader) + throws IOException { + int idx = 0; + ArrayList m_com = new ArrayList(); + ArrayList m_com0 = new ArrayList(m_com.size()); + String str,str_temp; + int i,j; + while((str = reader.readLine()) != null) { + i = str.indexOf(">0){ + str_temp = str_temp.substring(0,index-7); + } + m_com.add(str_temp); + idx++; + } + }//following code is because the original order of URL list is out of order + int remainder = m_com.size()%3; + if(remainder==0){ + for(j=0;j all_vols = new ArrayList(); + if (mComicUrls == null) { + try { + // Archive has volumes at different URL so get all source URLs + ArrayList vol_urls = getVolURL(); + for (String currentVol : vol_urls) { + URI u = null; + try { + u = new URI(currentVol); + } catch (Exception e) { + } // This should never occur!! + BufferedReader reader = Downloader.openConnection(u); + String[] urls = getAllComicUrls(reader); + for (int i = 0; i <= urls.length - 1; i++) { + all_vols.add(urls[i]); + } + reader.close(); + } + mComicUrls = new String[all_vols.size()]; + all_vols.toArray(mComicUrls); + } catch (Exception e) { + e.printStackTrace(); + return; + } + } + mBound = new Bound(0, (long) (mComicUrls.length - 1)); + } + + private ArrayList getVolURL() { + ArrayList vol_urls = new ArrayList(); + vol_urls.add("http://www.eeriecuties.com/archive/volume0"); + vol_urls.add("http://www.eeriecuties.com/archive/volume1"); + vol_urls.add("http://www.eeriecuties.com/archive/volume2"); + vol_urls.add("http://www.eeriecuties.com/archive/volume3"); + return vol_urls; + } + + @Override + protected String getLatestStripUrl() { + fetchAllComicUrls(); + return getStripUrlFromId(mComicUrls.length - 1); + } + + @Override + protected String getArchiveUrl() { + return "http://www.eeriecuties.com/archive"; + } + + @Override + public String getComicWebPageUrl() { + return "http://www.eeriecuties.com/"; + } + + @Override + protected boolean htmlNeeded() { + return true; + } + + @Override + protected String parse(String url, BufferedReader reader, Strip strip) + throws IOException { + String url_link = null; + String str_title = null; + String str,str_temp; + int i; + while((str = reader.readLine()) != null) { + i = str.indexOf("http://ace.eeriecuties.com/comics/"); + if (i != -1) { + str_temp = str; + str_temp=str_temp.replaceAll(".*?src=\"",""); + str_temp=str_temp.replaceAll(".png.*",""); + str_temp=str_temp.replaceAll(".jpg.*",""); + int res = 0; + for (int j=0; j < str_temp.length(); j++) { + char c = str_temp.charAt(j); + if (c < '0' || c > '9'){ + }else{ + int cc = Character.getNumericValue(c); + res = res * 10 + cc;} + } + if(res<20101102){ + url_link = str_temp + ".jpg"; + }else{ + url_link = str_temp + ".png"; + } + } + } + str_title = url.replaceAll(".*?strips-ec/",""); + str_title = str_title.replaceAll("%21","!"); + str_title = str_title.replaceAll("%28","("); + str_title = str_title.replaceAll("%29",")"); + str_title = "Eerie Cutie: "+str_title; + strip.setTitle(str_title); + strip.setText("-NA-"); + return url_link; + } + +} From 7ac787c506838fc65205fb64c9a4d782587c6e38 Mon Sep 17 00:00:00 2001 From: emily404 Date: Sun, 24 Feb 2013 19:14:38 -0800 Subject: [PATCH 2/2] edited classes.json --- ComicReader/assets/classes.json | 1 + 1 file changed, 1 insertion(+) diff --git a/ComicReader/assets/classes.json b/ComicReader/assets/classes.json index 3641bc0..540eede 100755 --- a/ComicReader/assets/classes.json +++ b/ComicReader/assets/classes.json @@ -23,6 +23,7 @@ {"class":"DogHouseDiaries", "name":"Doghouse Diaries", "pref":"doghousediariesPref"}, {"class":"DumbingofAge", "name":"Dumbing of Age", "pref":"dumbingofagePref"}, {"class":"EdmundFinney", "name":"Edmund Finney's Quest to Find the Meaning of Life", "pref":"edmundfinneyPref", "new":"1"}, + {"class":"EerieCuties","name":"Eerie Cuties", "pref":"eeriecutiesPref", "new":"1"}, {"class":"ElGoonishShive","name":"El Goonish Shive", "pref":"elgoonishshivePref", "new":"1"}, {"class":"FeyWinds", "name":"Fey Winds", "pref":"feywindsPref"}, {"class":"FreeFall", "name":"Free Fall", "pref":"freefallPref"},