Skip to content

Commit 6c62e7d

Browse files
committed
新增旺報
香港蘋果新增壹週Plus,飲食男女,Ketchupe 東森新聞雲新增鍵盤大檸檬 修復聯合新聞網 修復光明日報
1 parent 765adb7 commit 6c62e7d

File tree

13 files changed

+462
-446
lines changed

13 files changed

+462
-446
lines changed

.idea/workspace.xml

Lines changed: 285 additions & 261 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/app.iml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -98,23 +98,24 @@
9898
<orderEntry type="jdk" jdkName="Android API 25 Platform" jdkType="Android SDK" />
9999
<orderEntry type="sourceFolder" forTests="false" />
100100
<orderEntry type="library" exported="" name="butterknife-7.0.1" level="project" />
101+
<orderEntry type="library" exported="" name="play-services-gass-10.2.6" level="project" />
101102
<orderEntry type="library" exported="" name="mopub-sdk-native-video-4.12.0" level="project" />
102103
<orderEntry type="library" exported="" name="fragmentation-0.10.3" level="project" />
103104
<orderEntry type="library" exported="" name="exoplayer-r2.0.3" level="project" />
104105
<orderEntry type="library" exported="" name="mopub-sdk-4.12.0" level="project" />
105-
<orderEntry type="library" exported="" name="play-services-tagmanager-v4-impl-10.2.4" level="project" />
106-
<orderEntry type="library" exported="" name="play-services-gass-10.2.4" level="project" />
107106
<orderEntry type="library" exported="" name="transition-25.3.1" level="project" />
107+
<orderEntry type="library" exported="" name="play-services-tagmanager-v4-impl-10.2.6" level="project" />
108108
<orderEntry type="library" exported="" name="jsoup-1.10.2" level="project" />
109-
<orderEntry type="library" exported="" name="firebase-core-10.2.4" level="project" />
109+
<orderEntry type="library" exported="" name="firebase-core-10.2.6" level="project" />
110110
<orderEntry type="library" exported="" name="cardview-v7-24.0.0" level="project" />
111111
<orderEntry type="library" exported="" scope="TEST" name="multidex-instrumentation-1.0.1" level="project" />
112-
<orderEntry type="library" exported="" name="play-services-analytics-impl-10.2.4" level="project" />
112+
<orderEntry type="library" exported="" name="play-services-analytics-impl-10.2.6" level="project" />
113113
<orderEntry type="library" exported="" name="audience-network-sdk-4.20.0" level="project" />
114-
<orderEntry type="library" exported="" name="firebase-common-10.2.4" level="project" />
115114
<orderEntry type="library" exported="" name="fastadapter-1.6.0" level="project" />
115+
<orderEntry type="library" exported="" name="firebase-common-10.2.6" level="project" />
116116
<orderEntry type="library" exported="" name="rxjava-1.2.0" level="project" />
117-
<orderEntry type="library" exported="" name="play-services-basement-10.2.4" level="project" />
117+
<orderEntry type="library" exported="" name="play-services-basement-10.2.6" level="project" />
118+
<orderEntry type="library" exported="" name="play-services-tasks-10.2.6" level="project" />
118119
<orderEntry type="library" exported="" name="support-v4-25.3.1" level="project" />
119120
<orderEntry type="library" exported="" name="support-media-compat-25.3.1" level="project" />
120121
<orderEntry type="library" exported="" name="materialish-progress-1.7" level="project" />
@@ -125,34 +126,33 @@
125126
<orderEntry type="library" exported="" name="iconics-core-2.7.1" level="project" />
126127
<orderEntry type="library" exported="" name="okio-1.9.0" level="project" />
127128
<orderEntry type="library" exported="" name="fragmentation-swipeback-0.7.9" level="project" />
128-
<orderEntry type="library" exported="" name="firebase-analytics-10.2.4" level="project" />
129-
<orderEntry type="library" exported="" name="play-services-base-10.2.4" level="project" />
130-
<orderEntry type="library" exported="" name="play-services-tasks-10.2.4" level="project" />
129+
<orderEntry type="library" exported="" name="firebase-analytics-10.2.6" level="project" />
131130
<orderEntry type="library" exported="" name="design-25.3.1" level="project" />
132131
<orderEntry type="library" exported="" name="support-core-ui-25.3.1" level="project" />
133132
<orderEntry type="library" exported="" name="community-material-typeface-1.5.54.1" level="project" />
134-
<orderEntry type="library" exported="" name="firebase-iid-10.2.4" level="project" />
135-
<orderEntry type="library" exported="" name="play-services-clearcut-10.2.4" level="project" />
133+
<orderEntry type="library" exported="" name="play-services-base-10.2.6" level="project" />
134+
<orderEntry type="library" exported="" name="firebase-iid-10.2.6" level="project" />
136135
<orderEntry type="library" exported="" name="glide-3.7.0" level="project" />
137136
<orderEntry type="library" exported="" name="support-core-utils-25.3.1" level="project" />
138137
<orderEntry type="library" exported="" name="support-fragment-25.3.1" level="project" />
139-
<orderEntry type="library" exported="" name="play-services-ads-lite-10.2.4" level="project" />
140138
<orderEntry type="library" exported="" name="mopub-sdk-interstitial-4.12.0" level="project" />
139+
<orderEntry type="library" exported="" name="play-services-ads-lite-10.2.6" level="project" />
140+
<orderEntry type="library" exported="" name="play-services-clearcut-10.2.6" level="project" />
141141
<orderEntry type="library" exported="" name="mopub-sdk-banner-4.12.0" level="project" />
142142
<orderEntry type="library" exported="" name="mopub-volley-1.1.0" level="project" />
143-
<orderEntry type="library" exported="" name="play-services-ads-10.2.4" level="project" />
144-
<orderEntry type="library" exported="" name="firebase-analytics-impl-10.2.4" level="project" />
143+
<orderEntry type="library" exported="" name="play-services-ads-10.2.6" level="project" />
144+
<orderEntry type="library" exported="" name="firebase-analytics-impl-10.2.6" level="project" />
145145
<orderEntry type="library" exported="" name="mopub-sdk-native-static-4.12.0" level="project" />
146146
<orderEntry type="library" exported="" name="vpadn-sdk-obf464-21407102-1704121104-cdcc646" level="project" />
147147
<orderEntry type="library" exported="" name="rxandroid-1.2.1" level="project" />
148148
<orderEntry type="library" exported="" name="aboutlibraries-5.7.1" level="project" />
149-
<orderEntry type="library" exported="" name="play-services-analytics-10.2.4" level="project" />
150149
<orderEntry type="library" exported="" name="multidex-1.0.1" level="project" />
151150
<orderEntry type="library" exported="" scope="TEST" name="hamcrest-core-1.3" level="project" />
152151
<orderEntry type="library" exported="" name="okhttp-3.4.1" level="project" />
153152
<orderEntry type="library" exported="" scope="TEST" name="junit-4.12" level="project" />
154153
<orderEntry type="library" exported="" name="recyclerview-v7-25.3.1" level="project" />
155154
<orderEntry type="library" exported="" name="appcompat-v7-25.3.1" level="project" />
155+
<orderEntry type="library" exported="" name="play-services-analytics-10.2.6" level="project" />
156156
<orderEntry type="library" exported="" name="mopub-sdk-base-4.12.0" level="project" />
157157
<orderEntry type="library" exported="" name="animated-vector-drawable-25.3.1" level="project" />
158158
</component>

