Skip to content
Browse files

Fixed up top 100

  • Loading branch information...
1 parent 6cd07fb commit 7572cb96c44080719b4413c3137b8fc3b5fa13ee @baldwinlouie committed Jun 27, 2012
Showing with 27 additions and 15 deletions.
  1. +8 −7 .classpath
  2. +19 −8 src/com/teleca/jamendo/api/impl/RSSFunctions.java
View
15 .classpath
@@ -1,7 +1,8 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
- <classpathentry kind="src" path="gen"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
+ <classpathentry kind="src" path="gen"/>
+ <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
+ <classpathentry kind="output" path="bin/classes"/>
+</classpath>
View
27 src/com/teleca/jamendo/api/impl/RSSFunctions.java
@@ -18,9 +18,12 @@
import org.w3c.dom.Document;
import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
+import android.util.Log;
+
import com.teleca.jamendo.api.util.XMLUtil;
/**
@@ -52,15 +55,23 @@
if( item_node.getNodeType() == Node.ELEMENT_NODE ){
Element item_element = (Element)item_node;
- // getting to link node in order to extract track id's
- Node link_node = item_element.getElementsByTagName("link").item(0);
-
- // link with track id
- String link = link_node.getFirstChild().getNodeValue();
+// // getting to link node in order to extract track id's
+// Node link_node = item_element.getElementsByTagName("link").item(0);
+//
+// // link with track id
+// String link = link_node.getFirstChild().getNodeValue();
+//
+// // parsing
+// String trackidStr = link.replaceAll("http://www.jamendo.com/track/", "");
+// tracks_id[i] = Integer.parseInt(trackidStr);
- // parsing
- String trackidStr = link.replaceAll("http://www.jamendo.com/track/", "");
- tracks_id[i] = Integer.parseInt(trackidStr);
+ Node link_node = item_element.getElementsByTagName("enclosure").item(0);
+ NamedNodeMap nMap = link_node.getAttributes();
+ Node url = nMap.getNamedItem("url");
+ String link = url.getNodeValue();
+ String trackidStr = link.replace("http://storage-new.newjamendo.com/?trackid=", "");
+ Log.d("RSSFunctions", "Top 100 track is " + trackidStr);
+ tracks_id[i] = Integer.parseInt(trackidStr);
}
}

0 comments on commit 7572cb9

Please sign in to comment.
Something went wrong with that request. Please try again.