• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

workspace


Commit MetaInfo

Révision22c1f1b7b5aa5f26121bf065ba4b5021ddeec18a (tree)
l'heure2011-12-01 10:47:54
Auteurharioroidios <kiyonari1986@gmai...>
Commiterharioroidios

Message de Log

feeds an insufficient attribute is added.

Change Summary

Modification

--- a/yt4droid/src/yt4droid/Feeds.java
+++ b/yt4droid/src/yt4droid/Feeds.java
@@ -16,6 +16,11 @@ public interface Feeds {
1616 public ContentEntity getContent();
1717 public String getDuration();
1818 public String getAspectRatio();
19- public String getCommentCount();
19+ public float getRating();
20+ public int getLikeCount();
21+ public int getRatingCount();
22+ public int getViewCount();
23+ public int getFavoriteCount();
24+ public int getCommentCount();
2025 public AccessControlEntity getAccessControl();
2126 }
--- a/yt4droid/src/yt4droid/Version.java
+++ b/yt4droid/src/yt4droid/Version.java
@@ -15,12 +15,10 @@ public class Version {
1515 public static String getVersion() {
1616 return VERSION;
1717 }
18- /*
1918 private static final String developer_key="AI39si7Tguq6DbpUUt4kJp2hvXxurSgehZ6I7H91L0az3wU8udWoRPOBqOoT1fnlpGahzuU1q_aZnLqEckDjfCTnqDSmXLvFAw";
2019 private static final String client_id="YouTubeSample";
2120 private static final String user_id="kiyonari1986@gmail.com";
2221 private static final String password="harigae1986";
23- */
2422 /**
2523 * prints the version string
2624 *
@@ -28,7 +26,6 @@ public class Version {
2826 */
2927 public static void main(String[] args) {
3028 System.out.println(TITLE + " " + VERSION);
31- /*
3229 ConfigurationBuilder conf = new ConfigurationBuilder();
3330 conf.setDeveloperKey(developer_key);
3431 conf.setClientID(client_id);
@@ -50,7 +47,6 @@ public class Version {
5047 // TODO 自動生成された catch ブロック
5148 e.printStackTrace();
5249 }
53- */
5450 }
5551
5652 }
--- a/yt4droid/src/yt4droid/parser/FeedsParser.java
+++ b/yt4droid/src/yt4droid/parser/FeedsParser.java
@@ -21,9 +21,10 @@ import yt4droid.internal.org.json.JSONException;
2121 import yt4droid.internal.org.json.JSONObject;
2222
2323 import static yt4droid.util.JSONParseUtil.getRawString;
24-import static yt4droid.util.JSONParseUtil.getDate;
2524 import static yt4droid.util.JSONParseUtil.getArrangement;
2625 import static yt4droid.util.JSONParseUtil.parseTrendsDate;
26+import static yt4droid.util.JSONParseUtil.getInt;
27+import static yt4droid.util.JSONParseUtil.getFloat;
2728
2829 public class FeedsParser implements Feeds{
2930
@@ -40,7 +41,12 @@ public class FeedsParser implements Feeds{
4041 private ContentEntity content;
4142 private String duration;
4243 private String aspectRatio;
43- private String commentCount;
44+ private float rating;
45+ private int likeCount;
46+ private int ratingCount;
47+ private int viewCount;
48+ private int favoriteCount;
49+ private int commentCount;
4450 private AccessControlEntity accessControl;
4551
4652 protected FeedsParser(HttpResponse res, Configuration conf) throws YoutubeException{
@@ -75,7 +81,12 @@ public class FeedsParser implements Feeds{
7581 }
7682 duration = getRawString("duration", json);
7783 aspectRatio = getRawString("aspectRatio", json);
78- commentCount = getRawString("commentCount", json);
84+ rating = getFloat("rating", json);
85+ likeCount = getInt("likeCount", json);
86+ ratingCount = getInt("ratingCount", json);
87+ viewCount = getInt("viewCount", json);
88+ favoriteCount = getInt("favoriteCount", json);
89+ commentCount = getInt("commentCount", json);
7990 try {
8091 accessControl = new AccessControlEntityImpl(json);
8192 } catch (JSONException ignore) {
@@ -148,7 +159,37 @@ public class FeedsParser implements Feeds{
148159 }
149160
150161 @Override
151- public String getCommentCount() {
162+ public float getRating() {
163+ // TODO 自動生成されたメソッド・スタブ
164+ return rating;
165+ }
166+
167+ @Override
168+ public int getLikeCount() {
169+ // TODO 自動生成されたメソッド・スタブ
170+ return likeCount;
171+ }
172+
173+ @Override
174+ public int getRatingCount() {
175+ // TODO 自動生成されたメソッド・スタブ
176+ return ratingCount;
177+ }
178+
179+ @Override
180+ public int getViewCount() {
181+ // TODO 自動生成されたメソッド・スタブ
182+ return viewCount;
183+ }
184+
185+ @Override
186+ public int getFavoriteCount() {
187+ // TODO 自動生成されたメソッド・スタブ
188+ return favoriteCount;
189+ }
190+
191+ @Override
192+ public int getCommentCount() {
152193 return commentCount;
153194 }
154195
@@ -176,5 +217,4 @@ public class FeedsParser implements Feeds{
176217 throw ye;
177218 }
178219 }
179-
180220 }
--- a/yt4droid/src/yt4droid/util/JSONParseUtil.java
+++ b/yt4droid/src/yt4droid/util/JSONParseUtil.java
@@ -153,6 +153,16 @@ public class JSONParseUtil {
153153 return Double.valueOf(str2);
154154 }
155155 }
156+
157+ public static float getFloat(String name, JSONObject json){
158+ String str = getRawString(name, json);
159+ if(null == str || "".equals(str) || "null".equals(str)) {
160+ return -1f;
161+ }
162+ else{
163+ return Float.valueOf(str);
164+ }
165+ }
156166
157167 public static boolean getBoolean(String name, JSONObject json) {
158168 String str = getRawString(name, json);