Author: jerome
Date: 2009-04-03 08:42:12 +0200 (Fri, 03 Apr 2009)
New Revision: 4324
Modified:
software_suite_v2/software/gadgets/tuxdroid-gadget-twitter/trunk/tuxdroid-gadget-twitter/src/GadgetTwitter.java
Log:
* Filter out simleys.
Modified:
software_suite_v2/software/gadgets/tuxdroid-gadget-twitter/trunk/tuxdroid-gadget-twitter/src/GadgetTwitter.java
===================================================================
---
software_suite_v2/software/gadgets/tuxdroid-gadget-twitter/trunk/tuxdroid-gadget-twitter/src/GadgetTwitter.java
2009-04-03 06:33:43 UTC (rev 4323)
+++
software_suite_v2/software/gadgets/tuxdroid-gadget-twitter/trunk/tuxdroid-gadget-twitter/src/GadgetTwitter.java
2009-04-03 06:42:12 UTC (rev 4324)
@@ -34,6 +34,12 @@
private TwitterDatasStruct savedStruct = new TwitterDatasStruct();
+ private String[] smileys = new String[]{":)", ":-)", ":(", ":-(", ":|",
":-|",
+ ":$", ":-$", ";)",
";-)", ";(", ";-(",
+ "o/", "\\o", "\\o/",
":o", ":-o", ":@",
+ ":-@", ":D", ":-D",
":p", ":d", ":-p",
+ ":-d", "=)", "=-)",
"$)", "$-)"};
+
@Override
protected void start() throws Throwable
{
@@ -79,6 +85,12 @@
{
noStatuses = false;
String stat =
statusText.replace("&", "");
+
+ for(String simley :
this.smileys)
+ {
+ stat =
stat.replaceAll(simley, "");
+ }
+
throwMessage(username + ", " +
stat);
this.savedStruct.addFriendStatus(username, statusText);
}
@@ -128,6 +140,12 @@
{
noReplies = false;
String repl =
reply.getText().replace("&", "").replace("@" +
this.configuration().getUsername(), "");
+
+ for(String simley :
this.smileys)
+ {
+ repl =
repl.replaceAll(simley, "");
+ }
+
throwMessage("reply from {0},
the reply is: {1}", username, repl);
this.savedStruct.addReply(username, reply.getText());
}
@@ -154,6 +172,12 @@
{
noMessage = false;
String mess =
message.getText().replace("&", "");
+
+ for(String simley :
this.smileys)
+ {
+ mess =
mess.replaceAll(simley, "");
+ }
+
throwMessage("message
from {0}, the message is: {1}", username, mess);
this.savedStruct.addMessage(username, message.getText());
}
------------------------------------------------------------------------------
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn