Author: jerome
Date: 2009-04-08 19:09:36 +0200 (Wed, 08 Apr 2009)
New Revision: 4419

Modified:
   
software_suite_v2/software/gadgets/tuxdroid-gadget-programsTV/trunk/tuxdroid-gadget-programsTV/src/com/kysoh/tvPrograms/gadget/GadgetProgramsTvBeFr.java
   
software_suite_v2/software/gadgets/tuxdroid-gadget-programsTV/trunk/tuxdroid-gadget-programsTV/src/com/kysoh/tvPrograms/programs/SimplePrograms.java
Log:
* Getting the complete tv program.

Modified: 
software_suite_v2/software/gadgets/tuxdroid-gadget-programsTV/trunk/tuxdroid-gadget-programsTV/src/com/kysoh/tvPrograms/gadget/GadgetProgramsTvBeFr.java
===================================================================
--- 
software_suite_v2/software/gadgets/tuxdroid-gadget-programsTV/trunk/tuxdroid-gadget-programsTV/src/com/kysoh/tvPrograms/gadget/GadgetProgramsTvBeFr.java
    2009-04-08 17:00:04 UTC (rev 4418)
+++ 
software_suite_v2/software/gadgets/tuxdroid-gadget-programsTV/trunk/tuxdroid-gadget-programsTV/src/com/kysoh/tvPrograms/gadget/GadgetProgramsTvBeFr.java
    2009-04-08 17:09:36 UTC (rev 4419)
@@ -66,7 +66,7 @@
                }
                catch(Exception error)
                {
-                       this.loadError(null);
+                       error.printStackTrace();
                }
        }
        

Modified: 
software_suite_v2/software/gadgets/tuxdroid-gadget-programsTV/trunk/tuxdroid-gadget-programsTV/src/com/kysoh/tvPrograms/programs/SimplePrograms.java
===================================================================
--- 
software_suite_v2/software/gadgets/tuxdroid-gadget-programsTV/trunk/tuxdroid-gadget-programsTV/src/com/kysoh/tvPrograms/programs/SimplePrograms.java
        2009-04-08 17:00:04 UTC (rev 4418)
+++ 
software_suite_v2/software/gadgets/tuxdroid-gadget-programsTV/trunk/tuxdroid-gadget-programsTV/src/com/kysoh/tvPrograms/programs/SimplePrograms.java
        2009-04-08 17:09:36 UTC (rev 4419)
@@ -259,38 +259,37 @@
                for(String str : split)
                {
                        if(!str.contains("</td></tr></table>"))
-                       {
-                               //Getting start time.
-                               String startTime = str.substring(0, 
str.indexOf("<B>"));
-                               str = str.replace(startTime, "");
-                               startTime = 
HTMLUtils.HtmlToString(startTime).substring(0, 5);
-                               
-                               //Getting title.
-                               String title = str.substring(str.indexOf("<B>") 
+ "<B>".length(), str.indexOf("</B>"));
-                               str = str.replace(title, "");
-                               str = str.substring(str.indexOf("</B>") + 
"</B>".length());
-                               title = HTMLUtils.HtmlToString(title);
-                               
-                               //Gettin description if it can be found.
-                               String description = null;
-                               
-                               if(str.contains("<ul>"))
+                       {       
+                               if(str.contains("<B>"))
                                {
-                                       description = 
str.substring(str.indexOf("<ul>") + "<ul>".length(), str.indexOf("</ul>"));
-                                       str = str.replace(description, "");
-                                       str = str.substring(9);
-                                       description = 
HTMLUtils.HtmlToString(description);
+                                       while(str.contains("<B>"))
+                                       {
+                                               //Get start time for next str 
entry.
+                                               String startTime = 
str.substring(0, str.indexOf("<B>"));
+                                               str = str.replace(startTime, 
"");
+                                               startTime = 
HTMLUtils.HtmlToString(startTime).substring(0, 5); 
+                                               
+                                               //Get title.
+                                               String title = 
str.substring(str.indexOf("<B>") + "<B>".length(), str.indexOf("</B>"));
+                                               str = str.replace(title, "");
+                                               str = 
str.substring(str.indexOf("</B>") + "</B>".length());
+                                               title = 
HTMLUtils.HtmlToString(title);
+                                               
+                                               //Gettin description if it can 
be found.
+                                               String description = null;
+                                               
+                                               if(str.contains("<ul>"))
+                                               {
+                                                       description = 
str.substring(str.indexOf("<ul>") + "<ul>".length(), str.indexOf("</ul>"));
+                                                       str = 
str.replace(description, "");
+                                                       str = str.substring(9);
+                                                       description = 
HTMLUtils.HtmlToString(description);
+                                               }
+                                               
+                                               Program p = new Program(title, 
startTime, description, channel);
+                                               def.add(p);
+                                       }
                                }
-                               
-                               Program p = new Program(title, startTime, 
description, channel);
-                               //def.add(p);
-                               
-                               if(str.length() > 0)
-                               {
-                                       
-                               }
-                               
-                               System.out.println(str);
                        }
                }
                


------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn

Reply via email to