app/build.gradle

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ android {
77
applicationId "com.ccjeng.news"
88
minSdkVersion 16
99
targetSdkVersion 23
10-
versionCode 45
11-
versionName '1.8.7.051217SN'
10+
versionCode 46
11+
versionName '1.8.8.052817SN'
1212
vectorDrawables.useSupportLibrary = true
1313
multiDexEnabled true
1414
}
@@ -39,11 +39,11 @@ dependencies {
3939
compile 'com.android.support:appcompat-v7:25.3.1'
4040
compile 'com.android.support:design:25.3.1'
4141
compile 'com.android.support:multidex:1.0.1'
42-
compile 'com.google.android.gms:play-services-analytics:10.2.4'
43-
compile 'com.google.android.gms:play-services-ads:10.2.4'
42+
compile 'com.google.android.gms:play-services-analytics:10.2.6'
43+
compile 'com.google.android.gms:play-services-ads:10.2.6'
4444
//for FAN, don't move
45-
compile 'com.google.firebase:firebase-core:10.2.4'
46-
releaseCompile 'com.google.firebase:firebase-crash:10.2.4'
45+
compile 'com.google.firebase:firebase-core:10.2.6'
46+
releaseCompile 'com.google.firebase:firebase-crash:10.2.6'
4747
compile 'com.jakewharton:butterknife:7.0.1'
4848
compile 'com.mikepenz:iconics-core:2.7.1@aar'
4949
compile 'com.mikepenz:community-material-typeface:1.5.54.1@aar'

app/src/main/java/com/ccjeng/news/parser/rss/CustomFeedParser.java

Lines changed: 40 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,38 +14,62 @@
1414
public class CustomFeedParser {
1515

1616
public RSSFeed getFeeds(String url, String content) {
17+
final String TAG = "CustomFeedParser";
1718
RSSFeed feed = new RSSFeed();
1819
RSSItem item;
1920
Document doc = Jsoup.parse(content);
2021
Elements links;
22+
Element link;
2123
String root;
2224

2325
try {
2426

2527
if (url.contains("hkm.appledaily.com")) {
26-
links = doc.select("ul li a");
2728
root = "http://hkm.appledaily.com/";
2829

29-
for (Element k : links) {
30-
if (k.attr("href").contains("detail.php")) {
31-
32-
String u = k.attr("href");
33-
30+
if(url.contains("category=magazine")) { //壹週
31+
links = doc.select("div.slider");
32+
for (Element k : links) {
3433
item = new RSSItem();
35-
item.setTitle(k.select("p").text());
36-
item.setLink(root + u);
37-
38-
if (url.contains("=daily")) {
39-
//日報
40-
item.setPubDate(u.substring(u.length() - 8));
41-
} else if (url.contains("=instant")) {
42-
//即時新聞
43-
item.setPubDate(k.select("label").text());
44-
}
34+
item.setTitle(k.select("p.caption").text());
35+
item.setLink(root + k.select("a").attr("href"));
36+
item.setDescription("");
37+
item.setImg(k.select("div.background").attr("style").replace("background-image:url('","").replace("')",""));
38+
feed.addItem(item);
39+
}
40+
links = doc.select("div.item");
41+
for (Element k : links) {
42+
item = new RSSItem();
43+
item.setTitle(k.select("p").get(1).text());
44+
item.setLink(root + k.select("a").attr("href"));
4545
item.setDescription("");
4646
item.setImg(k.select("img").first().absUrl("src"));
4747
feed.addItem(item);
4848
}
49+
50+
} else {
51+
links = doc.select("ul li a");
52+
for (Element k : links) {
53+
if (k.attr("href").contains("detail.php")) {
54+
55+
String u = k.attr("href");
56+
57+
item = new RSSItem();
58+
item.setTitle(k.select("p").text());
59+
item.setLink(root + u);
60+
61+
if (url.contains("=daily")) {
62+
//日報
63+
item.setPubDate(u.substring(u.length() - 8));
64+
} else if (url.contains("=instant")) {
65+
//即時新聞
66+
item.setPubDate(k.select("label").text());
67+
}
68+
item.setDescription("");
69+
item.setImg(k.select("img").first().absUrl("src"));
70+
feed.addItem(item);
71+
}
72+
}
4973
}
5074

5175
} else if (url.contains("am730.com.hk")) {

app/src/main/java/com/ccjeng/news/parser/sg/Guangming.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,9 @@ public String parseHtml(final String link, String content) throws IOException {
2828
String time = "";
2929

3030
try {
31-
title = doc.select("h2.title").text();
32-
time = doc.select("div.submitted").text();
33-
body = doc.select("div.content_wrapper").html() + "<p>"
34-
+ doc.select("ul#spotlight").html();
31+
title = doc.select("h1").text();
32+
time = doc.select("div.article-create-date").text();
33+
body = doc.select("article > div.content").html();
3534
} catch (Exception e) {
3635
e.printStackTrace();
3736
}

app/src/main/java/com/ccjeng/news/parser/tw/UDN.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,14 @@ public String parseHtml(final String link, String content) throws IOException {
3434
} else {
3535
title = doc.select("h1").text();
3636
}
37-
time = doc.select("div#story_bady_info h3").text();
38-
body = doc.select("div#story_body_content").html();
37+
38+
if (link.contains("stars.udn.com")) {
39+
time = doc.select("time").text();
40+
body = doc.select("figure").html() + "<p>"+ doc.select("div#story").html();
41+
} else {
42+
time = doc.select("div#story_bady_info h3").text();
43+
body = doc.select("div#story_body_content").html();
44+
}
3945
} catch (Exception e) {
4046
e.printStackTrace();
4147
}

app/src/main/java/com/ccjeng/news/utils/Category.java

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -65,27 +65,30 @@ public String[] getCategory(String tab, int position) {
6565
category = context.getResources().getStringArray(R.array.newscatsChinaTimes);
6666
break;
6767
case 6:
68-
category = context.getResources().getStringArray(R.array.newscatsStorm);
68+
category = context.getResources().getStringArray(R.array.newscatsCommercial);
6969
break;
7070
case 7:
71-
category = context.getResources().getStringArray(R.array.newscatsCommercial);
71+
category = context.getResources().getStringArray(R.array.newscatsWant);
7272
break;
7373
case 8:
74-
category = context.getResources().getStringArray(R.array.newscatsEttoday);
74+
category = context.getResources().getStringArray(R.array.newscatsStorm);
7575
break;
7676
case 9:
77-
category = context.getResources().getStringArray(R.array.newscatsCNYes);
77+
category = context.getResources().getStringArray(R.array.newscatsEttoday);
7878
break;
7979
case 10:
80-
category = context.getResources().getStringArray(R.array.newscatsNewsTalk);
80+
category = context.getResources().getStringArray(R.array.newscatsCNYes);
8181
break;
8282
case 11:
83-
category = context.getResources().getStringArray(R.array.newscatsLibertyTimes);
83+
category = context.getResources().getStringArray(R.array.newscatsNewsTalk);
8484
break;
8585
case 12:
86-
category = context.getResources().getStringArray(R.array.newscatsAppDaily);
86+
category = context.getResources().getStringArray(R.array.newscatsLibertyTimes);
8787
break;
8888
case 13:
89+
category = context.getResources().getStringArray(R.array.newscatsAppDaily);
90+
break;
91+
case 14:
8992
category = context.getResources().getStringArray(R.array.newsCatsTheNewsLens);
9093
break;
9194
}
@@ -169,27 +172,30 @@ public String[] getFeedURL(String tab, int position) {
169172
feedURL = context.getResources().getStringArray(R.array.newsfeedsChinaTimes);
170173
break;
171174
case 6:
172-
feedURL = context.getResources().getStringArray(R.array.newsfeedsStorm);
175+
feedURL = context.getResources().getStringArray(R.array.newsfeedsCommercial);
173176
break;
174177
case 7:
175-
feedURL = context.getResources().getStringArray(R.array.newsfeedsCommercial);
178+
feedURL = context.getResources().getStringArray(R.array.newsfeedsWant);
176179
break;
177180
case 8:
178-
feedURL = context.getResources().getStringArray(R.array.newsfeedsEttoday);
181+
feedURL = context.getResources().getStringArray(R.array.newsfeedsStorm);
179182
break;
180183
case 9:
181-
feedURL = context.getResources().getStringArray(R.array.newsfeedsCNYes);
184+
feedURL = context.getResources().getStringArray(R.array.newsfeedsEttoday);
182185
break;
183186
case 10:
184-
feedURL = context.getResources().getStringArray(R.array.newsfeedsNewsTalk);
187+
feedURL = context.getResources().getStringArray(R.array.newsfeedsCNYes);
185188
break;
186189
case 11:
187-
feedURL = context.getResources().getStringArray(R.array.newsfeedsLibertyTimes);
190+
feedURL = context.getResources().getStringArray(R.array.newsfeedsNewsTalk);
188191
break;
189192
case 12:
190-
feedURL = context.getResources().getStringArray(R.array.newsfeedsAppDaily);
193+
feedURL = context.getResources().getStringArray(R.array.newsfeedsLibertyTimes);
191194
break;
192195
case 13:
196+
feedURL = context.getResources().getStringArray(R.array.newsfeedsAppDaily);
197+
break;
198+
case 14:
193199
feedURL = context.getResources().getStringArray(R.array.newsFeedsTheNewsLens);
194200
break;
195201
}
@@ -268,30 +274,29 @@ public AbstractNews getNewsParser(String tab, int position) {
268274
parser = new YamNews();
269275
break;
270276
case 5:
271-
parser = new ChinaTimes();
272-
break;
273277
case 6:
274-
parser = new Storm();
275-
break;
276278
case 7:
277279
parser = new ChinaTimes();
278280
break;
279281
case 8:
280-
parser = new ETToday();
282+
parser = new Storm();
281283
break;
282284
case 9:
283-
parser = new CNYes();
285+
parser = new ETToday();
284286
break;
285287
case 10:
286-
parser = new NewTalk();
288+
parser = new CNYes();
287289
break;
288290
case 11:
289-
parser = new LibertyTimes();
291+
parser = new NewTalk();
290292
break;
291293
case 12:
292-
parser = new AppleDaily();
294+
parser = new LibertyTimes();
293295
break;
294296
case 13:
297+
parser = new AppleDaily();
298+
break;
299+
case 14:
295300
parser = new TheNewsLens();
296301
break;
297302
}

app/src/main/res/values-zh-rCN/update.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
tools:ignore="MissingTranslation">
44

55
<string-array name="updates">
6-
<item>v1.8.7\n修复ETNet
6+
<item>v1.8.8\n新增旺报\n香港苹果新增壹周Plus,饮食男女,Ketchupe\n东森新闻云新增键盘大柠檬\n修复联合新闻网\n修复光明日报
77
</item>
88
</string-array>
99
</resources>

app/src/main/res/values/news_tw.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99
<item>聯合財經網</item>
1010
<item>蕃薯藤新聞</item>
1111
<item>中時電子報</item>
12+
<item>工商時報</item>
13+
<item>旺報</item>
1214
<item>風傳媒</item>
13-
<item>工商時報</item>
1415
<item>東森新聞雲</item>
1516
<item>鉅亨網</item>
1617
<item>新頭殼</item>

0 commit comments

Comments
 (0)