tux-droid-svn Mailing List for Tux Droid CE (Page 13)
Status: Beta
Brought to you by:
ks156
You can subscribe to this list here.
| 2007 |
Jan
|
Feb
(32) |
Mar
(108) |
Apr
(71) |
May
(38) |
Jun
(128) |
Jul
(1) |
Aug
(14) |
Sep
(77) |
Oct
(104) |
Nov
(90) |
Dec
(71) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2008 |
Jan
(81) |
Feb
(18) |
Mar
(40) |
Apr
(102) |
May
(151) |
Jun
(74) |
Jul
(151) |
Aug
(257) |
Sep
(447) |
Oct
(379) |
Nov
(404) |
Dec
(430) |
| 2009 |
Jan
(173) |
Feb
(236) |
Mar
(519) |
Apr
(300) |
May
(112) |
Jun
(232) |
Jul
(314) |
Aug
(58) |
Sep
(203) |
Oct
(293) |
Nov
(26) |
Dec
(109) |
| 2010 |
Jan
(19) |
Feb
(25) |
Mar
(33) |
Apr
(1) |
May
|
Jun
(3) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: ks156 <c2m...@c2...> - 2009-10-19 12:47:49
|
Author: ks156
Date: 2009-10-19 14:47:35 +0200 (Mon, 19 Oct 2009)
New Revision: 5730
Modified:
software_suite_v3/software/plugin/plugin-twitter/trunk/plugin-twitter/src/TwitterPlugin.java
Log:
* Detect when the login is not correct (error 401) and warn the user.
Modified: software_suite_v3/software/plugin/plugin-twitter/trunk/plugin-twitter/src/TwitterPlugin.java
===================================================================
--- software_suite_v3/software/plugin/plugin-twitter/trunk/plugin-twitter/src/TwitterPlugin.java 2009-10-19 11:59:12 UTC (rev 5729)
+++ software_suite_v3/software/plugin/plugin-twitter/trunk/plugin-twitter/src/TwitterPlugin.java 2009-10-19 12:47:35 UTC (rev 5730)
@@ -341,7 +341,14 @@
{
if ( ! this.getCommand().equalsIgnoreCase("check") )
{
- throwMessage("Twitter is busy for now, please, try later.");
+ if (badRequest.getMessage().contains("401"))
+ {
+ throwMessage("Sorry, there was an error when connecting to Twitter. Please check your Twitter configuration.");
+ }
+ else
+ {
+ throwMessage("Twitter is busy for now, please, try later.");
+ }
}
this.quitGadget();
|
|
From: ks156 <c2m...@c2...> - 2009-10-19 11:59:26
|
Author: ks156
Date: 2009-10-19 13:59:12 +0200 (Mon, 19 Oct 2009)
New Revision: 5729
Modified:
software_suite_v3/software/plugin/plugin-gmail/branches/random_sentences/plugin-gmail/src/net/karmaLab/tuxDroid/plugins/MailPlugin.java
Log:
* Pick sentences for the sender and the subject, but keep them for all the
mails. Changing the sentences for every mail is a bit disturbing...
Modified: software_suite_v3/software/plugin/plugin-gmail/branches/random_sentences/plugin-gmail/src/net/karmaLab/tuxDroid/plugins/MailPlugin.java
===================================================================
--- software_suite_v3/software/plugin/plugin-gmail/branches/random_sentences/plugin-gmail/src/net/karmaLab/tuxDroid/plugins/MailPlugin.java 2009-10-19 11:08:54 UTC (rev 5728)
+++ software_suite_v3/software/plugin/plugin-gmail/branches/random_sentences/plugin-gmail/src/net/karmaLab/tuxDroid/plugins/MailPlugin.java 2009-10-19 11:59:12 UTC (rev 5729)
@@ -180,6 +180,9 @@
}
String sessionId = "pop.gmail.com_" + configuration().getUser();
State stateRun = readState(State.class, sessionId + "RUN");
+
+ String senderSentence = this.pickSentence(mailSenderSentences);
+ String subjectSentence = this.pickSentence(mailSubjectSentences);
/* Check for new message */
boolean newMessageRun = false;
for (int i = messages.length - 1; i >= 0; i--)
@@ -267,8 +270,8 @@
mailCounter++;
if (mailCounter <= 5)
{
- throwMessage(this.pickSentence(mailSenderSentences), sender);
- throwMessage(this.pickSentence(mailSubjectSentences), filteredSubject);
+ throwMessage(senderSentence, sender);
+ throwMessage(subjectSentence, filteredSubject);
}
/* Referencing the current mail */
stateRun.getLastMessages().add(filteredSubject);
|
|
From: ks156 <c2m...@c2...> - 2009-10-19 11:09:09
|
Author: ks156
Date: 2009-10-19 13:08:54 +0200 (Mon, 19 Oct 2009)
New Revision: 5728
Modified:
software_suite_v3/software/plugin/plugin-email/branches/random_sentences/plugin-email/src/net/karmaLab/tuxDroid/plugins/MailPlugin.java
Log:
* Pick sentences for the sender and the subject, but keep them for all the
mails. Changing the sentences for every mail is a bit disturbing...
Modified: software_suite_v3/software/plugin/plugin-email/branches/random_sentences/plugin-email/src/net/karmaLab/tuxDroid/plugins/MailPlugin.java
===================================================================
--- software_suite_v3/software/plugin/plugin-email/branches/random_sentences/plugin-email/src/net/karmaLab/tuxDroid/plugins/MailPlugin.java 2009-10-19 10:42:10 UTC (rev 5727)
+++ software_suite_v3/software/plugin/plugin-email/branches/random_sentences/plugin-email/src/net/karmaLab/tuxDroid/plugins/MailPlugin.java 2009-10-19 11:08:54 UTC (rev 5728)
@@ -199,6 +199,9 @@
{
int mailCounter = 0;
boolean notifyNoNewMail = true;
+
+ String senderSentence = this.pickSentence(mailSenderSentences);
+ String subjectSentence = this.pickSentence(mailSubjectSentences);
/* For all unread mails */
for (int i = messages.length - 1; i >= 0; i--)
{
@@ -268,8 +271,8 @@
mailCounter++;
if (mailCounter <= 5)
{
- throwMessage(this.pickSentence(mailSenderSentences), sender);
- throwMessage(this.pickSentence(mailSubjectSentences), filteredSubject);
+ throwMessage(senderSentence, sender);
+ throwMessage(subjectSentence, filteredSubject);
}
/* Referencing the current mail */
stateRun.getLastMessages().add(filteredSubject);
|
|
From: ks156 <c2m...@c2...> - 2009-10-19 10:42:36
|
Author: ks156
Date: 2009-10-19 12:42:10 +0200 (Mon, 19 Oct 2009)
New Revision: 5727
Modified:
software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/resources/de.po
software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/resources/en.po
software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/resources/fr.po
software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/resources/nl.po
software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/resources/plugin.pot
software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/TwitterPlugin.java
Log:
* Added more sentences
* Updated the translation files :
* pot is up-to-date
* en / fr are fully translated
* nl / de still have to be translated
Modified: software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/resources/de.po
===================================================================
--- software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/resources/de.po 2009-10-19 09:17:32 UTC (rev 5726)
+++ software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/resources/de.po 2009-10-19 10:42:10 UTC (rev 5727)
@@ -43,18 +43,78 @@
msgid "There is a new Tweet available."
msgstr "Sie haben eine neue Freund Aktualisierung."
+msgid "You have a new Tweet"
+msgstr "You have a new Tweet"
+
+msgid "You have a new Tweet on your Twitter"
+msgstr "You have a new Tweet on your Twitter"
+
+msgid "I found a new Tweet on your Twitter account"
+msgstr "I found a new Tweet on your Twitter account"
+
+msgid "There is a new Tweet on your Twitter page"
+msgstr "There is a new Tweet on your Twitter page"
+
msgid "You have {0} new Tweets."
msgstr "Sie haben {0} Freund Aktualisierungen."
+msgid "There are {0} new Tweets available"
+msgstr "There are {0} new Tweets available"
+
+msgid "You have {0} new Tweets on your Twitter"
+msgstr "You have {0} new Tweets on your Twitter"
+
+msgid "I found {0} new Tweets on your Twitter account"
+msgstr "I found {0} new Tweets on your Twitter account"
+
+msgid "There are {0} new Tweets on your Twitter page"
+msgstr "There are {0} new Tweets on your Twitter page"
+
msgid "You don't have any new Tweets."
msgstr "Sie haben keine Freund Aktualisierungen."
+msgid "I couldn't find any new Tweets"
+msgstr "I couldn't find any new Tweets"
+
+msgid "There are no new Tweets available"
+msgstr "There are no new Tweets available"
+
+msgid "No new Tweets detected"
+msgstr "No new Tweets detected"
+
+msgid "I couldn't detect any new Tweets"
+msgstr "I couldn't detect any new Tweets"
+
msgid "You don't have any messages"
msgstr "Sie haben keine Nachrichten."
+msgid "You have no private messages"
+msgstr "You have no private messages"
+
+msgid "I couldn't find any new messages"
+msgstr "I couldn't find any new messages"
+
+msgid "There are no new private messages"
+msgstr "There are no new private messages"
+
+msgid "No private messages detected"
+msgstr "No private messages detected"
+
msgid "You don't have any replies"
msgstr "Sie haben keine Antworten."
+msgid "You have no new replies"
+msgstr "You have no new replies"
+
+msgid "There are no replies"
+msgstr "There are no replies"
+
+msgid "I could not find any replies"
+msgstr "I could not find any replies"
+
+msgid "There are no new replies detected"
+msgstr "There are no new replies detected"
+
msgid "Your new Tweet was not set, please, try again later"
msgstr "Ihre neue Tweet wurde nicht hinzugefügt, versuchen Sie es später."
Modified: software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/resources/en.po
===================================================================
--- software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/resources/en.po 2009-10-19 09:17:32 UTC (rev 5726)
+++ software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/resources/en.po 2009-10-19 10:42:10 UTC (rev 5727)
@@ -43,18 +43,78 @@
msgid "There is a new Tweet available."
msgstr "There is a new Tweet available."
+msgid "You have a new Tweet"
+msgstr "You have a new Tweet"
+
+msgid "You have a new Tweet on your Twitter"
+msgstr "You have a new Tweet on your Twitter"
+
+msgid "I found a new Tweet on your Twitter account"
+msgstr "I found a new Tweet on your Twitter account"
+
+msgid "There is a new Tweet on your Twitter page"
+msgstr "There is a new Tweet on your Twitter page"
+
msgid "You have {0} new Tweets."
msgstr "You have {0} new Tweets."
+msgid "There are {0} new Tweets available"
+msgstr "There are {0} new Tweets available"
+
+msgid "You have {0} new Tweets on your Twitter"
+msgstr "You have {0} new Tweets on your Twitter"
+
+msgid "I found {0} new Tweets on your Twitter account"
+msgstr "I found {0} new Tweets on your Twitter account"
+
+msgid "There are {0} new Tweets on your Twitter page"
+msgstr "There are {0} new Tweets on your Twitter page"
+
msgid "You don't have any new Tweets."
msgstr "You don't have any new Tweets."
+msgid "I couldn't find any new Tweets"
+msgstr "I couldn't find any new Tweets"
+
+msgid "There are no new Tweets available"
+msgstr "There are no new Tweets available"
+
+msgid "No new Tweets detected"
+msgstr "No new Tweets detected"
+
+msgid "I couldn't detect any new Tweets"
+msgstr "I couldn't detect any new Tweets"
+
msgid "You don't have any messages"
msgstr "You don't have any messages."
+msgid "You have no private messages"
+msgstr "You have no private messages"
+
+msgid "I couldn't find any new messages"
+msgstr "I couldn't find any new messages"
+
+msgid "There are no new private messages"
+msgstr "There are no new private messages"
+
+msgid "No private messages detected"
+msgstr "No private messages detected"
+
msgid "You don't have any replies"
msgstr "You don't have any replies."
+msgid "You have no new replies"
+msgstr "You have no new replies"
+
+msgid "There are no replies"
+msgstr "There are no replies"
+
+msgid "I could not find any replies"
+msgstr "I could not find any replies"
+
+msgid "There are no new replies detected"
+msgstr "There are no new replies detected"
+
msgid "Your new Tweet was not set, please, try again later"
msgstr "Your new Tweet was not set, please, try again later."
Modified: software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/resources/fr.po
===================================================================
--- software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/resources/fr.po 2009-10-19 09:17:32 UTC (rev 5726)
+++ software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/resources/fr.po 2009-10-19 10:42:10 UTC (rev 5727)
@@ -43,18 +43,78 @@
msgid "There is a new Tweet available."
msgstr "Un ami à publié un nouveau Tweet"
+msgid "You have a new Tweet"
+msgstr "Vous avez un nouveau Tweet"
+
+msgid "You have a new Tweet on your Twitter"
+msgstr "Vous avez un nouveau Tweet sur Twitter"
+
+msgid "I found a new Tweet on your Twitter account"
+msgstr "J'ai trouvé un nouveau Tweet sur votre compte Twitter"
+
+msgid "There is a new Tweet on your Twitter page"
+msgstr "Il y a un nouveau Tweet sur votre page Twitter"
+
msgid "You have {0} new Tweets."
msgstr "{0} de vos amis ont publié un nouveau Tweet"
+msgid "There are {0} new Tweets available"
+msgstr "Il y a {0} nouveaux Tweets disponibles"
+
+msgid "You have {0} new Tweets on your Twitter"
+msgstr "Vous avez {0} nouveaux Tweets sur Twitter"
+
+msgid "I found {0} new Tweets on your Twitter account"
+msgstr "J'ai trouvé {0} nouveaux Tweets sur votre compte Twitter"
+
+msgid "There are {0} new Tweets on your Twitter page"
+msgstr "Il y a {0} nouveaux Tweets sur votre page Twitter"
+
msgid "You don't have any new Tweets."
msgstr "Vos amis n'ont pas publié de Tweets"
+msgid "I couldn't find any new Tweets"
+msgstr "Je n'ai pas trouvé de nouveaux Tweets "
+
+msgid "There are no new Tweets available"
+msgstr "Il n'y a pas de nouveaux Tweets disponibles"
+
+msgid "No new Tweets detected"
+msgstr "Aucun nouveau Tweet détecté"
+
+msgid "I couldn't detect any new Tweets"
+msgstr "Je n'ai pas détecté de nouveaux Tweets"
+
msgid "You don't have any messages"
msgstr "Vous n'avez pas de nouveau messages"
+msgid "You have no private messages"
+msgstr "Vous n'avez pas de messages privés"
+
+msgid "I couldn't find any new messages"
+msgstr "Je n'ai pas trouvé de nouveaux messages"
+
+msgid "There are no new private messages"
+msgstr "Il n'y a pas de nouveaux messages privés"
+
+msgid "No private messages detected"
+msgstr "Aucun message privé détecté"
+
msgid "You don't have any replies"
msgstr "Vous n'avez pas de nouvelles réponses"
+msgid "You have no new replies"
+msgstr "Vous n'avez pas de réponses"
+
+msgid "There are no replies"
+msgstr "Il n'y a pas de réponses"
+
+msgid "I could not find any replies"
+msgstr "Je n'ai pas trouvé de réponses"
+
+msgid "There are no new replies detected"
+msgstr "Aucune nouvelles réponses détectées"
+
msgid "Your new Tweet was not set, please, try again later"
msgstr "Votre Tweet n'a pas été publié, s'il vous plait, essayez à nouveau."
Modified: software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/resources/nl.po
===================================================================
--- software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/resources/nl.po 2009-10-19 09:17:32 UTC (rev 5726)
+++ software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/resources/nl.po 2009-10-19 10:42:10 UTC (rev 5727)
@@ -43,18 +43,78 @@
msgid "There is a new Tweet available."
msgstr "Er is een nieuwe Tweet beschikbaar."
+msgid "You have a new Tweet"
+msgstr "You have a new Tweet"
+
+msgid "You have a new Tweet on your Twitter"
+msgstr "You have a new Tweet on your Twitter"
+
+msgid "I found a new Tweet on your Twitter account"
+msgstr "I found a new Tweet on your Twitter account"
+
+msgid "There is a new Tweet on your Twitter page"
+msgstr "There is a new Tweet on your Twitter page"
+
msgid "You have {0} new Tweets."
msgstr "Je hebt {0} nieuwe Tweets."
+msgid "There are {0} new Tweets available"
+msgstr "There are {0} new Tweets available"
+
+msgid "You have {0} new Tweets on your Twitter"
+msgstr "You have {0} new Tweets on your Twitter"
+
+msgid "I found {0} new Tweets on your Twitter account"
+msgstr "I found {0} new Tweets on your Twitter account"
+
+msgid "There are {0} new Tweets on your Twitter page"
+msgstr "There are {0} new Tweets on your Twitter page"
+
msgid "You don't have any new Tweets."
msgstr "Je hebt geen nieuwe Tweets."
+msgid "I couldn't find any new Tweets"
+msgstr "I couldn't find any new Tweets"
+
+msgid "There are no new Tweets available"
+msgstr "There are no new Tweets available"
+
+msgid "No new Tweets detected"
+msgstr "No new Tweets detected"
+
+msgid "I couldn't detect any new Tweets"
+msgstr "I couldn't detect any new Tweets"
+
msgid "You don't have any messages"
msgstr "Je hebt geen nieuwe berichten."
+msgid "You have no private messages"
+msgstr "You have no private messages"
+
+msgid "I couldn't find any new messages"
+msgstr "I couldn't find any new messages"
+
+msgid "There are no new private messages"
+msgstr "There are no new private messages"
+
+msgid "No private messages detected"
+msgstr "No private messages detected"
+
msgid "You don't have any replies"
msgstr "Je hebt geen nieuwe antwoorden."
+msgid "You have no new replies"
+msgstr "You have no new replies"
+
+msgid "There are no replies"
+msgstr "There are no replies"
+
+msgid "I could not find any replies"
+msgstr "I could not find any replies"
+
+msgid "There are no new replies detected"
+msgstr "There are no new replies detected"
+
msgid "Your new Tweet was not set, please, try again later"
msgstr "Je nieuwe Tweet werd niet geplaatst, probeer later opnieuw."
Modified: software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/resources/plugin.pot
===================================================================
--- software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/resources/plugin.pot 2009-10-19 09:17:32 UTC (rev 5726)
+++ software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/resources/plugin.pot 2009-10-19 10:42:10 UTC (rev 5727)
@@ -43,18 +43,78 @@
msgid "There is a new Tweet available."
msgstr ""
+msgid "You have a new Tweet"
+msgstr ""
+
+msgid "You have a new Tweet on your Twitter"
+msgstr ""
+
+msgid "I found a new Tweet on your Twitter account"
+msgstr ""
+
+msgid "There is a new Tweet on your Twitter page"
+msgstr ""
+
msgid "You have {0} new Tweets."
msgstr ""
+msgid "There are {0} new Tweets available"
+msgstr ""
+
+msgid "You have {0} new Tweets on your Twitter"
+msgstr ""
+
+msgid "I found {0} new Tweets on your Twitter account"
+msgstr ""
+
+msgid "There are {0} new Tweets on your Twitter page"
+msgstr ""
+
msgid "You don't have any new Tweets."
msgstr ""
+msgid "I couldn't find any new Tweets"
+msgstr ""
+
+msgid "There are no new Tweets available"
+msgstr ""
+
+msgid "No new Tweets detected"
+msgstr ""
+
+msgid "I couldn't detect any new Tweets"
+msgstr ""
+
msgid "You don't have any messages"
msgstr ""
+msgid "You have no private messages"
+msgstr ""
+
+msgid "I couldn't find any new messages"
+msgstr ""
+
+msgid "There are no new private messages"
+msgstr ""
+
+msgid "No private messages detected"
+msgstr ""
+
msgid "You don't have any replies"
msgstr ""
+msgid "You have no new replies"
+msgstr ""
+
+msgid "There are no replies"
+msgstr ""
+
+msgid "I could not find any replies"
+msgstr ""
+
+msgid "There are no new replies detected"
+msgstr ""
+
msgid "Your new Tweet was not set, please, try again later"
msgstr ""
Modified: software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/TwitterPlugin.java
===================================================================
--- software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/TwitterPlugin.java 2009-10-19 09:17:32 UTC (rev 5726)
+++ software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/TwitterPlugin.java 2009-10-19 10:42:10 UTC (rev 5727)
@@ -23,6 +23,7 @@
import java.util.Collections;
import java.util.List;
import java.util.Vector;
+import java.util.Random;
import com.kysoh.tuxdroid.plugin.framework.plugin.SimplePlugin;
import winterwell.jtwitter.Twitter;
@@ -43,6 +44,46 @@
private boolean throwed = false;
+ String[] newSingleTweetSentences = {
+ "There is a new Tweet available.",
+ "You have a new Tweet",
+ "You have a new Tweet on your Twitter",
+ "I found a new Tweet on your Twitter account",
+ "There is a new Tweet on your Twitter page"
+ };
+
+ String[] newMultipleTweetSentences = {
+ "You have {0} new Tweets.",
+ "There are {0} new Tweets available",
+ "You have {0} new Tweets on your Twitter",
+ "I found {0} new Tweets on your Twitter account",
+ "There are {0} new Tweets on your Twitter page"
+ };
+
+ String[] noNewTweetSentences = {
+ "You don't have any new Tweets.",
+ "I couldn't find any new Tweets",
+ "There are no new Tweets available",
+ "No new Tweets detected",
+ "I couldn't detect any new Tweets"
+ };
+
+ String[] noNewMessageSentences = {
+ "You don't have any messages",
+ "You have no private messages",
+ "I couldn't find any new messages",
+ "There are no new private messages",
+ "No private messages detected"
+ };
+
+ String[] noNewReplySentences = {
+ "You don't have any replies",
+ "You have no new replies",
+ "There are no replies",
+ "I could not find any replies",
+ "There are no new replies detected"
+ };
+
/***
This function set the new user status.
Préconditions :
@@ -258,18 +299,18 @@
if ( updateCount == 1 )
{
throwRes();
- throwMessage("There is a new Tweet available.");
+ throwMessage(pickSentence(newSingleTweetSentences));
}
else if ( updateCount > 1 )
{
throwRes();
- throwMessage("You have {0} new Tweets.", String.valueOf(updateCount));
+ throwMessage(pickSentence(newMultipleTweetSentences), String.valueOf(updateCount));
}
else
{
if ( ! this.getCommand().equalsIgnoreCase("check") )
{
- throwMessage("You don't have any new Tweets.");
+ throwMessage(pickSentence(noNewTweetSentences));
}
}
}
@@ -296,7 +337,7 @@
{
if ( ! this.getCommand().equalsIgnoreCase("check") )
{
- throwMessage("You don't have any messages");
+ throwMessage(pickSentence(noNewMessageSentences));
}
}
@@ -315,7 +356,7 @@
{
if ( ! this.getCommand().equalsIgnoreCase("check") )
{
- throwMessage("You don't have any replies");
+ throwMessage(pickSentence(noNewReplySentences));
}
}
@@ -349,6 +390,13 @@
}
+ /**
+ * This function return a sentences from a defined list
+ */
+ private String pickSentence(String[] list) {
+ Random rand = new Random();
+ return list[rand.nextInt(list.length)];
+ }
/***
* Sort a typ string list.
|
|
From: ks156 <c2m...@c2...> - 2009-10-19 09:17:44
|
Author: ks156
Date: 2009-10-19 11:17:32 +0200 (Mon, 19 Oct 2009)
New Revision: 5726
Modified:
software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/TwitterPlugin.java
Log:
* Don't know what happens with this file, but it wasn't indented properly.
Modified: software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/TwitterPlugin.java
===================================================================
--- software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/TwitterPlugin.java 2009-10-19 09:16:09 UTC (rev 5725)
+++ software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/TwitterPlugin.java 2009-10-19 09:17:32 UTC (rev 5726)
@@ -34,506 +34,506 @@
public class TwitterPlugin extends SimplePlugin<Configuration>{
- private static TwitterDatasStruct savedStruct;
- private static byte REPLY = 0;
- private static byte MESSAGE = 1;
-
- private List<String> messagesList = new ArrayList<String>();
- private List<String> repliesList = new ArrayList<String>();
-
- private boolean throwed = false;
-
- /***
- This function set the new user status.
- Préconditions :
- - To be in run mode
- - Activate targeted option.
- ***/
- private boolean setUserStatus(Twitter twitter)
- {
- if(this.getCommand().equalsIgnoreCase("run"))
- {
- //Set user status
- if(this.configuration().getUpdateStatus())
- {
- try
- {
- twitter.updateStatus(this.configuration().getMyStatus());
-
- if ( twitter.getStatus().getText().equalsIgnoreCase(this.configuration().getMyStatus()) )
- {
- return true;
- }
- else
- {
- return false;
- }
- }
- catch(TwitterException notConnected)
- {
- if (!this.getCommand().equalsIgnoreCase("check"))
- {
- throwMessage("You do not seem to be connected. Please, verify you username and password, then try again.");
- }
- this.quitGadget();
- }
- }
- }
-
- return false;
- }
-
-
- /***
- * Get all new friend statuses.
- * Automatic option.
- ***/
- private int getNewFriendStatusesCount(Twitter twitter)
- {
- int statusesCount = 0;
- List<User> friend = twitter.getFriends();
-
- for( int i = 0 ; i < friend.size() ; i++ )
- {
- try
- {
- Status status = friend.get(i).getStatus();
-
- String statusText = status.getText();
- String username = status.getUser().getName();
-
-
- //if a new status was set for this user text.
- boolean said = savedStruct.isRegistered(TwitterDatasStruct.FRIENDS_STATUSES, username, statusText);
-
- if((statusText != "null") && !said)
- {
- String stat = statusText.replace("&", "");
- stat = this.urlFilter(stat);
-
- if (! isReplyToOtherUser(stat))
- {
- statusesCount += 1;
- //Saving last entry.
- savedStruct.addFriendStatus(username, statusText);
- }
- }
- }
- catch(NullPointerException statusNotExists)
- {
- //Simply pass in case of exception, friend status change will not be counted.
- ;
- }
-
- }
-
- return statusesCount;
- }
-
-
-
- /***
- * This function return how many messages user has into his private Twitter mailbox.
- * @return an integer that represent user privates messages count.
- ***/
- private int getPrivateMessagesCount(Twitter twitter)
- {
- List<Message> messages = twitter.getDirectMessages();
- if(messages.size() > 0)
- {
- try
- {
- //then give messages.
- for(Message message : messages)
- {
- String username = message.getSender().getName();
-
- boolean said = savedStruct.isRegistered(TwitterDatasStruct.MESSAGES, username, message.getText());
-
- if((message.getText() != "null") && !said)
- {
- messagesList.add(username);
- savedStruct.addMessage(username, message.getText());
- }
- }
- }
- catch(NullPointerException pointerError)
- {
- ;
- }
- }
-
- return messagesList.size();
- }
-
-
-
- /***
- * This function return how many messages user has into his public Twitter mailbox.
- * @return an integer that represent user public messages count.
- ***/
- private int getPublicMessagesCount(Twitter twitter)
- {
- List<Message> replies = twitter.getReplies();
+ private static TwitterDatasStruct savedStruct;
+ private static byte REPLY = 0;
+ private static byte MESSAGE = 1;
- if(replies.size() > 0)
- {
- try
- {
- for(Message reply : replies)
- {
- String username = reply.getSender().getName();
-
- boolean said = savedStruct.isRegistered(TwitterDatasStruct.REPLIES, username, reply.getText());
-
- if((reply.getText() != "null") && !said)
- {
- repliesList.add(username);
- savedStruct.addReply(username, reply.getText());
- }
-
- }
- }
- catch(NullPointerException pointerError)
- {
- ;
- }
- }
- return repliesList.size();
- }
-
-
- private void throwRes()
- {
- if ( ( !throwed ) && ( this.getCommand().equalsIgnoreCase("check") ))
- {
- this.throwed = true;
- this.throwResult(true);
- this.throwMessage("Twitter");
- }
- }
-
-
- @Override
- protected void start() throws Throwable
- {
-
- if(( this.configuration().getPassword() == null) || (this.configuration().getUsername() == null))
- {
- if( ! this.getCommand().equalsIgnoreCase("check"))
- {
- this.throwMessage("Sorry, there was an error when connecting to Twitter. Please check your Twitter configuration.");
- }
- this.quitGadget();
- }
-
- //Creating / getting sav context.
- savedStruct = new TwitterDatasStruct(this.configuration().getUsername());
-
- boolean secondCycle = ( this.getCommand().equalsIgnoreCase("check") && savedStruct.isFirstCycle() ) ? false : true;
-
- /***
- * Getting connected to twitter and setting update source ( here TuxDroid ).
- ***/
- Twitter twitter = null;
- twitter = new Twitter(this.configuration().getUsername(), this.configuration().getPassword());
- twitter.setSource("tuxdroid");
-
- //Getting Twitter informations.
- try
- {
- if (! this.configuration().getUpdateStatus())
- {
- /**
- * Getting new friend statuses count if option is enabled.
- */
- if(this.configuration().getCheckFriends())
- {
- int updateCount = getNewFriendStatusesCount(twitter);
-
- //First check insilent mode.
- if(this.getCommand().equalsIgnoreCase("run") || secondCycle)
- {
-
- if ( updateCount == 1 )
- {
- throwRes();
- throwMessage("There is a new Tweet available.");
- }
- else if ( updateCount > 1 )
- {
- throwRes();
- throwMessage("You have {0} new Tweets.", String.valueOf(updateCount));
- }
- else
- {
- if ( ! this.getCommand().equalsIgnoreCase("check") )
- {
- throwMessage("You don't have any new Tweets.");
- }
- }
- }
- }
-
-
- /**
- * Getting, sorting new user private / public ( replies ) messages.
- * if option is enabled.
- */
- if (this.configuration().getCheckMessages())
- {
- if ( getPrivateMessagesCount(twitter) > 0 )
- {
+ private List<String> messagesList = new ArrayList<String>();
+ private List<String> repliesList = new ArrayList<String>();
+
+ private boolean throwed = false;
+
+ /***
+ This function set the new user status.
+ Préconditions :
+ - To be in run mode
+ - Activate targeted option.
+ ***/
+ private boolean setUserStatus(Twitter twitter)
+ {
+ if(this.getCommand().equalsIgnoreCase("run"))
+ {
+ //Set user status
+ if(this.configuration().getUpdateStatus())
+ {
+ try
+ {
+ twitter.updateStatus(this.configuration().getMyStatus());
+
+ if ( twitter.getStatus().getText().equalsIgnoreCase(this.configuration().getMyStatus()) )
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+ catch(TwitterException notConnected)
+ {
+ if (!this.getCommand().equalsIgnoreCase("check"))
+ {
+ throwMessage("You do not seem to be connected. Please, verify you username and password, then try again.");
+ }
+ this.quitGadget();
+ }
+ }
+ }
+
+ return false;
+ }
+
+
+ /***
+ * Get all new friend statuses.
+ * Automatic option.
+ ***/
+ private int getNewFriendStatusesCount(Twitter twitter)
+ {
+ int statusesCount = 0;
+ List<User> friend = twitter.getFriends();
+
+ for( int i = 0 ; i < friend.size() ; i++ )
+ {
+ try
+ {
+ Status status = friend.get(i).getStatus();
+
+ String statusText = status.getText();
+ String username = status.getUser().getName();
+
+
+ //if a new status was set for this user text.
+ boolean said = savedStruct.isRegistered(TwitterDatasStruct.FRIENDS_STATUSES, username, statusText);
+
+ if((statusText != "null") && !said)
+ {
+ String stat = statusText.replace("&", "");
+ stat = this.urlFilter(stat);
+
+ if (! isReplyToOtherUser(stat))
+ {
+ statusesCount += 1;
+ //Saving last entry.
+ savedStruct.addFriendStatus(username, statusText);
+ }
+ }
+ }
+ catch(NullPointerException statusNotExists)
+ {
+ //Simply pass in case of exception, friend status change will not be counted.
+ ;
+ }
+
+ }
+
+ return statusesCount;
+ }
+
+
+
+ /***
+ * This function return how many messages user has into his private Twitter mailbox.
+ * @return an integer that represent user privates messages count.
+ ***/
+ private int getPrivateMessagesCount(Twitter twitter)
+ {
+ List<Message> messages = twitter.getDirectMessages();
+ if(messages.size() > 0)
+ {
+ try
+ {
+ //then give messages.
+ for(Message message : messages)
+ {
+ String username = message.getSender().getName();
+
+ boolean said = savedStruct.isRegistered(TwitterDatasStruct.MESSAGES, username, message.getText());
+
+ if((message.getText() != "null") && !said)
+ {
+ messagesList.add(username);
+ savedStruct.addMessage(username, message.getText());
+ }
+ }
+ }
+ catch(NullPointerException pointerError)
+ {
+ ;
+ }
+ }
+
+ return messagesList.size();
+ }
+
+
+
+ /***
+ * This function return how many messages user has into his public Twitter mailbox.
+ * @return an integer that represent user public messages count.
+ ***/
+ private int getPublicMessagesCount(Twitter twitter)
+ {
+ List<Message> replies = twitter.getReplies();
+
+ if(replies.size() > 0)
+ {
+ try
+ {
+ for(Message reply : replies)
+ {
+ String username = reply.getSender().getName();
+
+ boolean said = savedStruct.isRegistered(TwitterDatasStruct.REPLIES, username, reply.getText());
+
+ if((reply.getText() != "null") && !said)
+ {
+ repliesList.add(username);
+ savedStruct.addReply(username, reply.getText());
+ }
+
+ }
+ }
+ catch(NullPointerException pointerError)
+ {
+ ;
+ }
+ }
+ return repliesList.size();
+ }
+
+
+ private void throwRes()
+ {
+ if ( ( !throwed ) && ( this.getCommand().equalsIgnoreCase("check") ))
+ {
+ this.throwed = true;
+ this.throwResult(true);
+ this.throwMessage("Twitter");
+ }
+ }
+
+
+ @Override
+ protected void start() throws Throwable
+ {
+
+ if(( this.configuration().getPassword() == null) || (this.configuration().getUsername() == null))
+ {
+ if( ! this.getCommand().equalsIgnoreCase("check"))
+ {
+ this.throwMessage("Sorry, there was an error when connecting to Twitter. Please check your Twitter configuration.");
+ }
+ this.quitGadget();
+ }
+
+ //Creating / getting sav context.
+ savedStruct = new TwitterDatasStruct(this.configuration().getUsername());
+
+ boolean secondCycle = ( this.getCommand().equalsIgnoreCase("check") && savedStruct.isFirstCycle() ) ? false : true;
+
+ /***
+ * Getting connected to twitter and setting update source ( here TuxDroid ).
+ ***/
+ Twitter twitter = null;
+ twitter = new Twitter(this.configuration().getUsername(), this.configuration().getPassword());
+ twitter.setSource("tuxdroid");
+
+ //Getting Twitter informations.
+ try
+ {
+ if (! this.configuration().getUpdateStatus())
+ {
+ /**
+ * Getting new friend statuses count if option is enabled.
+ */
+ if(this.configuration().getCheckFriends())
+ {
+ int updateCount = getNewFriendStatusesCount(twitter);
+
//First check insilent mode.
- if(this.getCommand().equalsIgnoreCase("run") || secondCycle)
- {
- this.sort(this.messagesList);
- //Counting by name and throwing messages.
- this.getByNames(this.messagesList, MESSAGE);
- }
- }
- else
- {
- if ( ! this.getCommand().equalsIgnoreCase("check") )
- {
- throwMessage("You don't have any messages");
- }
- }
-
- //Getting and sorting new user replies.
- if ( getPublicMessagesCount(twitter) > 0 )
- {
- //First check insilent mode.
- if(this.getCommand().equalsIgnoreCase("run") || secondCycle)
- {
- this.sort(this.repliesList);
- //Counting by name and throwing messages.
- this.getByNames(this.repliesList, REPLY);
- }
- }
- else
- {
- if ( ! this.getCommand().equalsIgnoreCase("check") )
- {
- throwMessage("You don't have any replies");
- }
- }
-
- //Registering couted messages.
- savedStruct.registerStruct();
-
- }
- }
- else
- {
- //Updating user status.
- if( ! this.setUserStatus(twitter) )
- {
- this.throwMessage("Your new Tweet was not set, please, try again later");
- }
- else
- {
- this.throwMessage("Your Tweet was added");
- }
- }
- }
- catch(TwitterException badRequest)
- {
- if ( ! this.getCommand().equalsIgnoreCase("check") )
- {
- throwMessage("Twitter is busy for now, please, try again later.");
- }
-
- this.quitGadget();
- }
-
- }
-
-
- /***
- * Sort a typ string list.
- * @param list
- */
- private void sort(List<String> list)
- {
- Collections.sort(list);
- }
-
-
- /***
- * Throw messages by user names.
- * @param list
- */
- private void getByNames(List<String> list, byte type)
- {
- Vector<String> dtUsers = new Vector<String>();
- Vector<Integer> dtCount = new Vector<Integer>();
- int count = 1;
-
- //Handling no replies / no messages.
- if (list.size() == 0)
- {
- return;
- }
-
- //Counting by names.
- for( int i = 0 ; i != list.size() ; i ++)
- {
-
- if (dtUsers.contains(list.get(i)))
- {
- dtCount.set(dtUsers.indexOf(list.get(i)), dtCount.get(dtUsers.indexOf(list.get(i))) + 1);
- }
- else
- {
- dtUsers.add(list.get(i));
- dtCount.add(1);
- }
-
- }
-
- if (dtUsers.size() > 0)
- {
- throwRes();
- }
-
- for(String it : dtUsers)
- {
- count = dtCount.get(dtUsers.indexOf(it));
-
- if ( type == REPLY )
- {
- if ( count == 1 )
- {
- throwMessage("One reply from {0}", it);
- }
- else
- {
- throwMessage ("{0} replies from {1}", count, it);
- }
- }
- else
- {
- if ( count == 1 )
- {
- throwMessage("One message from {0}", it);
- }
- else
- {
- throwMessage("{0} messages from {1}", count, it);
- }
- }
- }
- }
+ if(this.getCommand().equalsIgnoreCase("run") || secondCycle)
+ {
+ if ( updateCount == 1 )
+ {
+ throwRes();
+ throwMessage("There is a new Tweet available.");
+ }
+ else if ( updateCount > 1 )
+ {
+ throwRes();
+ throwMessage("You have {0} new Tweets.", String.valueOf(updateCount));
+ }
+ else
+ {
+ if ( ! this.getCommand().equalsIgnoreCase("check") )
+ {
+ throwMessage("You don't have any new Tweets.");
+ }
+ }
+ }
+ }
- /**
- * Return true if the text value indicates that the message was sent from a user
- * to an other user , but not the TuxDroid owner.
- * @param value
- * @return
- */
- private boolean isReplyToOtherUser(String value)
- {
- if(value.charAt(0) == '@')
- {
- return true;
- }
- return false;
- }
+ /**
+ * Getting, sorting new user private / public ( replies ) messages.
+ * if option is enabled.
+ */
+ if (this.configuration().getCheckMessages())
+ {
+ if ( getPrivateMessagesCount(twitter) > 0 )
+ {
+ //First check insilent mode.
+ if(this.getCommand().equalsIgnoreCase("run") || secondCycle)
+ {
+ this.sort(this.messagesList);
+ //Counting by name and throwing messages.
+ this.getByNames(this.messagesList, MESSAGE);
+ }
+ }
+ else
+ {
+ if ( ! this.getCommand().equalsIgnoreCase("check") )
+ {
+ throwMessage("You don't have any messages");
+ }
+ }
- /***
- * Remove Url's from text.
- * @param string
- * @return
- ***/
- public String urlFilter(String string)
- {
- while(string.contains("http://"))
- {
- try
- {
- int start = string.indexOf("http://");
- int stop = string.indexOf(" ", start);
-
- if( stop == -1 )
- {
- stop = string.length() ;
- }
-
- String url = string.substring(start, stop);
- string = string.replace(url, ".");
- }
- catch(StringIndexOutOfBoundsException e)
- {
- return string;
- }
- catch(NullPointerException no)
- {
- return string;
- }
- }
-
- while(string.contains("ftp://"))
- {
- try
- {
- int start = string.indexOf("http://");
- int stop = string.indexOf(" ", start);
-
- if( stop == -1 )
- {
- stop = string.length() ;
- }
-
- String url = string.substring(start, stop);
- string = string.replace(url, ".");
- }
- catch(StringIndexOutOfBoundsException e)
- {
- return string;
- }
- catch(NullPointerException no)
- {
- return string;
- }
- }
-
- return string;
- }
-
-
- /**
- * Quit the gadget.
- */
- public void quitGadget()
- {
- if(this.getCommand().equalsIgnoreCase("check") && this.throwed)
- {
- this.throwResult(false);
- }
- System.exit(0);
- }
-
-
- public static void main(String[] args)
- {
- new TwitterPlugin().boot(args, new Configuration());
- }
+ //Getting and sorting new user replies.
+ if ( getPublicMessagesCount(twitter) > 0 )
+ {
+ //First check insilent mode.
+ if(this.getCommand().equalsIgnoreCase("run") || secondCycle)
+ {
+ this.sort(this.repliesList);
+ //Counting by name and throwing messages.
+ this.getByNames(this.repliesList, REPLY);
+ }
+ }
+ else
+ {
+ if ( ! this.getCommand().equalsIgnoreCase("check") )
+ {
+ throwMessage("You don't have any replies");
+ }
+ }
+ //Registering couted messages.
+ savedStruct.registerStruct();
- @Override
- protected void onPluginEvent(String arg0, String[] arg1) throws Throwable
- {
- ;
- }
+ }
+ }
+ else
+ {
+ //Updating user status.
+ if( ! this.setUserStatus(twitter) )
+ {
+ this.throwMessage("Your new Tweet was not set, please, try again later");
+ }
+ else
+ {
+ this.throwMessage("Your Tweet was added");
+ }
+ }
+ }
+ catch(TwitterException badRequest)
+ {
+ if ( ! this.getCommand().equalsIgnoreCase("check") )
+ {
+ throwMessage("Twitter is busy for now, please, try again later.");
+ }
+ this.quitGadget();
+ }
- @Override
- protected void onPluginStop() throws Throwable
- {
- ;
- }
+ }
+
+ /***
+ * Sort a typ string list.
+ * @param list
+ */
+ private void sort(List<String> list)
+ {
+ Collections.sort(list);
+ }
+
+
+ /***
+ * Throw messages by user names.
+ * @param list
+ */
+ private void getByNames(List<String> list, byte type)
+ {
+ Vector<String> dtUsers = new Vector<String>();
+ Vector<Integer> dtCount = new Vector<Integer>();
+ int count = 1;
+
+ //Handling no replies / no messages.
+ if (list.size() == 0)
+ {
+ return;
+ }
+
+ //Counting by names.
+ for( int i = 0 ; i != list.size() ; i ++)
+ {
+
+ if (dtUsers.contains(list.get(i)))
+ {
+ dtCount.set(dtUsers.indexOf(list.get(i)), dtCount.get(dtUsers.indexOf(list.get(i))) + 1);
+ }
+ else
+ {
+ dtUsers.add(list.get(i));
+ dtCount.add(1);
+ }
+
+ }
+
+ if (dtUsers.size() > 0)
+ {
+ throwRes();
+ }
+
+ for(String it : dtUsers)
+ {
+ count = dtCount.get(dtUsers.indexOf(it));
+
+ if ( type == REPLY )
+ {
+ if ( count == 1 )
+ {
+ throwMessage("One reply from {0}", it);
+ }
+ else
+ {
+ throwMessage ("{0} replies from {1}", count, it);
+ }
+ }
+ else
+ {
+ if ( count == 1 )
+ {
+ throwMessage("One message from {0}", it);
+ }
+ else
+ {
+ throwMessage("{0} messages from {1}", count, it);
+ }
+ }
+ }
+ }
+
+
+ /**
+ * Return true if the text value indicates that the message was sent from a user
+ * to an other user , but not the TuxDroid owner.
+ * @param value
+ * @return
+ */
+ private boolean isReplyToOtherUser(String value)
+ {
+ if(value.charAt(0) == '@')
+ {
+ return true;
+ }
+ return false;
+ }
+
+
+ /***
+ * Remove Url's from text.
+ * @param string
+ * @return
+ ***/
+ public String urlFilter(String string)
+ {
+ while(string.contains("http://"))
+ {
+ try
+ {
+ int start = string.indexOf("http://");
+ int stop = string.indexOf(" ", start);
+
+ if( stop == -1 )
+ {
+ stop = string.length() ;
+ }
+
+ String url = string.substring(start, stop);
+ string = string.replace(url, ".");
+ }
+ catch(StringIndexOutOfBoundsException e)
+ {
+ return string;
+ }
+ catch(NullPointerException no)
+ {
+ return string;
+ }
+ }
+
+ while(string.contains("ftp://"))
+ {
+ try
+ {
+ int start = string.indexOf("http://");
+ int stop = string.indexOf(" ", start);
+
+ if( stop == -1 )
+ {
+ stop = string.length() ;
+ }
+
+ String url = string.substring(start, stop);
+ string = string.replace(url, ".");
+ }
+ catch(StringIndexOutOfBoundsException e)
+ {
+ return string;
+ }
+ catch(NullPointerException no)
+ {
+ return string;
+ }
+ }
+
+ return string;
+ }
+
+
+ /**
+ * Quit the gadget.
+ */
+ public void quitGadget()
+ {
+ if(this.getCommand().equalsIgnoreCase("check") && this.throwed)
+ {
+ this.throwResult(false);
+ }
+ System.exit(0);
+ }
+
+
+ public static void main(String[] args)
+ {
+ new TwitterPlugin().boot(args, new Configuration());
+ }
+
+
+ @Override
+ protected void onPluginEvent(String arg0, String[] arg1) throws Throwable
+ {
+ ;
+ }
+
+
+ @Override
+ protected void onPluginStop() throws Throwable
+ {
+ ;
+ }
+
}
|
|
From: jerome <c2m...@c2...> - 2009-10-19 09:16:21
|
Author: jerome
Date: 2009-10-19 11:16:09 +0200 (Mon, 19 Oct 2009)
New Revision: 5725
Modified:
software_suite_v3/software/plugin/plugin-facebook/branches/october_release/resources/plugin.xml
software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/com/kysoh/plugins/facebook/FacebookFunctions.java
software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/com/kysoh/plugins/facebook/FacebookPlugin.java
software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/com/kysoh/plugins/facebook/configuration/PluginFacebookConfiguration.java
Log:
* Removed 'share' and 'pokes' options.
Modified: software_suite_v3/software/plugin/plugin-facebook/branches/october_release/resources/plugin.xml
===================================================================
--- software_suite_v3/software/plugin/plugin-facebook/branches/october_release/resources/plugin.xml 2009-10-19 09:12:03 UTC (rev 5724)
+++ software_suite_v3/software/plugin/plugin-facebook/branches/october_release/resources/plugin.xml 2009-10-19 09:16:09 UTC (rev 5725)
@@ -51,12 +51,6 @@
description="Check event invites"
type="boolean"
defaultValue="true" />
- <parameter
- category="Gadget parameters"
- name="showPokes"
- description="Check pokes"
- type="boolean"
- defaultValue="true" />
</parameters>
<commands>
<command
Modified: software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/com/kysoh/plugins/facebook/FacebookFunctions.java
===================================================================
--- software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/com/kysoh/plugins/facebook/FacebookFunctions.java 2009-10-19 09:12:03 UTC (rev 5724)
+++ software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/com/kysoh/plugins/facebook/FacebookFunctions.java 2009-10-19 09:16:09 UTC (rev 5725)
@@ -30,7 +30,6 @@
import com.google.code.facebookapi.FacebookException;
import com.google.code.facebookapi.ProfileField;
-import com.google.code.facebookapi.schema.FriendsGetResponse;
import com.google.code.facebookapi.schema.User;
import com.google.code.facebookapi.schema.UsersGetInfoResponse;
@@ -52,42 +51,6 @@
/**
- * Return the user friend list as Vector<String>.
- * @return
- */
- public Vector<String> getFriends()
- {
- Vector<String> friendsList = new Vector<String>();
-
- try
- {
- // Get friends list
- connection.getClient().friends_get();
- FriendsGetResponse response = (FriendsGetResponse) connection.getClient().getResponsePOJO();
- List<Long> friends = response.getUid();
-
- // Go fetch the information for the user list of user ids
- connection.getClient().users_getInfo(friends, EnumSet.of(ProfileField.NAME));
-
- UsersGetInfoResponse userResponse = (UsersGetInfoResponse) connection.getClient().getResponsePOJO();
-
- // Print out the user information
- List<User> users = userResponse.getUser();
- for (User user : users)
- {
- friendsList.add(user.getName());
- }
- }
- catch (FacebookException e)
- {
- return null;
- }
-
- return friendsList;
- }
-
-
- /**
* Gets all notifications.
*/
private Hashtable<String, Vector<String>> getUserNotification()
@@ -126,66 +89,6 @@
}
/**
- * Getting pokes notifications.
- */
- if(notifs.contains("<pokes"))
- {
- String pokesString;
-
- try
- {
- pokesString = notifs.substring(notifs.indexOf("<pokes"), notifs.indexOf("</pokes>"));
- }
- catch(IndexOutOfBoundsException indexError)
- {
- pokesString = notifs.substring(notifs.indexOf("<pokes"), notifs.indexOf("/>"));
- }
-
- Vector<String> pkDatas = new Vector<String>();
-
- String unreaded = pokesString.substring(
- pokesString.indexOf("<unread>") + "<unread>".length(),
- pokesString.indexOf("</unread>"));
-
- pkDatas.add(unreaded);
-
- if(Integer.valueOf(unreaded).intValue() > 0 )
- {
- notifications.put("pokes", pkDatas);
- }
- }
-
- /**
- * Getting shares notifications.
- */
- if(notifs.contains("<shares"))
- {
- String sharesString;
-
- try
- {
- sharesString = notifs.substring(notifs.indexOf("<shares"), notifs.indexOf("</shares>"));
- }
- catch(IndexOutOfBoundsException indexError)
- {
- sharesString = notifs.substring(notifs.indexOf("<shares"), notifs.indexOf("/>"));
- }
-
- Vector<String> shDatas = new Vector<String>();
-
- String unreaded = sharesString.substring(
- sharesString.indexOf("<unread>") + "<unread>".length(),
- sharesString.indexOf("</unread>"));
-
- shDatas.add(unreaded);
-
- if(Integer.valueOf(unreaded).intValue() > 0)
- {
- notifications.put("shares", shDatas);
- }
- }
-
- /**
* Get the friend_requests notifications.
*/
if(notifs.contains("<friend_requests"))
@@ -400,23 +303,6 @@
/**
- * Return how many pokes user has.
- * @return
- */
- public Integer getPokesCount()
- {
- if(this.notifications.containsKey("pokes"))
- {
- return Integer.valueOf(this.notifications.get("pokes").get(0));
- }
- else
- {
- return 0;
- }
- }
-
-
- /**
* Return the number of friend requests.
* @return
*/
Modified: software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/com/kysoh/plugins/facebook/FacebookPlugin.java
===================================================================
--- software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/com/kysoh/plugins/facebook/FacebookPlugin.java 2009-10-19 09:12:03 UTC (rev 5724)
+++ software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/com/kysoh/plugins/facebook/FacebookPlugin.java 2009-10-19 09:16:09 UTC (rev 5725)
@@ -171,28 +171,6 @@
}
}
- if(this.configuration().getShowPokes())
- {
- if(functions.getPokesCount().intValue() > 0)
- {
- news = true;
- if(this.check && (!throwNotif))
- {
- throwNotif = true;
- this.throwResult(true);
- }
-
- if(functions.getPokesCount().intValue() == 1)
- {
- throwMessage("You have one poke");
- }
- else
- {
- throwMessage("You have {0} pokes", functions.getPokesCount().intValue());
- }
- }
- }
-
if((!throwNotif) && this.check )
{
this.throwResult(false);
Modified: software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/com/kysoh/plugins/facebook/configuration/PluginFacebookConfiguration.java
===================================================================
--- software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/com/kysoh/plugins/facebook/configuration/PluginFacebookConfiguration.java 2009-10-19 09:12:03 UTC (rev 5724)
+++ software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/com/kysoh/plugins/facebook/configuration/PluginFacebookConfiguration.java 2009-10-19 09:16:09 UTC (rev 5725)
@@ -32,7 +32,6 @@
private boolean showFriendRequests = true;
private boolean showGroupsInvites = true;
private boolean showEventsInvites = true;
- private boolean showPokes = true;
private boolean notifyEmail = true;
/**
@@ -95,25 +94,6 @@
}
/**
- * Return true if user want to hear his pokes notifications.
- * @return
- */
- public boolean getShowPokes()
- {
- return this.showPokes;
- }
-
-
- /**
- * Set the show pokes parameter value.
- * @param aShowPokes
- */
- public void setShowPokes(boolean aShowPokes)
- {
- this.showPokes = aShowPokes;
- }
-
- /**
* Return true if user want to hear his events invites.
* @return
*/
|
|
From: jerome <c2m...@c2...> - 2009-10-19 09:12:13
|
Author: jerome
Date: 2009-10-19 11:12:03 +0200 (Mon, 19 Oct 2009)
New Revision: 5724
Added:
software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/com/kysoh/plugins/facebook/connection/FacebookSessionUtils.java
Modified:
software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/com/kysoh/plugins/facebook/FacebookConnection.java
Log:
* Added a new way to get connected to the user facebook account ( without binary ).
Modified: software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/com/kysoh/plugins/facebook/FacebookConnection.java
===================================================================
--- software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/com/kysoh/plugins/facebook/FacebookConnection.java 2009-10-19 09:10:50 UTC (rev 5723)
+++ software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/com/kysoh/plugins/facebook/FacebookConnection.java 2009-10-19 09:12:03 UTC (rev 5724)
@@ -22,27 +22,53 @@
package com.kysoh.plugins.facebook;
+import java.io.IOException;
+
+import com.google.code.facebookapi.FacebookException;
import com.google.code.facebookapi.FacebookJsonRestClient;
+import com.kysoh.plugins.facebook.connection.FacebookSessionUtils;
public class FacebookConnection {
- public static String api_key = "a9eb7b7e52df160fb1dfc437b0b487c8";
- public static String f_key = "0314c8569f89d0411e5a4823372ae27a";
private FacebookJsonRestClient client;
- /**
- * Class constructor.
- */
- public FacebookConnection()
- {
- //TODO facebook connection.
- }
-
-
public boolean Connect(String username, String password)
{
- return true;
+ FacebookSessionUtils.setMail(username);
+ FacebookSessionUtils.setPass(password);
+
+ //Facebook connection stuff.
+
+ try
+ {
+ String sessionKey = FacebookSessionUtils.getValidSessionID( true );
+
+ //Generate session secret, ready to pass to desktop app client
+ String sessionSecret = FacebookSessionUtils.lastClientUsed.getCacheSessionSecret();
+
+ //TODO remove this one.
+ System.out.println("Session secret: " + String.valueOf(sessionSecret));
+
+ client = new FacebookJsonRestClient(FacebookSessionUtils.api_key, sessionSecret, sessionKey);
+
+ if((sessionSecret == null) || (client == null))
+ {
+ return false;
+ }
+
+ return true;
+ }
+ catch (FacebookException e)
+ {
+ ;
+ }
+ catch (IOException e)
+ {
+ ;
+ }
+
+ return false;
}
@@ -52,7 +78,15 @@
*/
public Long getFacebookUserId()
{
- //TODO
+ try
+ {
+ return client.users_getLoggedInUser();
+ }
+ catch (FacebookException e)
+ {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
return null;
}
@@ -63,7 +97,6 @@
*/
public FacebookJsonRestClient getClient()
{
- //TODO
- return null;
+ return client;
}
}
Added: software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/com/kysoh/plugins/facebook/connection/FacebookSessionUtils.java
===================================================================
--- software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/com/kysoh/plugins/facebook/connection/FacebookSessionUtils.java (rev 0)
+++ software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/com/kysoh/plugins/facebook/connection/FacebookSessionUtils.java 2009-10-19 09:12:03 UTC (rev 5724)
@@ -0,0 +1,91 @@
+/* This file is part of "TuxDroid plugin Facebook".
+ * Copyright 2009, kysoh
+ * Author : Conan Jerome.
+ * eMail : jer...@ky...
+ * Site : http://www.kysoh.com/
+ *
+ * "TuxDroid plugin Facebook" is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * "TuxDroid plugin Facebook" is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with "TuxDroid plugin Facebook"; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package com.kysoh.plugins.facebook.connection;
+
+
+import java.io.IOException;
+
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.HttpState;
+import org.apache.commons.httpclient.NameValuePair;
+import org.apache.commons.httpclient.methods.GetMethod;
+import org.apache.commons.httpclient.methods.PostMethod;
+
+import com.google.code.facebookapi.FacebookException;
+import com.google.code.facebookapi.FacebookXmlRestClient;
+
+public class FacebookSessionUtils {
+
+ public static String api_key = "a9eb7b7e52df160fb1dfc437b0b487c8";
+ public static String s_key = "0314c8569f89d0411e5a4823372ae27a";
+
+ protected static String mail = "";
+ protected static String pass = "";
+
+ public static String lastTokenUsed;
+ public static FacebookXmlRestClient lastClientUsed;
+
+
+ public static void setMail(String eMail)
+ {
+ mail = eMail;
+ }
+
+
+ public static void setPass(String aPass)
+ {
+ pass = aPass;
+ }
+
+
+ public static String getValidSessionID( boolean generateSessionSecret)
+ throws IOException, FacebookException {
+
+
+ FacebookXmlRestClient client = new FacebookXmlRestClient( api_key, s_key );
+ String token = client.auth_createToken();
+
+ HttpClient http = new HttpClient();
+ http.setState(new HttpState());
+
+ final String LOGIN = "http://www.facebook.com/login.php";
+
+ GetMethod get = new GetMethod(LOGIN + "?api_key=" + api_key + "&v=1.0&auth_token=" + token );
+
+ http.executeMethod(get);
+
+ PostMethod post = new PostMethod(LOGIN);
+ post.addParameter(new NameValuePair("api_key", api_key));
+ post.addParameter(new NameValuePair("v", "1.0"));
+ post.addParameter(new NameValuePair("auth_token", token));
+ post.addParameter(new NameValuePair("email", mail));
+ post.addParameter(new NameValuePair("pass", pass));
+
+ http.executeMethod(post);
+
+ String sessionID = client.auth_getSession( token, generateSessionSecret );
+ lastTokenUsed = token;
+ lastClientUsed = client;
+ return sessionID;
+ }
+}
|
|
From: jerome <c2m...@c2...> - 2009-10-19 09:11:06
|
Author: jerome Date: 2009-10-19 11:10:50 +0200 (Mon, 19 Oct 2009) New Revision: 5723 Modified: software_suite_v3/software/plugin/plugin-facebook/branches/october_release/resources/plugin.xml Log: * Updated plugin description : windows -> all. Modified: software_suite_v3/software/plugin/plugin-facebook/branches/october_release/resources/plugin.xml =================================================================== --- software_suite_v3/software/plugin/plugin-facebook/branches/october_release/resources/plugin.xml 2009-10-19 09:09:43 UTC (rev 5722) +++ software_suite_v3/software/plugin/plugin-facebook/branches/october_release/resources/plugin.xml 2009-10-19 09:10:50 UTC (rev 5723) @@ -10,7 +10,7 @@ <author>Jerome Conan</author> <version>3.0</version> <iconFile>resources/plugin.png</iconFile> - <platform>windows</platform> + <platform>all</platform> <executionMode>command</executionMode> <uuid>1f0f6400-49ee-11de-8a39-0800200c9a66</uuid> </description> |
|
From: ks156 <c2m...@c2...> - 2009-10-19 09:09:57
|
Author: ks156
Date: 2009-10-19 11:09:43 +0200 (Mon, 19 Oct 2009)
New Revision: 5722
Modified:
software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/Configuration.java
software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/FriendStatut.java
software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/Message.java
software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/Reply.java
software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/TwitterDatasStruct.java
Log:
* Retabed
* Removed trailing white spaces
* Reindented
Modified: software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/Configuration.java
===================================================================
--- software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/Configuration.java 2009-10-19 09:05:21 UTC (rev 5721)
+++ software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/Configuration.java 2009-10-19 09:09:43 UTC (rev 5722)
@@ -25,144 +25,144 @@
public class Configuration extends SimplePluginConfiguration{
- private String username = "";
- private String password = "";
-
- private String myStatus = "Hello all from my tuxdroid Twitter gadget";
- private boolean updateStatus = false;
-
- private boolean checkFriends = true;
- private boolean checkMessages = true;
-
- private String defaultUser = "your_user_name";
- private String defaultPassword = "_secret_";
-
-
- /**
- * Sets the username.
- * @param username
- */
- public void setUsername(String username)
- {
- this.username = username;
- }
-
-
- /**
- * Return the username.
- * @return
- */
- public String getUsername()
- {
- if (this.username.equalsIgnoreCase(this.defaultUser))
- {
- return null;
- }
-
- return this.username;
- }
-
-
- /**
- * Set the user password.
- * @param password
- */
- public void setPassword(String password)
- {
- this.password = password;
- }
-
-
- /**
- * Return the user password.
- * @return
- */
- public String getPassword()
- {
- if (this.password.equalsIgnoreCase(this.defaultPassword))
- {
- return null;
- }
- return this.password;
- }
-
-
- /**
- * Sets the user status on twitter.
- */
- public void setMyStatus(String myStatus)
- {
- this.myStatus = myStatus;
- }
-
-
- /**
- * Return the status to be set.
- * @return
- */
- public String getMyStatus()
- {
- return this.myStatus;
- }
-
-
- /**
- * Set or not the update request.
- * @param updateStatus
- */
- public void setUpdateStatus(boolean updateStatus)
- {
- this.updateStatus = updateStatus;
- }
-
-
- /**
- * Return true if user want to update his status.
- * @return
- */
- public boolean getUpdateStatus()
- {
- return this.updateStatus;
- }
-
-
- /**
- * Set or not the checkf friends updates check.
- * @param updateStatus
- */
- public void setCheckFriends(boolean aCheckFriends)
- {
- this.checkFriends = aCheckFriends;
- }
-
-
- /**
- * Return true if user want to check his new friends statuses.
- * @return
- */
- public boolean getCheckFriends()
- {
- return this.checkFriends;
- }
-
-
- /**
- * Set or not the check messages option.
- * @param updateStatus
- */
- public void setCheckMessages(boolean aCheckMessages)
- {
- this.checkMessages = aCheckMessages;
- }
-
-
- /**
- * Return true if user want to check his replies / messages.
- * @return
- */
- public boolean getCheckMessages()
- {
- return this.checkMessages;
- }
+ private String username = "";
+ private String password = "";
+ private String myStatus = "Hello all from my tuxdroid Twitter gadget";
+ private boolean updateStatus = false;
+
+ private boolean checkFriends = true;
+ private boolean checkMessages = true;
+
+ private String defaultUser = "your_user_name";
+ private String defaultPassword = "_secret_";
+
+
+ /**
+ * Sets the username.
+ * @param username
+ */
+ public void setUsername(String username)
+ {
+ this.username = username;
+ }
+
+
+ /**
+ * Return the username.
+ * @return
+ */
+ public String getUsername()
+ {
+ if (this.username.equalsIgnoreCase(this.defaultUser))
+ {
+ return null;
+ }
+
+ return this.username;
+ }
+
+
+ /**
+ * Set the user password.
+ * @param password
+ */
+ public void setPassword(String password)
+ {
+ this.password = password;
+ }
+
+
+ /**
+ * Return the user password.
+ * @return
+ */
+ public String getPassword()
+ {
+ if (this.password.equalsIgnoreCase(this.defaultPassword))
+ {
+ return null;
+ }
+ return this.password;
+ }
+
+
+ /**
+ * Sets the user status on twitter.
+ */
+ public void setMyStatus(String myStatus)
+ {
+ this.myStatus = myStatus;
+ }
+
+
+ /**
+ * Return the status to be set.
+ * @return
+ */
+ public String getMyStatus()
+ {
+ return this.myStatus;
+ }
+
+
+ /**
+ * Set or not the update request.
+ * @param updateStatus
+ */
+ public void setUpdateStatus(boolean updateStatus)
+ {
+ this.updateStatus = updateStatus;
+ }
+
+
+ /**
+ * Return true if user want to update his status.
+ * @return
+ */
+ public boolean getUpdateStatus()
+ {
+ return this.updateStatus;
+ }
+
+
+ /**
+ * Set or not the checkf friends updates check.
+ * @param updateStatus
+ */
+ public void setCheckFriends(boolean aCheckFriends)
+ {
+ this.checkFriends = aCheckFriends;
+ }
+
+
+ /**
+ * Return true if user want to check his new friends statuses.
+ * @return
+ */
+ public boolean getCheckFriends()
+ {
+ return this.checkFriends;
+ }
+
+
+ /**
+ * Set or not the check messages option.
+ * @param updateStatus
+ */
+ public void setCheckMessages(boolean aCheckMessages)
+ {
+ this.checkMessages = aCheckMessages;
+ }
+
+
+ /**
+ * Return true if user want to check his replies / messages.
+ * @return
+ */
+ public boolean getCheckMessages()
+ {
+ return this.checkMessages;
+ }
+
}
Modified: software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/FriendStatut.java
===================================================================
--- software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/FriendStatut.java 2009-10-19 09:05:21 UTC (rev 5721)
+++ software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/FriendStatut.java 2009-10-19 09:09:43 UTC (rev 5722)
@@ -23,59 +23,59 @@
public class FriendStatut implements Serializable{
- private static final long serialVersionUID = -2710016821846315218L;
+ private static final long serialVersionUID = -2710016821846315218L;
- private String friend = null;
- private String Status = null;
-
- /**
- * Constructor.
- * @param friendName
- * @param status
- */
- public FriendStatut(String friendName, String status)
- {
- this.friend = friendName;
- this.Status = status;
- }
-
-
- /**
- * Return the friend name.
- * @return
- */
- public String getFriendName()
- {
- return this.friend;
- }
-
-
- /**
- * Return the friend status.
- * @return
- */
- public String getFriendStatus()
- {
- return this.Status;
- }
-
-
- /**
- * Set the friend name.
- * @param aFriendName
- */
- public void setFriendName(String aFriendName)
- {
- this.friend = aFriendName;
- }
-
-
- /**
- * Set the friend status.
- * @param aFriendStatus
- */
- public void setFriendStatus(String aFriendStatus)
- {
- this.Status = aFriendStatus;
- }
+ private String friend = null;
+ private String Status = null;
+
+ /**
+ * Constructor.
+ * @param friendName
+ * @param status
+ */
+ public FriendStatut(String friendName, String status)
+ {
+ this.friend = friendName;
+ this.Status = status;
+ }
+
+
+ /**
+ * Return the friend name.
+ * @return
+ */
+ public String getFriendName()
+ {
+ return this.friend;
+ }
+
+
+ /**
+ * Return the friend status.
+ * @return
+ */
+ public String getFriendStatus()
+ {
+ return this.Status;
+ }
+
+
+ /**
+ * Set the friend name.
+ * @param aFriendName
+ */
+ public void setFriendName(String aFriendName)
+ {
+ this.friend = aFriendName;
+ }
+
+
+ /**
+ * Set the friend status.
+ * @param aFriendStatus
+ */
+ public void setFriendStatus(String aFriendStatus)
+ {
+ this.Status = aFriendStatus;
+ }
}
Modified: software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/Message.java
===================================================================
--- software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/Message.java 2009-10-19 09:05:21 UTC (rev 5721)
+++ software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/Message.java 2009-10-19 09:09:43 UTC (rev 5722)
@@ -23,60 +23,60 @@
public class Message implements Serializable{
- private static final long serialVersionUID = -2723363051271966964L;
+ private static final long serialVersionUID = -2723363051271966964L;
- private String sender = null;
- private String message = null;
-
- /**
- * Constructor.
- * @param sender
- * @param message
- */
- public Message(String sender, String message)
- {
- this.sender = sender;
- this.message = message;
- }
-
-
- /**
- * Return the message sender.
- * @return
- */
- public String getSender()
- {
- return this.sender;
- }
-
-
- /**
- * Return the message itself.
- * @return
- */
- public String getMessage()
- {
- return this.message;
- }
-
-
- /**
- * Set the message.
- * @param aMessage
- */
- public void setMessage(String aMessage)
- {
- this.message = aMessage;
- }
-
-
- /**
- * Set the sender.
- * @param aSender
- */
- public void setSender(String aSender)
- {
- this.sender = aSender;
- }
-
+ private String sender = null;
+ private String message = null;
+
+ /**
+ * Constructor.
+ * @param sender
+ * @param message
+ */
+ public Message(String sender, String message)
+ {
+ this.sender = sender;
+ this.message = message;
+ }
+
+
+ /**
+ * Return the message sender.
+ * @return
+ */
+ public String getSender()
+ {
+ return this.sender;
+ }
+
+
+ /**
+ * Return the message itself.
+ * @return
+ */
+ public String getMessage()
+ {
+ return this.message;
+ }
+
+
+ /**
+ * Set the message.
+ * @param aMessage
+ */
+ public void setMessage(String aMessage)
+ {
+ this.message = aMessage;
+ }
+
+
+ /**
+ * Set the sender.
+ * @param aSender
+ */
+ public void setSender(String aSender)
+ {
+ this.sender = aSender;
+ }
+
}
Modified: software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/Reply.java
===================================================================
--- software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/Reply.java 2009-10-19 09:05:21 UTC (rev 5721)
+++ software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/Reply.java 2009-10-19 09:09:43 UTC (rev 5722)
@@ -23,59 +23,59 @@
public class Reply implements Serializable{
- private static final long serialVersionUID = -4131206164350955300L;
+ private static final long serialVersionUID = -4131206164350955300L;
- private String sender = null;
- private String reply = null;
-
- /**
- * Constructor.
- * @param sender
- * @param reply
- */
- public Reply(String sender, String reply)
- {
- this.sender = sender;
- this.reply = reply;
- }
-
-
- /**
- * Return the reply sender.
- * @return
- */
- public String getSender()
- {
- return this.sender;
- }
-
-
- /**
- * Return the reply itself.
- * @return
- */
- public String getReply()
- {
- return this.reply;
- }
-
-
- /**
- * Set the reply sender.
- * @param aSender
- */
- public void setSender(String aSender)
- {
- this.sender = aSender;
- }
-
-
- /**
- * Set the message itself.
- * @param aReply
- */
- public void setReply(String aReply)
- {
- this.reply = aReply;
- }
+ private String sender = null;
+ private String reply = null;
+
+ /**
+ * Constructor.
+ * @param sender
+ * @param reply
+ */
+ public Reply(String sender, String reply)
+ {
+ this.sender = sender;
+ this.reply = reply;
+ }
+
+
+ /**
+ * Return the reply sender.
+ * @return
+ */
+ public String getSender()
+ {
+ return this.sender;
+ }
+
+
+ /**
+ * Return the reply itself.
+ * @return
+ */
+ public String getReply()
+ {
+ return this.reply;
+ }
+
+
+ /**
+ * Set the reply sender.
+ * @param aSender
+ */
+ public void setSender(String aSender)
+ {
+ this.sender = aSender;
+ }
+
+
+ /**
+ * Set the message itself.
+ * @param aReply
+ */
+ public void setReply(String aReply)
+ {
+ this.reply = aReply;
+ }
}
Modified: software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/TwitterDatasStruct.java
===================================================================
--- software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/TwitterDatasStruct.java 2009-10-19 09:05:21 UTC (rev 5721)
+++ software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/TwitterDatasStruct.java 2009-10-19 09:09:43 UTC (rev 5722)
@@ -28,285 +28,285 @@
import java.util.Vector;
-public class TwitterDatasStruct extends Object implements Serializable{
+public class TwitterDatasStruct extends Object implements Serializable {
- private static final long serialVersionUID = 8395814134877723558L;
-
- public static final byte FRIENDS_STATUSES = 0;
- public static final byte REPLIES = 1;
- public static final byte MESSAGES = 2;
-
- public SerializedVector vktStruct;
- private File structFile;
- private boolean firstCycle;
-
-
-
- public TwitterDatasStruct(String username)
- {
- //tds = tuxdroid datas saved.
-
- File path = new File("");
- structFile = new File( path.getAbsolutePath() + File.separator + username + "@twitter.sav");
-
- if(structFile.exists())
- {
- //Getting serialized object struct.
- this.firstCycle = false;
- vktStruct = this.loadStruct();
- }
- else
- {
- this.firstCycle = true;
- //Create struct.
- vktStruct = new SerializedVector();
- if(vktStruct == null)
- {
- vktStruct = new SerializedVector();
- }
- }
- }
-
-
- /**
- * Regiter the structure.
- */
- public void registerStruct()
- {
- if(this.vktStruct.size() <= 0)
- {
- return;
- }
-
- try
- {
- FileOutputStream file = new FileOutputStream(this.structFile);
- ObjectOutputStream oos = new ObjectOutputStream(file);
- oos.writeObject(this.vktStruct);
- oos.flush();
- oos.close();
- }
- catch (java.io.IOException e)
- {
- e.printStackTrace();
- }
- }
-
-
-
- /**
- * Load the twitterDatasStruct object.
- */
- private SerializedVector loadStruct()
- {
- try
- {
- FileInputStream fichier = new FileInputStream(this.structFile);
- ObjectInputStream ois = new ObjectInputStream(fichier);
- return (SerializedVector) ois.readObject();
- }
- catch (java.io.IOException e)
- {
- e.printStackTrace();
- }
- catch (ClassNotFoundException e)
- {
- e.printStackTrace();
- }
- return null;
- }
-
-
- /**
- * Add a message to the message hashtable.
- * @param sender
- * @param message
- */
- public void addMessage(String sender, String message)
- {
- this.vktStruct.addMessage(sender, message);
- }
-
-
- /**
- * Add a reply to the reply hashtable.
- * @param sender
- * @param reply
- */
- public void addReply(String sender, String reply)
- {
- this.vktStruct.addReply(sender, reply);
- }
-
-
- /**
- * Add a status for selected friend.
- * @param friens
- * @param status
- */
- public void addFriendStatus(String friend, String status)
- {
- this.vktStruct.addFriendStatus(friend, status);
- }
-
-
-
- /**
- * This function return the state of cycle ( first start or not for the current user ).
- * @return
- */
- public boolean isFirstCycle()
- {
- return this.firstCycle;
- }
-
- /**
- * Return true if the target is registered.
- * @param list
- * @param sender
- * @param value
- * @return
- */
- public boolean isRegistered(byte list, String sender, String value)
- {
-
- switch(list)
- {
- case TwitterDatasStruct.FRIENDS_STATUSES:
- {
- for(int index=0; index < this.vktStruct.size(); index ++)
- {
- if(this.vktStruct.isFriendStatut(index))
- {
- FriendStatut friendStatus = (FriendStatut)this.vktStruct.get(index);
- if(friendStatus.getFriendName().equals(sender))
- {
- if(friendStatus.getFriendStatus().equals(value))
- {
- return true;
- }
- }
- }
- }
- }
-
- case TwitterDatasStruct.MESSAGES:
- {
- for(int index=0; index < this.vktStruct.size(); index ++)
- {
- if(this.vktStruct.isMessage(index))
- {
- Message message = (Message) this.vktStruct.get(index);
- if(message.getSender().equals(sender))
- {
- if(message.getMessage().equals(value))
- {
- return true;
- }
- }
- }
- }
- }
-
- case TwitterDatasStruct.REPLIES:
- {
- for(int index=0; index < this.vktStruct.size(); index ++)
- {
- if(this.vktStruct.isReply(index))
- {
- Reply reply = (Reply) this.vktStruct.get(index);
- if(reply.getSender().equals(sender))
- {
- if(reply.getReply().equals(value))
- {
- return true;
- }
- }
- }
- }
- }
- }
- return false;
- }
+ private static final long serialVersionUID = 8395814134877723558L;
+ public static final byte FRIENDS_STATUSES = 0;
+ public static final byte REPLIES = 1;
+ public static final byte MESSAGES = 2;
-/**
- * Handle a serialized vector of hashtable typed as <string string>
- * @author nux
- *
- */
-class SerializedVector extends Vector<Object> implements Serializable{
-
- private static final long serialVersionUID = 7018170438526763017L;
-
- public SerializedVector()
- {
- super();
- }
-
- /**
- * Add a new message in the object.
- * @param sender
- * @param message
- */
- public void addMessage(String sender, String message)
- {
- this.add(new Message(sender, message));
- }
-
-
- /**
- * Add a new Reply in the object.
- * @param sender
- * @param reply
- */
- public void addReply(String sender, String reply)
- {
- this.add(new Reply(sender, reply));
- }
-
-
- /**
- * Add a new user status in the object.
- * @param friendName
- * @param friendStatus
- */
- public void addFriendStatus(String friendName, String friendStatus)
- {
- this.add(new FriendStatut(friendName, friendStatus));
- }
-
-
- /**
- * Return true if object at 'objectIndex' is a message.
- * @param objectIndex
- * @return
- */
- public boolean isMessage(int objectIndex)
- {
- return this.get(objectIndex) instanceof Message;
- }
-
-
- /**
- * Return true if the object at 'objectIndex' is a Reply.
- * @param objectIndex
- * @return
- */
- public boolean isReply(int objectIndex)
- {
- return this.get(objectIndex) instanceof Reply;
- }
-
-
- /**
- * Return true if the object at 'objectIndex' is a FriendStatut.
- * @param objectIndex
- * @return
- */
- public boolean isFriendStatut(int objectIndex)
- {
- return this.get(objectIndex) instanceof FriendStatut;
- }
+ public SerializedVector vktStruct;
+ private File structFile;
+ private boolean firstCycle;
+
+
+
+ public TwitterDatasStruct(String username)
+ {
+ //tds = tuxdroid datas saved.
+
+ File path = new File("");
+ structFile = new File( path.getAbsolutePath() + File.separator + username + "@twitter.sav");
+
+ if(structFile.exists())
+ {
+ //Getting serialized object struct.
+ this.firstCycle = false;
+ vktStruct = this.loadStruct();
+ }
+ else
+ {
+ this.firstCycle = true;
+ //Create struct.
+ vktStruct = new SerializedVector();
+ if(vktStruct == null)
+ {
+ vktStruct = new SerializedVector();
+ }
+ }
+ }
+
+
+ /**
+ * Regiter the structure.
+ */
+ public void registerStruct()
+ {
+ if(this.vktStruct.size() <= 0)
+ {
+ return;
+ }
+
+ try
+ {
+ FileOutputStream file = new FileOutputStream(this.structFile);
+ ObjectOutputStream oos = new ObjectOutputStream(file);
+ oos.writeObject(this.vktStruct);
+ oos.flush();
+ oos.close();
+ }
+ catch (java.io.IOException e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+
+
+ /**
+ * Load the twitterDatasStruct object.
+ */
+ private SerializedVector loadStruct()
+ {
+ try
+ {
+ FileInputStream fichier = new FileInputStream(this.structFile);
+ ObjectInputStream ois = new ObjectInputStream(fichier);
+ return (SerializedVector) ois.readObject();
+ }
+ catch (java.io.IOException e)
+ {
+ e.printStackTrace();
+ }
+ catch (ClassNotFoundException e)
+ {
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+
+ /**
+ * Add a message to the message hashtable.
+ * @param sender
+ * @param message
+ */
+ public void addMessage(String sender, String message)
+ {
+ this.vktStruct.addMessage(sender, message);
+ }
+
+
+ /**
+ * Add a reply to the reply hashtable.
+ * @param sender
+ * @param reply
+ */
+ public void addReply(String sender, String reply)
+ {
+ this.vktStruct.addReply(sender, reply);
+ }
+
+
+ /**
+ * Add a status for selected friend.
+ * @param friens
+ * @param status
+ */
+ public void addFriendStatus(String friend, String status)
+ {
+ this.vktStruct.addFriendStatus(friend, status);
+ }
+
+
+
+ /**
+ * This function return the state of cycle ( first start or not for the current user ).
+ * @return
+ */
+ public boolean isFirstCycle()
+ {
+ return this.firstCycle;
+ }
+
+ /**
+ * Return true if the target is registered.
+ * @param list
+ * @param sender
+ * @param value
+ * @return
+ */
+ public boolean isRegistered(byte list, String sender, String value)
+ {
+
+ switch(list)
+ {
+ case TwitterDatasStruct.FRIENDS_STATUSES:
+ {
+ for(int index=0; index < this.vktStruct.size(); index ++)
+ {
+ if(this.vktStruct.isFriendStatut(index))
+ {
+ FriendStatut friendStatus = (FriendStatut)this.vktStruct.get(index);
+ if(friendStatus.getFriendName().equals(sender))
+ {
+ if(friendStatus.getFriendStatus().equals(value))
+ {
+ return true;
+ }
+ }
+ }
+ }
+ }
+
+ case TwitterDatasStruct.MESSAGES:
+ {
+ for(int index=0; index < this.vktStruct.size(); index ++)
+ {
+ if(this.vktStruct.isMessage(index))
+ {
+ Message message = (Message) this.vktStruct.get(index);
+ if(message.getSender().equals(sender))
+ {
+ if(message.getMessage().equals(value))
+ {
+ return true;
+ }
+ }
+ }
+ }
+ }
+
+ case TwitterDatasStruct.REPLIES:
+ {
+ for(int index=0; index < this.vktStruct.size(); index ++)
+ {
+ if(this.vktStruct.isReply(index))
+ {
+ Reply reply = (Reply) this.vktStruct.get(index);
+ if(reply.getSender().equals(sender))
+ {
+ if(reply.getReply().equals(value))
+ {
+ return true;
+ }
+ }
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+
+ /**
+ * Handle a serialized vector of hashtable typed as <string string>
+ * @author nux
+ *
+ */
+ class SerializedVector extends Vector<Object> implements Serializable{
+
+ private static final long serialVersionUID = 7018170438526763017L;
+
+ public SerializedVector()
+ {
+ super();
+ }
+
+ /**
+ * Add a new message in the object.
+ * @param sender
+ * @param message
+ */
+ public void addMessage(String sender, String message)
+ {
+ this.add(new Message(sender, message));
+ }
+
+
+ /**
+ * Add a new Reply in the object.
+ * @param sender
+ * @param reply
+ */
+ public void addReply(String sender, String reply)
+ {
+ this.add(new Reply(sender, reply));
+ }
+
+
+ /**
+ * Add a new user status in the object.
+ * @param friendName
+ * @param friendStatus
+ */
+ public void addFriendStatus(String friendName, String friendStatus)
+ {
+ this.add(new FriendStatut(friendName, friendStatus));
+ }
+
+
+ /**
+ * Return true if object at 'objectIndex' is a message.
+ * @param objectIndex
+ * @return
+ */
+ public boolean isMessage(int objectIndex)
+ {
+ return this.get(objectIndex) instanceof Message;
+ }
+
+
+ /**
+ * Return true if the object at 'objectIndex' is a Reply.
+ * @param objectIndex
+ * @return
+ */
+ public boolean isReply(int objectIndex)
+ {
+ return this.get(objectIndex) instanceof Reply;
+ }
+
+
+ /**
+ * Return true if the object at 'objectIndex' is a FriendStatut.
+ * @param objectIndex
+ * @return
+ */
+ public boolean isFriendStatut(int objectIndex)
+ {
+ return this.get(objectIndex) instanceof FriendStatut;
+ }
+ }
}
-}
|
|
From: ks156 <c2m...@c2...> - 2009-10-19 09:05:34
|
Author: ks156 Date: 2009-10-19 11:05:21 +0200 (Mon, 19 Oct 2009) New Revision: 5721 Modified: software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/resources/de.wiki software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/resources/en.po software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/resources/nl.po software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/Configuration.java software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/FriendStatut.java software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/Message.java software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/Reply.java software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/TwitterDatasStruct.java software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/TwitterPlugin.java Log: * Set file format to unix Modified: software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/resources/de.wiki =================================================================== --- software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/resources/de.wiki 2009-10-19 09:02:14 UTC (rev 5720) +++ software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/resources/de.wiki 2009-10-19 09:05:21 UTC (rev 5721) @@ -1,10 +1,10 @@ -= Übersicht = -Dieses Plugin liest Ihre Twitter-Nachrichten. Keine Ahnung, was Twitter ist? Infos unter http://www.twitter.com - -Nach der Eingabe von Twitter-Login und Kennwort können Sie verschiedene Optionen anpassen: -* Tweeten Sie Ihren neuen Status: Jedes Mal, wenn diese Funktion gestartet wird, erstellt sie einen neuen Tweet auf Ihrer Twitter-Seite. -* Tweeten Sie entsprechend dem Statustext: Hier können Sie den Text für den Tweet der obigen Option festlegen. -* Maximale Tweetanzahl: Die Anzahl der neuesten von Tux Droid vorzulesenden Tweets wählen. -* Gibt die unter den Followern gegebenen Antworten wieder: Tux Droid liest die unter den Followern gegebenen Antworten vor. -* Meine Nachrichten/Antworten wiedergeben: Tux Droid liest Ihre eigenen Nachrichten und Antworten auf Twitter vor. - += Übersicht = +Dieses Plugin liest Ihre Twitter-Nachrichten. Keine Ahnung, was Twitter ist? Infos unter http://www.twitter.com + +Nach der Eingabe von Twitter-Login und Kennwort können Sie verschiedene Optionen anpassen: +* Tweeten Sie Ihren neuen Status: Jedes Mal, wenn diese Funktion gestartet wird, erstellt sie einen neuen Tweet auf Ihrer Twitter-Seite. +* Tweeten Sie entsprechend dem Statustext: Hier können Sie den Text für den Tweet der obigen Option festlegen. +* Maximale Tweetanzahl: Die Anzahl der neuesten von Tux Droid vorzulesenden Tweets wählen. +* Gibt die unter den Followern gegebenen Antworten wieder: Tux Droid liest die unter den Followern gegebenen Antworten vor. +* Meine Nachrichten/Antworten wiedergeben: Tux Droid liest Ihre eigenen Nachrichten und Antworten auf Twitter vor. + Modified: software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/resources/en.po =================================================================== --- software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/resources/en.po 2009-10-19 09:02:14 UTC (rev 5720) +++ software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/resources/en.po 2009-10-19 09:05:21 UTC (rev 5721) @@ -1,80 +1,80 @@ -msgid "Twitter Plugin" -msgstr "Twitter Plugin" - -msgid "The Twitter plugin will make Tux Droid check your Twitter account." -msgstr "The Twitter plugin will make Tux Droid check your Twitter account." - -msgid "Username" -msgstr "Username" - -msgid "Password" -msgstr "Password" - -msgid "Tweet your new status" -msgstr "Tweet my new status" - -msgid "Tweet following status text" -msgstr "Tweet following status text" - -msgid "Hello all from my Tux Droid Twitter gadget" -msgstr "Hello all from my Tux Droid Twitter gadget." - -msgid "Check Friends updates" -msgstr "Check for new Tweets" - -msgid "Check my messages/replies" -msgstr "Check my messages/replies" - -msgid "Check your Twitter account." -msgstr "Check my Twitter account." - -msgid "Check your tweets from your Twitter account." -msgstr "Check my Tweets from my Twitter account." - -msgid "Start every x" -msgstr "Alerts" - -msgid "Start me every x" -msgstr "Check my Twitter account automatically" - -msgid "You do not seem to be connected. Please, verify you username and password, then try again." -msgstr "You do not seem to be connected. Please, verify you username and password, then try again." - -msgid "There is a new Tweet available." -msgstr "There is a new Tweet available." - -msgid "You have {0} new Tweets." -msgstr "You have {0} new Tweets." - -msgid "You don't have any new Tweets." -msgstr "You don't have any new Tweets." - -msgid "You don't have any messages" -msgstr "You don't have any messages." - -msgid "You don't have any replies" -msgstr "You don't have any replies." - -msgid "Your new Tweet was not set, please, try again later" -msgstr "Your new Tweet was not set, please, try again later." - -msgid "Your Tweet was added" -msgstr "Your Tweet was added." - -msgid "Twitter is busy for now, please, try again later." -msgstr "Twitter is busy for now, please, try again later." - -msgid "One reply from {0}" -msgstr "One reply from {0}." - -msgid "{0} replies from {1}" -msgstr "{0} replies from {1}." - -msgid "One message from {0}" -msgstr "One message from {0}." - -msgid "{0} messages from {1}" -msgstr "{0} messages from {1}." - -msgid "Sorry, there was an error when connecting to Twitter. Please check your Twitter configuration." -msgstr "Sorry, there was an error when connecting to Twitter. Please check your Twitter configuration." +msgid "Twitter Plugin" +msgstr "Twitter Plugin" + +msgid "The Twitter plugin will make Tux Droid check your Twitter account." +msgstr "The Twitter plugin will make Tux Droid check your Twitter account." + +msgid "Username" +msgstr "Username" + +msgid "Password" +msgstr "Password" + +msgid "Tweet your new status" +msgstr "Tweet my new status" + +msgid "Tweet following status text" +msgstr "Tweet following status text" + +msgid "Hello all from my Tux Droid Twitter gadget" +msgstr "Hello all from my Tux Droid Twitter gadget." + +msgid "Check Friends updates" +msgstr "Check for new Tweets" + +msgid "Check my messages/replies" +msgstr "Check my messages/replies" + +msgid "Check your Twitter account." +msgstr "Check my Twitter account." + +msgid "Check your tweets from your Twitter account." +msgstr "Check my Tweets from my Twitter account." + +msgid "Start every x" +msgstr "Alerts" + +msgid "Start me every x" +msgstr "Check my Twitter account automatically" + +msgid "You do not seem to be connected. Please, verify you username and password, then try again." +msgstr "You do not seem to be connected. Please, verify you username and password, then try again." + +msgid "There is a new Tweet available." +msgstr "There is a new Tweet available." + +msgid "You have {0} new Tweets." +msgstr "You have {0} new Tweets." + +msgid "You don't have any new Tweets." +msgstr "You don't have any new Tweets." + +msgid "You don't have any messages" +msgstr "You don't have any messages." + +msgid "You don't have any replies" +msgstr "You don't have any replies." + +msgid "Your new Tweet was not set, please, try again later" +msgstr "Your new Tweet was not set, please, try again later." + +msgid "Your Tweet was added" +msgstr "Your Tweet was added." + +msgid "Twitter is busy for now, please, try again later." +msgstr "Twitter is busy for now, please, try again later." + +msgid "One reply from {0}" +msgstr "One reply from {0}." + +msgid "{0} replies from {1}" +msgstr "{0} replies from {1}." + +msgid "One message from {0}" +msgstr "One message from {0}." + +msgid "{0} messages from {1}" +msgstr "{0} messages from {1}." + +msgid "Sorry, there was an error when connecting to Twitter. Please check your Twitter configuration." +msgstr "Sorry, there was an error when connecting to Twitter. Please check your Twitter configuration." Modified: software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/resources/nl.po =================================================================== --- software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/resources/nl.po 2009-10-19 09:02:14 UTC (rev 5720) +++ software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/resources/nl.po 2009-10-19 09:05:21 UTC (rev 5721) @@ -1,80 +1,80 @@ -msgid "Twitter Plugin" -msgstr "Twitter Plugin" - -msgid "The Twitter plugin will make Tux Droid check your Twitter account." -msgstr "De Twitter plugin zal Tux Droid je Twitter account laten checken." - -msgid "Username" -msgstr "Gebruikersnaam" - -msgid "Password" -msgstr "Wachtwoord" - -msgid "Tweet your new status" -msgstr "Tweet je nieuwe status" - -msgid "Tweet following status text" -msgstr "Tweet volgende status tekst" - -msgid "Hello all from my Tux Droid Twitter gadget" -msgstr "Hallo allemaal van mijn Tux Droid Twitter gadget" - -msgid "Check Friends updates" -msgstr "Check nieuwe Tweets" - -msgid "Check my messages/replies" -msgstr "Check mijn berichten/ antwoorden" - -msgid "Check your Twitter account." -msgstr "Check mijn Twitter account." - -msgid "Check your tweets from your Twitter account." -msgstr "Check mijn Tweets op mijn Twitter account." - -msgid "Start every x" -msgstr "Alarmen" - -msgid "Start me every x" -msgstr "Check mijn Twitter account automatisch" - -msgid "You do not seem to be connected. Please, verify you username and password, then try again." -msgstr "Ik kan geen verbinding maken. Controleer of je gebruikersnaam en wachtwoord correct zijn ingegeven." - -msgid "There is a new Tweet available." -msgstr "Er is een nieuwe Tweet beschikbaar." - -msgid "You have {0} new Tweets." -msgstr "Je hebt {0} nieuwe Tweets." - -msgid "You don't have any new Tweets." -msgstr "Je hebt geen nieuwe Tweets." - -msgid "You don't have any messages" -msgstr "Je hebt geen nieuwe berichten." - -msgid "You don't have any replies" -msgstr "Je hebt geen nieuwe antwoorden." - -msgid "Your new Tweet was not set, please, try again later" -msgstr "Je nieuwe Tweet werd niet geplaatst, probeer later opnieuw." - -msgid "Your Tweet was added" -msgstr "Je nieuwe Tweet werd toegevoegd." - -msgid "Twitter is busy for now, please, try again later." -msgstr "Twitter is bezet op het ogenblik, probeer later opnieuw." - -msgid "One reply from {0}" -msgstr "Je hebt 1 antwoord van {0}." - -msgid "{0} replies from {1}" -msgstr "{0} antwoorden van {1}." - -msgid "One message from {0}" -msgstr "1 bericht van {0}." - -msgid "{0} messages from {1}" -msgstr "{0} berichten van {1}." - -msgid "Sorry, there was an error when connecting to Twitter. Please check your Twitter configuration." -msgstr "Sorry, ik kan geen connectie maken met Twitter. Controleer je configuratie of probeer later opnieuw." +msgid "Twitter Plugin" +msgstr "Twitter Plugin" + +msgid "The Twitter plugin will make Tux Droid check your Twitter account." +msgstr "De Twitter plugin zal Tux Droid je Twitter account laten checken." + +msgid "Username" +msgstr "Gebruikersnaam" + +msgid "Password" +msgstr "Wachtwoord" + +msgid "Tweet your new status" +msgstr "Tweet je nieuwe status" + +msgid "Tweet following status text" +msgstr "Tweet volgende status tekst" + +msgid "Hello all from my Tux Droid Twitter gadget" +msgstr "Hallo allemaal van mijn Tux Droid Twitter gadget" + +msgid "Check Friends updates" +msgstr "Check nieuwe Tweets" + +msgid "Check my messages/replies" +msgstr "Check mijn berichten/ antwoorden" + +msgid "Check your Twitter account." +msgstr "Check mijn Twitter account." + +msgid "Check your tweets from your Twitter account." +msgstr "Check mijn Tweets op mijn Twitter account." + +msgid "Start every x" +msgstr "Alarmen" + +msgid "Start me every x" +msgstr "Check mijn Twitter account automatisch" + +msgid "You do not seem to be connected. Please, verify you username and password, then try again." +msgstr "Ik kan geen verbinding maken. Controleer of je gebruikersnaam en wachtwoord correct zijn ingegeven." + +msgid "There is a new Tweet available." +msgstr "Er is een nieuwe Tweet beschikbaar." + +msgid "You have {0} new Tweets." +msgstr "Je hebt {0} nieuwe Tweets." + +msgid "You don't have any new Tweets." +msgstr "Je hebt geen nieuwe Tweets." + +msgid "You don't have any messages" +msgstr "Je hebt geen nieuwe berichten." + +msgid "You don't have any replies" +msgstr "Je hebt geen nieuwe antwoorden." + +msgid "Your new Tweet was not set, please, try again later" +msgstr "Je nieuwe Tweet werd niet geplaatst, probeer later opnieuw." + +msgid "Your Tweet was added" +msgstr "Je nieuwe Tweet werd toegevoegd." + +msgid "Twitter is busy for now, please, try again later." +msgstr "Twitter is bezet op het ogenblik, probeer later opnieuw." + +msgid "One reply from {0}" +msgstr "Je hebt 1 antwoord van {0}." + +msgid "{0} replies from {1}" +msgstr "{0} antwoorden van {1}." + +msgid "One message from {0}" +msgstr "1 bericht van {0}." + +msgid "{0} messages from {1}" +msgstr "{0} berichten van {1}." + +msgid "Sorry, there was an error when connecting to Twitter. Please check your Twitter configuration." +msgstr "Sorry, ik kan geen connectie maken met Twitter. Controleer je configuratie of probeer later opnieuw." Modified: software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/Configuration.java =================================================================== --- software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/Configuration.java 2009-10-19 09:02:14 UTC (rev 5720) +++ software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/Configuration.java 2009-10-19 09:05:21 UTC (rev 5721) @@ -1,168 +1,168 @@ -/* This file is part of "Tux Droid Gadget Twitter". - * Copyright 2008, kysoh - * Author : Jerome Conan - * Site : http://www.kysoh.com/ - * - * "Tux Droid Gadget Twitter" is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * "Tux Droid Gadget Twitter" is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with "Tux Droid Gadget Twitter"; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. - */ - - -import com.kysoh.tuxdroid.plugin.framework.plugin.SimplePluginConfiguration; - - -public class Configuration extends SimplePluginConfiguration{ - - private String username = ""; - private String password = ""; - - private String myStatus = "Hello all from my tuxdroid Twitter gadget"; - private boolean updateStatus = false; - - private boolean checkFriends = true; - private boolean checkMessages = true; - - private String defaultUser = "your_user_name"; - private String defaultPassword = "_secret_"; - - - /** - * Sets the username. - * @param username - */ - public void setUsername(String username) - { - this.username = username; - } - - - /** - * Return the username. - * @return - */ - public String getUsername() - { - if (this.username.equalsIgnoreCase(this.defaultUser)) - { - return null; - } - - return this.username; - } - - - /** - * Set the user password. - * @param password - */ - public void setPassword(String password) - { - this.password = password; - } - - - /** - * Return the user password. - * @return - */ - public String getPassword() - { - if (this.password.equalsIgnoreCase(this.defaultPassword)) - { - return null; - } - return this.password; - } - - - /** - * Sets the user status on twitter. - */ - public void setMyStatus(String myStatus) - { - this.myStatus = myStatus; - } - - - /** - * Return the status to be set. - * @return - */ - public String getMyStatus() - { - return this.myStatus; - } - - - /** - * Set or not the update request. - * @param updateStatus - */ - public void setUpdateStatus(boolean updateStatus) - { - this.updateStatus = updateStatus; - } - - - /** - * Return true if user want to update his status. - * @return - */ - public boolean getUpdateStatus() - { - return this.updateStatus; - } - - - /** - * Set or not the checkf friends updates check. - * @param updateStatus - */ - public void setCheckFriends(boolean aCheckFriends) - { - this.checkFriends = aCheckFriends; - } - - - /** - * Return true if user want to check his new friends statuses. - * @return - */ - public boolean getCheckFriends() - { - return this.checkFriends; - } - - - /** - * Set or not the check messages option. - * @param updateStatus - */ - public void setCheckMessages(boolean aCheckMessages) - { - this.checkMessages = aCheckMessages; - } - - - /** - * Return true if user want to check his replies / messages. - * @return - */ - public boolean getCheckMessages() - { - return this.checkMessages; - } - -} +/* This file is part of "Tux Droid Gadget Twitter". + * Copyright 2008, kysoh + * Author : Jerome Conan + * Site : http://www.kysoh.com/ + * + * "Tux Droid Gadget Twitter" is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * "Tux Droid Gadget Twitter" is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with "Tux Droid Gadget Twitter"; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ + + +import com.kysoh.tuxdroid.plugin.framework.plugin.SimplePluginConfiguration; + + +public class Configuration extends SimplePluginConfiguration{ + + private String username = ""; + private String password = ""; + + private String myStatus = "Hello all from my tuxdroid Twitter gadget"; + private boolean updateStatus = false; + + private boolean checkFriends = true; + private boolean checkMessages = true; + + private String defaultUser = "your_user_name"; + private String defaultPassword = "_secret_"; + + + /** + * Sets the username. + * @param username + */ + public void setUsername(String username) + { + this.username = username; + } + + + /** + * Return the username. + * @return + */ + public String getUsername() + { + if (this.username.equalsIgnoreCase(this.defaultUser)) + { + return null; + } + + return this.username; + } + + + /** + * Set the user password. + * @param password + */ + public void setPassword(String password) + { + this.password = password; + } + + + /** + * Return the user password. + * @return + */ + public String getPassword() + { + if (this.password.equalsIgnoreCase(this.defaultPassword)) + { + return null; + } + return this.password; + } + + + /** + * Sets the user status on twitter. + */ + public void setMyStatus(String myStatus) + { + this.myStatus = myStatus; + } + + + /** + * Return the status to be set. + * @return + */ + public String getMyStatus() + { + return this.myStatus; + } + + + /** + * Set or not the update request. + * @param updateStatus + */ + public void setUpdateStatus(boolean updateStatus) + { + this.updateStatus = updateStatus; + } + + + /** + * Return true if user want to update his status. + * @return + */ + public boolean getUpdateStatus() + { + return this.updateStatus; + } + + + /** + * Set or not the checkf friends updates check. + * @param updateStatus + */ + public void setCheckFriends(boolean aCheckFriends) + { + this.checkFriends = aCheckFriends; + } + + + /** + * Return true if user want to check his new friends statuses. + * @return + */ + public boolean getCheckFriends() + { + return this.checkFriends; + } + + + /** + * Set or not the check messages option. + * @param updateStatus + */ + public void setCheckMessages(boolean aCheckMessages) + { + this.checkMessages = aCheckMessages; + } + + + /** + * Return true if user want to check his replies / messages. + * @return + */ + public boolean getCheckMessages() + { + return this.checkMessages; + } + +} Modified: software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/FriendStatut.java =================================================================== --- software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/FriendStatut.java 2009-10-19 09:02:14 UTC (rev 5720) +++ software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/FriendStatut.java 2009-10-19 09:05:21 UTC (rev 5721) @@ -1,81 +1,81 @@ -/* This file is part of "Tux Droid Gadget Twitter". - * Copyright 2008, kysoh - * Author : Jerome Conan - * Site : http://www.kysoh.com/ - * - * "Tux Droid Gadget Twitter" is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * "Tux Droid Gadget Twitter" is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with "Tux Droid Gadget Twitter"; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. - */ - -import java.io.Serializable; - -public class FriendStatut implements Serializable{ - - private static final long serialVersionUID = -2710016821846315218L; - - private String friend = null; - private String Status = null; - - /** - * Constructor. - * @param friendName - * @param status - */ - public FriendStatut(String friendName, String status) - { - this.friend = friendName; - this.Status = status; - } - - - /** - * Return the friend name. - * @return - */ - public String getFriendName() - { - return this.friend; - } - - - /** - * Return the friend status. - * @return - */ - public String getFriendStatus() - { - return this.Status; - } - - - /** - * Set the friend name. - * @param aFriendName - */ - public void setFriendName(String aFriendName) - { - this.friend = aFriendName; - } - - - /** - * Set the friend status. - * @param aFriendStatus - */ - public void setFriendStatus(String aFriendStatus) - { - this.Status = aFriendStatus; - } -} +/* This file is part of "Tux Droid Gadget Twitter". + * Copyright 2008, kysoh + * Author : Jerome Conan + * Site : http://www.kysoh.com/ + * + * "Tux Droid Gadget Twitter" is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * "Tux Droid Gadget Twitter" is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with "Tux Droid Gadget Twitter"; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ + +import java.io.Serializable; + +public class FriendStatut implements Serializable{ + + private static final long serialVersionUID = -2710016821846315218L; + + private String friend = null; + private String Status = null; + + /** + * Constructor. + * @param friendName + * @param status + */ + public FriendStatut(String friendName, String status) + { + this.friend = friendName; + this.Status = status; + } + + + /** + * Return the friend name. + * @return + */ + public String getFriendName() + { + return this.friend; + } + + + /** + * Return the friend status. + * @return + */ + public String getFriendStatus() + { + return this.Status; + } + + + /** + * Set the friend name. + * @param aFriendName + */ + public void setFriendName(String aFriendName) + { + this.friend = aFriendName; + } + + + /** + * Set the friend status. + * @param aFriendStatus + */ + public void setFriendStatus(String aFriendStatus) + { + this.Status = aFriendStatus; + } +} Modified: software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/Message.java =================================================================== --- software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/Message.java 2009-10-19 09:02:14 UTC (rev 5720) +++ software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/Message.java 2009-10-19 09:05:21 UTC (rev 5721) @@ -1,82 +1,82 @@ -/* This file is part of "Tux Droid Gadget Twitter". - * Copyright 2008, kysoh - * Author : Jerome Conan - * Site : http://www.kysoh.com/ - * - * "Tux Droid Gadget Twitter" is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * "Tux Droid Gadget Twitter" is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with "Tux Droid Gadget Twitter"; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. - */ - -import java.io.Serializable; - -public class Message implements Serializable{ - - private static final long serialVersionUID = -2723363051271966964L; - - private String sender = null; - private String message = null; - - /** - * Constructor. - * @param sender - * @param message - */ - public Message(String sender, String message) - { - this.sender = sender; - this.message = message; - } - - - /** - * Return the message sender. - * @return - */ - public String getSender() - { - return this.sender; - } - - - /** - * Return the message itself. - * @return - */ - public String getMessage() - { - return this.message; - } - - - /** - * Set the message. - * @param aMessage - */ - public void setMessage(String aMessage) - { - this.message = aMessage; - } - - - /** - * Set the sender. - * @param aSender - */ - public void setSender(String aSender) - { - this.sender = aSender; - } - -} +/* This file is part of "Tux Droid Gadget Twitter". + * Copyright 2008, kysoh + * Author : Jerome Conan + * Site : http://www.kysoh.com/ + * + * "Tux Droid Gadget Twitter" is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * "Tux Droid Gadget Twitter" is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with "Tux Droid Gadget Twitter"; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ + +import java.io.Serializable; + +public class Message implements Serializable{ + + private static final long serialVersionUID = -2723363051271966964L; + + private String sender = null; + private String message = null; + + /** + * Constructor. + * @param sender + * @param message + */ + public Message(String sender, String message) + { + this.sender = sender; + this.message = message; + } + + + /** + * Return the message sender. + * @return + */ + public String getSender() + { + return this.sender; + } + + + /** + * Return the message itself. + * @return + */ + public String getMessage() + { + return this.message; + } + + + /** + * Set the message. + * @param aMessage + */ + public void setMessage(String aMessage) + { + this.message = aMessage; + } + + + /** + * Set the sender. + * @param aSender + */ + public void setSender(String aSender) + { + this.sender = aSender; + } + +} Modified: software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/Reply.java =================================================================== --- software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/Reply.java 2009-10-19 09:02:14 UTC (rev 5720) +++ software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/Reply.java 2009-10-19 09:05:21 UTC (rev 5721) @@ -1,81 +1,81 @@ -/* This file is part of "Tux Droid Gadget Twitter". - * Copyright 2008, kysoh - * Author : Jerome Conan - * Site : http://www.kysoh.com/ - * - * "Tux Droid Gadget Twitter" is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * "Tux Droid Gadget Twitter" is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with "Tux Droid Gadget Twitter"; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. - */ - -import java.io.Serializable; - -public class Reply implements Serializable{ - - private static final long serialVersionUID = -4131206164350955300L; - - private String sender = null; - private String reply = null; - - /** - * Constructor. - * @param sender - * @param reply - */ - public Reply(String sender, String reply) - { - this.sender = sender; - this.reply = reply; - } - - - /** - * Return the reply sender. - * @return - */ - public String getSender() - { - return this.sender; - } - - - /** - * Return the reply itself. - * @return - */ - public String getReply() - { - return this.reply; - } - - - /** - * Set the reply sender. - * @param aSender - */ - public void setSender(String aSender) - { - this.sender = aSender; - } - - - /** - * Set the message itself. - * @param aReply - */ - public void setReply(String aReply) - { - this.reply = aReply; - } -} +/* This file is part of "Tux Droid Gadget Twitter". + * Copyright 2008, kysoh + * Author : Jerome Conan + * Site : http://www.kysoh.com/ + * + * "Tux Droid Gadget Twitter" is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * "Tux Droid Gadget Twitter" is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with "Tux Droid Gadget Twitter"; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ + +import java.io.Serializable; + +public class Reply implements Serializable{ + + private static final long serialVersionUID = -4131206164350955300L; + + private String sender = null; + private String reply = null; + + /** + * Constructor. + * @param sender + * @param reply + */ + public Reply(String sender, String reply) + { + this.sender = sender; + this.reply = reply; + } + + + /** + * Return the reply sender. + * @return + */ + public String getSender() + { + return this.sender; + } + + + /** + * Return the reply itself. + * @return + */ + public String getReply() + { + return this.reply; + } + + + /** + * Set the reply sender. + * @param aSender + */ + public void setSender(String aSender) + { + this.sender = aSender; + } + + + /** + * Set the message itself. + * @param aReply + */ + public void setReply(String aReply) + { + this.reply = aReply; + } +} Modified: software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/TwitterDatasStruct.java =================================================================== --- software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/TwitterDatasStruct.java 2009-10-19 09:02:14 UTC (rev 5720) +++ software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/TwitterDatasStruct.java 2009-10-19 09:05:21 UTC (rev 5721) @@ -1,312 +1,312 @@ -/* This file is part of "Tux Droid Gadget Twitter". - * Copyright 2008, kysoh - * Author : Jerome Conan - * Site : http://www.kysoh.com/ - * - * "Tux Droid Gadget Twitter" is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * "Tux Droid Gadget Twitter" is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with "Tux Droid Gadget Twitter"; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. - */ - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.io.Serializable; -import java.util.Vector; - - -public class TwitterDatasStruct extends Object implements Serializable{ - - private static final long serialVersionUID = 8395814134877723558L; - - public static final byte FRIENDS_STATUSES = 0; - public static final byte REPLIES = 1; - public static final byte MESSAGES = 2; - - public SerializedVector vktStruct; - private File structFile; - private boolean firstCycle; - - - - public TwitterDatasStruct(String username) - { - //tds = tuxdroid datas saved. - - File path = new File(""); - structFile = new File( path.getAbsolutePath() + File.separator + username + "@twitter.sav"); - - if(structFile.exists()) - { - //Getting serialized object struct. - this.firstCycle = false; - vktStruct = this.loadStruct(); - } - else - { - this.firstCycle = true; - //Create struct. - vktStruct = new SerializedVector(); - if(vktStruct == null) - { - vktStruct = new SerializedVector(); - } - } - } - - - /** - * Regiter the structure. - */ - public void registerStruct() - { - if(this.vktStruct.size() <= 0) - { - return; - } - - try - { - FileOutputStream file = new FileOutputStream(this.structFile); - ObjectOutputStream oos = new ObjectOutputStream(file); - oos.writeObject(this.vktStruct); - oos.flush(); - oos.close(); - } - catch (java.io.IOException e) - { - e.printStackTrace(); - } - } - - - - /** - * Load the twitterDatasStruct object. - */ - private SerializedVector loadStruct() - { - try - { - FileInputStream fichier = new FileInputStream(this.structFile); - ObjectInputStream ois = new ObjectInputStream(fichier); - return (SerializedVector) ois.readObject(); - } - catch (java.io.IOException e) - { - e.printStackTrace(); - } - catch (ClassNotFoundException e) - { - e.printStackTrace(); - } - return null; - } - - - /** - * Add a message to the message hashtable. - * @param sender - * @param message - */ - public void addMessage(String sender, String message) - { - this.vktStruct.addMessage(sender, message); - } - - - /** - * Add a reply to the reply hashtable. - * @param sender - * @param reply - */ - public void addReply(String sender, String reply) - { - this.vktStruct.addReply(sender, reply); - } - - - /** - * Add a status for selected friend. - * @param friens - * @param status - */ - public void addFriendStatus(String friend, String status) - { - this.vktStruct.addFriendStatus(friend, status); - } - - - - /** - * This function return the state of cycle ( first start or not for the current user ). - * @return - */ - public boolean isFirstCycle() - { - return this.firstCycle; - } - - /** - * Return true if the target is registered. - * @param list - * @param sender - * @param value - * @return - */ - public boolean isRegistered(byte list, String sender, String value) - { - - switch(list) - { - case TwitterDatasStruct.FRIENDS_STATUSES: - { - for(int index=0; index < this.vktStruct.size(); index ++) - { - if(this.vktStruct.isFriendStatut(index)) - { - FriendStatut friendStatus = (FriendStatut)this.vktStruct.get(index); - if(friendStatus.getFriendName().equals(sender)) - { - if(friendStatus.getFriendStatus().equals(value)) - { - return true; - } - } - } - } - } - - case TwitterDatasStruct.MESSAGES: - { - for(int index=0; index < this.vktStruct.size(); index ++) - { - if(this.vktStruct.isMessage(index)) - { - Message message = (Message) this.vktStruct.get(index); - if(message.getSender().equals(sender)) - { - if(message.getMessage().equals(value)) - { - return true; - } - } - } - } - } - - case TwitterDatasStruct.REPLIES: - { - for(int index=0; index < this.vktStruct.size(); index ++) - { - if(this.vktStruct.isReply(index)) - { - Reply reply = (Reply) this.vktStruct.get(index); - if(reply.getSender().equals(sender)) - { - if(reply.getReply().equals(value)) - { - return true; - } - } - } - } - } - } - return false; - } - - -/** - * Handle a serialized vector of hashtable typed as <string string> - * @author nux - * - */ -class SerializedVector extends Vector<Object> implements Serializable{ - - private static final long serialVersionUID = 7018170438526763017L; - - public SerializedVector() - { - super(); - } - - /** - * Add a new message in the object. - * @param sender - * @param message - */ - public void addMessage(String sender, String message) - { - this.add(new Message(sender, message)); - } - - - /** - * Add a new Reply in the object. - * @param sender - * @param reply - */ - public void addReply(String sender, String reply) - { - this.add(new Reply(sender, reply)); - } - - - /** - * Add a new user status in the object. - * @param friendName - * @param friendStatus - */ - public void addFriendStatus(String friendName, String friendStatus) - { - this.add(new FriendStatut(friendName, friendStatus)); - } - - - /** - * Return true if object at 'objectIndex' is a message. - * @param objectIndex - * @return - */ - public boolean isMessage(int objectIndex) - { - return this.get(objectIndex) instanceof Message; - } - - - /** - * Return true if the object at 'objectIndex' is a Reply. - * @param objectIndex - * @return - */ - public boolean isReply(int objectIndex) - { - return this.get(objectIndex) instanceof Reply; - } - - - /** - * Return true if the object at 'objectIndex' is a FriendStatut. - * @param objectIndex - * @return - */ - public boolean isFriendStatut(int objectIndex) - { - return this.get(objectIndex) instanceof FriendStatut; - } -} -} +/* This file is part of "Tux Droid Gadget Twitter". + * Copyright 2008, kysoh + * Author : Jerome Conan + * Site : http://www.kysoh.com/ + * + * "Tux Droid Gadget Twitter" is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * "Tux Droid Gadget Twitter" is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with "Tux Droid Gadget Twitter"; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.io.Serializable; +import java.util.Vector; + + +public class TwitterDatasStruct extends Object implements Serializable{ + + private static final long serialVersionUID = 8395814134877723558L; + + public static final byte FRIENDS_STATUSES = 0; + public static final byte REPLIES = 1; + public static final byte MESSAGES = 2; + + public SerializedVector vktStruct; + private File structFile; + private boolean firstCycle; + + + + public TwitterDatasStruct(String username) + { + //tds = tuxdroid datas saved. + + File path = new File(""); + structFile = new File( path.getAbsolutePath() + File.separator + username + "@twitter.sav"); + + if(structFile.exists()) + { + //Getting serialized object struct. + this.firstCycle = false; + vktStruct = this.loadStruct(); + } + else + { + this.firstCycle = true; + //Create struct. + vktStruct = new SerializedVector(); + if(vktStruct == null) + { + vktStruct = new SerializedVector(); + } + } + } + + + /** + * Regiter the structure. + */ + public void registerStruct() + { + if(this.vktStruct.size() <= 0) + { + return; + } + + try + { + FileOutputStream file = new FileOutputStream(this.structFile); + ObjectOutputStream oos = new ObjectOutputStream(file); + oos.writeObject(this.vktStruct); + oos.flush(); + oos.close(); + } + catch (java.io.IOException e) + { + e.printStackTrace(); + } + } + + + + /** + * Load the twitterDatasStruct object. + */ + private SerializedVector loadStruct() + { + try + { + FileInputStream fichier = new FileInputStream(this.structFile); + ObjectInputStream ois = new ObjectInputStream(fichier); + return (SerializedVector) ois.readObject(); + } + catch (java.io.IOException e) + { + e.printStackTrace(); + } + catch (ClassNotFoundException e) + { + e.printStackTrace(); + } + return null; + } + + + /** + * Add a message to the message hashtable. + * @param sender + * @param message + */ + public void addMessage(String sender, String message) + { + this.vktStruct.addMessage(sender, message); + } + + + /** + * Add a reply to the reply hashtable. + * @param sender + * @param reply + */ + public void addReply(String sender, String reply) + { + this.vktStruct.addReply(sender, reply); + } + + + /** + * Add a status for selected friend. + * @param friens + * @param status + */ + public void addFriendStatus(String friend, String status) + { + this.vktStruct.addFriendStatus(friend, status); + } + + + + /** + * This function return the state of cycle ( first start or not for the current user ). + * @return + */ + public boolean isFirstCycle() + { + return this.firstCycle; + } + + /** + * Return true if the target is registered. + * @param list + * @param sender + * @param value + * @return + */ + public boolean isRegistered(byte list, String sender, String value) + { + + switch(list) + { + case TwitterDatasStruct.FRIENDS_STATUSES: + { + for(int index=0; index < this.vktStruct.size(); index ++) + { + if(this.vktStruct.isFriendStatut(index)) + { + FriendStatut friendStatus = (FriendStatut)this.vktStruct.get(index); + if(friendStatus.getFriendName().equals(sender)) + { + if(friendStatus.getFriendStatus().equals(value)) + { + return true; + } + } + } + } + } + + case TwitterDatasStruct.MESSAGES: + { + for(int index=0; index < this.vktStruct.size(); index ++) + { + if(this.vktStruct.isMessage(index)) + { + Message message = (Message) this.vktStruct.get(index); + if(message.getSender().equals(sender)) + { + if(message.getMessage().equals(value)) + { + return true; + } + } + } + } + } + + case TwitterDatasStruct.REPLIES: + { + for(int index=0; index < this.vktStruct.size(); index ++) + { + if(this.vktStruct.isReply(index)) + { + Reply reply = (Reply) this.vktStruct.get(index); + if(reply.getSender().equals(sender)) + { + if(reply.getReply().equals(value)) + { + return true; + } + } + } + } + } + } + return false; + } + + +/** + * Handle a serialized vector of hashtable typed as <string string> + * @author nux + * + */ +class SerializedVector extends Vector<Object> implements Serializable{ + + private static final long serialVersionUID = 7018170438526763017L; + + public SerializedVector() + { + super(); + } + + /** + * Add a new message in the object. + * @param sender + * @param message + */ + public void addMessage(String sender, String message) + { + this.add(new Message(sender, message)); + } + + + /** + * Add a new Reply in the object. + * @param sender + * @param reply + */ + public void addReply(String sender, String reply) + { + this.add(new Reply(sender, reply)); + } + + + /** + * Add a new user status in the object. + * @param friendName + * @param friendStatus + */ + public void addFriendStatus(String friendName, String friendStatus) + { + this.add(new FriendStatut(friendName, friendStatus)); + } + + + /** + * Return true if object at 'objectIndex' is a message. + * @param objectIndex + * @return + */ + public boolean isMessage(int objectIndex) + { + return this.get(objectIndex) instanceof Message; + } + + + /** + * Return true if the object at 'objectIndex' is a Reply. + * @param objectIndex + * @return + */ + public boolean isReply(int objectIndex) + { + return this.get(objectIndex) instanceof Reply; + } + + + /** + * Return true if the object at 'objectIndex' is a FriendStatut. + * @param objectIndex + * @return + */ + public boolean isFriendStatut(int objectIndex) + { + return this.get(objectIndex) instanceof FriendStatut; + } +} +} Modified: software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/TwitterPlugin.java =================================================================== --- software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/TwitterPlugin.java 2009-10-19 09:02:14 UTC (rev 5720) +++ software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/TwitterPlugin.java 2009-10-19 09:05:21 UTC (rev 5721) @@ -1,539 +1,539 @@ -/* This file is part of "Tux Droid Plugin Twitter". - * Copyright 2008, kysoh - * Author : Jerome Conan - * Site : http://www.kysoh.com/ - * - * "Tux Droid Plugin Twitter" is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * "Tux Droid Plugin Twitter" is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with "Tux Droid Plugin Twitter"; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. - */ - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Vector; - -import com.kysoh.tuxdroid.plugin.framework.plugin.SimplePlugin; -import winterwell.jtwitter.Twitter; -import winterwell.jtwitter.TwitterException; -import winterwell.jtwitter.Twitter.Message; -import winterwell.jtwitter.Twitter.Status; -import winterwell.jtwitter.Twitter.User; - - -public class TwitterPlugin extends SimplePlugin<Configuration>{ - - private static TwitterDatasStruct savedStruct; - private static byte REPLY = 0; - private static byte MESSAGE = 1; - - private List<String> messagesList = new ArrayList<String>(); - private List<String> repliesList = new ArrayList<String>(); - - private boolean throwed = false; - - /*** - This function set the new user status. - Préconditions : - - To be in run mode - - Activate targeted option. - ***/ - private boolean setUserStatus(Twitter twitter) - { - if(this.getCommand().equalsIgnoreCase("run")) - { - //Set user status - if(this.configuration().getUpdateStatus()) - { - try - { - twitter.updateStatus(this.configuration().getMyStatus()); - - if ( twitter.getStatus().getText().equalsIgnoreCase(this.configuration().getMyStatus()) ) - { - return true; - } - else - { - return false; - } - } - catch(TwitterException notConnected) - { - if (!this.getCommand().equalsIgnoreCase("check")) - { - throwMessage("You do not seem to be connected. Please, verify you username and password, then try again."); - } - this.quitGadget(); - } - } - } - - return false; - } - - - /*** - * Get all new friend statuses. - * Automatic option. - ***/ - private int getNewFriendStatusesCount(Twitter twitter) - { - int statusesCount = 0; - List<User> friend = twitter.getFriends(); - - for( int i = 0 ; i < friend.size() ; i++ ) - { - try - { - Status status = friend.get(i).getStatus(); - - String statusText = status.getText(); - String username = status.getUser().getName(); - - - //if a new status was set for this user text. - boolean said = savedStruct.isRegistered(TwitterDatasStruct.FRIENDS_STATUSES, username, statusText); - - if((statusText != "null") && !said) - { - String stat = statusText.replace("&", ""); - stat = this.urlFilter(stat); - - if (! isReplyToOtherUser(stat)) - { - statusesCount += 1; - //Saving last entry. - savedStruct.addFriendStatus(username, statusText); - } - } - } - catch(NullPointerException statusNotExists) - { - //Simply pass in case of exception, friend status change will not be counted. - ; - } - - } - - return statusesCount; - } - - - - /*** - * This function return how many messages user has into his private Twitter mailbox. - * @return an integer that represent user privates messages count. - ***/ - private int getPrivateMessagesCount(Twitter twitter) - { - List<Message> messages = twitter.getDirectMessages(); - if(messages.size() > 0) - { - try - { - //then give messages. - for(Message message : messages) - { - String username = message.getSender().getName(); - - boolean said = savedStruct.isRegistered(TwitterDatasStruct.MESSAGES, username, message.getText()); - - if((message.getText() != "null") && !said) - { - messagesList.add(username); - savedStruct.addMessage(username, message.getText()); - } - } - } - catch(NullPointerException pointerError) - { - ; - } - } - - return messagesList.size(); - } - - - - /*** - * This function return how many messages user has into his public Twitter mailbox. - * @return an integer that represent user public messages count. - ***/ - private int getPublicMessagesCount(Twitter twitter) - { - List<Message> replies = twitter.getReplies(); - - if(replies.size() > 0) - { - try - { - for(Message reply : replies) - { - String username = reply.getSender().getName(); - - boolean said = savedStruct.isRegistered(TwitterDatasStruct.REPLIES, username, reply.getText()); - - if((reply.getText() != "null") && !said) - { - repliesList.add(username); - savedStruct.addReply(username, reply.getText()); - } - - } - } - catch(NullPointerException pointerError) - { - ; - } - } - return repliesList.size(); - } - - - private void throwRes() - { - if ( ( !throwed ) && ( this.getCommand().equalsIgnoreCase("check") )) - { - this.throwed = true; - this.throwResult(true); - this.throwMessage("Twitter"); - } - } - - - @Override - protected void start() throws Throwable - { - - if(( this.configuration().getPassword() == null) || (this.configuration().getUsername() == null)) - { - if( ! this.getCommand().equalsIgnoreCase("check")) - { - this.throwMessage("Sorry, there was an error when connecting to Twitter. Please check your Twitter configuration."); - } - this.quitGadget(); - } - - //Creating / getting sav context. - savedStruct = new TwitterDatasStruct(this.configuration().getUsername()); - - boolean secondCycle = ( this.getCommand().equalsIgnoreCase("check") && savedStruct.isFirstCycle() ) ? false : true; - - /*** - * Getting connected to twitter and setting update source ( here TuxDroid ). - ***/ - Twitter twitter = null; - twitter = new Twitter(this.configuration().getUsername(), this.configuration().getPassword()); - twitter.setSource("tuxdroid"); - - //Getting Twitter informations. - try - { - if (! this.configuration().getUpdateStatus()) - { - /** - * Getting new friend statuses count if option is enabled. - */ - if(this.configuration().getCheckFriends()) - { - int updateCount = getNewFriendStatusesCount(twitter); - - //First check insilent mode. - if(this.getCommand().equalsIgnoreCase("run") || secondCycle) - { - - if ( updateCount == 1 ) - { - throwRes(); - throwMessage("There is a new Tweet available."); - } - else if ( updateCount > 1 ) - { - throwRes(); - throwMessage("You have {0} new Tweets.", String.valueOf(updateCount)); - } - else - { - if ( ! this.getCommand().equalsIgnoreCase("check") ) - { - throwMessage("You don't have any new Tweets."); - } - } - } - } - - - /** - * Getting, sorting new user private / public ( replies ) messages. - * if option is enabled. - */ - if (this.configuration().getCheckMessages()) - { - if ( getPrivateMessagesCount(twitter) > 0 ) - { - //First check insilent mode. - if(this.getCommand().equalsIgnoreCase("run") || secondCycle) - { - this.sort(this.messagesList); - //Counting by name and throwing messages. - this.getByNames(this.messagesList, MESSAGE); - } - } - else - { - if ( ! this.getCommand().equalsIgnoreCase("check") ) - { - throwMessage("You don't have any messages"); - } - } - - //Getting and sorting new user replies. - if ( getPublicMessagesCount(twitter) > 0 ) - { - //First check insilent mode. - if(this.getCommand().equalsIgnoreCase("run") || secondCycle) - { - this.sort(this.repliesList); - //Counting by name and throwing messages. - this.getByNames(this.repliesList, REPLY); - } - } - else - { - if ( ! this.getCommand().equalsIgnoreCase("check") ) - { - throwMessage("You don't have any replies"); - } - } - - //Registering couted messages. - savedStruct.registerStruct(); - - } - } - else - { - //Updating user status. - if( ! this.setUserStatus(twitter) ) - { - this.throwMessage("Your new Tweet was not set, please, try again later"); - } - else - { - this.throwMessage("Your Tweet was added"); - } - } - } - catch(TwitterException badRequest) - { - if ( ! this.getCommand().equalsIgnoreCase("check") ) - { - throwMessage("Twitter is busy for now, please, try again later."); - } - - this.quitGadget(); - } - - } - - - /*** - * Sort a typ string list. - * @param list - */ - private void sort(List<String> list) - { - Collections.sort(list); - } - - - /*** - * Throw messages by user names. - * @param list - */ - private void getByNames(List<String> list, byte type) - { - Vector<String> dtUsers = new Vector<String>(); - Vector<Integer> dtCount = new Vector<Integer>(); - int count = 1; - - //Handling no replies / no messages. - if (list.size() == 0) - { - return; - } - - //Counting by names. - for( int i = 0 ; i != list.size() ; i ++) - { - - if (dtUsers.contains(list.get(i))) - { - dtCount.set(dtUsers.indexOf(list.get(i)), dtCount.get(dtUsers.indexOf(list.get(i))) + 1); - } - else - { - dtUsers.add(list.get(i)); - dtCount.add(1); - } - - } - - if (dtUsers.size() > 0) - { - throwRes(); - } - - for(String it : dtUsers) - { - count = dtCount.get(dtUsers.indexOf(it)); - - if ( type == REPLY ) - { - if ( count == 1 ) - { - throwMessage("One reply from {0}", it); - } - else - { - throwMessage ("{0} replies from {1}", count, it); - } - } - else - { - if ( count == 1 ) - { - throwMessage("One message from {0}", it); - } - else - { - throwMessage("{0} messages from {1}", count, it); - } - } - } - } - - - /** - * Return true if the text value indicates that the message was sent from a user - * to an other user , but not the TuxDroid owner. - * @param value - * @return - */ - private boolean isReplyToOtherUser(String value) - { - if(value.charAt(0) == '@') - { - return true; - } - return false; - } - - - /*** - * Remove Url's from text. - * @param string - * @ret... [truncated message content] |
|
From: ks156 <c2m...@c2...> - 2009-10-19 09:02:34
|
Author: ks156
Date: 2009-10-19 11:02:14 +0200 (Mon, 19 Oct 2009)
New Revision: 5720
Modified:
software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/resources/de.po
software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/resources/en.po
software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/resources/fr.po
software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/resources/nl.po
software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/resources/plugin.pot
software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/resources/plugin.xml
software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/TwitterPlugin.java
Log:
* Synchronized the code and the pot from en.po.
All the files are now synchronized again ...
Modified: software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/resources/de.po
===================================================================
--- software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/resources/de.po 2009-10-19 07:18:33 UTC (rev 5719)
+++ software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/resources/de.po 2009-10-19 09:02:14 UTC (rev 5720)
@@ -16,7 +16,7 @@
msgid "Tweet following status text"
msgstr "Tweeten Sie entsprechend dem Statustext"
-msgid "Hello all from my Tux Droid twitter gadget"
+msgid "Hello all from my Tux Droid Twitter gadget"
msgstr "Hallo an alle von meinem Twitter - Tux Droid"
msgid "Check Friends updates"
@@ -40,13 +40,13 @@
msgid "You do not seem to be connected. Please, verify you username and password, then try again."
msgstr "Anscheinend sind Sie nicht mit dem Internet verbunden. Prüfen Sie Benutzername und Passwort und versuchen Sie es danach wieder."
-msgid "You have a new friend update"
+msgid "There is a new Tweet available."
msgstr "Sie haben eine neue Freund Aktualisierung."
-msgid "You have {0} friend updates"
+msgid "You have {0} new Tweets."
msgstr "Sie haben {0} Freund Aktualisierungen."
-msgid "You don't have any friend updates."
+msgid "You don't have any new Tweets."
msgstr "Sie haben keine Freund Aktualisierungen."
msgid "You don't have any messages"
@@ -61,7 +61,7 @@
msgid "Your Tweet was added"
msgstr "Ihre neue Tweet wurde hinzugefügt."
-msgid "Twitter is busy for now, please, try later."
+msgid "Twitter is busy for now, please, try again later."
msgstr "Twitter ist ausgelastet, versuchen Sie es später wieder."
msgid "One reply from {0}"
Modified: software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/resources/en.po
===================================================================
--- software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/resources/en.po 2009-10-19 07:18:33 UTC (rev 5719)
+++ software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/resources/en.po 2009-10-19 09:02:14 UTC (rev 5720)
@@ -16,7 +16,7 @@
msgid "Tweet following status text"
msgstr "Tweet following status text"
-msgid "Hello all from my Tux Droid twitter gadget"
+msgid "Hello all from my Tux Droid Twitter gadget"
msgstr "Hello all from my Tux Droid Twitter gadget."
msgid "Check Friends updates"
@@ -40,13 +40,13 @@
msgid "You do not seem to be connected. Please, verify you username and password, then try again."
msgstr "You do not seem to be connected. Please, verify you username and password, then try again."
-msgid "You have a new friend update"
+msgid "There is a new Tweet available."
msgstr "There is a new Tweet available."
-msgid "You have {0} friend updates"
+msgid "You have {0} new Tweets."
msgstr "You have {0} new Tweets."
-msgid "You don't have any friend updates."
+msgid "You don't have any new Tweets."
msgstr "You don't have any new Tweets."
msgid "You don't have any messages"
@@ -61,7 +61,7 @@
msgid "Your Tweet was added"
msgstr "Your Tweet was added."
-msgid "Twitter is busy for now, please, try later."
+msgid "Twitter is busy for now, please, try again later."
msgstr "Twitter is busy for now, please, try again later."
msgid "One reply from {0}"
@@ -78,4 +78,3 @@
msgid "Sorry, there was an error when connecting to Twitter. Please check your Twitter configuration."
msgstr "Sorry, there was an error when connecting to Twitter. Please check your Twitter configuration."
-
Modified: software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/resources/fr.po
===================================================================
--- software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/resources/fr.po 2009-10-19 07:18:33 UTC (rev 5719)
+++ software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/resources/fr.po 2009-10-19 09:02:14 UTC (rev 5720)
@@ -16,7 +16,7 @@
msgid "Tweet following status text"
msgstr "Tweet à publier"
-msgid "Hello all from my Tux Droid twitter gadget"
+msgid "Hello all from my Tux Droid Twitter gadget"
msgstr "Bonjour à tous à partir du gadget Twitter de mon Tux Droid"
msgid "Check Friends updates"
@@ -28,25 +28,25 @@
msgid "Check your Twitter account."
msgstr "Vérifier votre compte Twitter"
-msgid "Start every x"
-msgstr "Alertes"
-
msgid "Check your tweets from your Twitter account."
msgstr "Vérifier vos Tweets"
+msgid "Start every x"
+msgstr "Alertes"
+
msgid "Start me every x"
msgstr "Vérifier automatiquement mon compte Twitter."
msgid "You do not seem to be connected. Please, verify you username and password, then try again."
msgstr "Il semble que vous ne soyez pas connecté. Vérifiez votre login et votre mot de passe et essayez à nouveau."
-msgid "You have a new friend update"
+msgid "There is a new Tweet available."
msgstr "Un ami à publié un nouveau Tweet"
-msgid "You have {0} friend updates"
+msgid "You have {0} new Tweets."
msgstr "{0} de vos amis ont publié un nouveau Tweet"
-msgid "You don't have any friend updates."
+msgid "You don't have any new Tweets."
msgstr "Vos amis n'ont pas publié de Tweets"
msgid "You don't have any messages"
@@ -61,7 +61,7 @@
msgid "Your Tweet was added"
msgstr "Votre Tweet a été publié"
-msgid "Twitter is busy for now, please, try later."
+msgid "Twitter is busy for now, please, try again later."
msgstr "Twitter est occupé pour le moment, veuillez réessayer plus tard."
msgid "One reply from {0}"
@@ -78,5 +78,3 @@
msgid "Sorry, there was an error when connecting to Twitter. Please check your Twitter configuration."
msgstr "Désolé, il y a eu une erreur lors de la connexion avec Twitter. Vérifiez votre login et votre mot de passe"
-
-
Modified: software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/resources/nl.po
===================================================================
--- software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/resources/nl.po 2009-10-19 07:18:33 UTC (rev 5719)
+++ software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/resources/nl.po 2009-10-19 09:02:14 UTC (rev 5720)
@@ -16,7 +16,7 @@
msgid "Tweet following status text"
msgstr "Tweet volgende status tekst"
-msgid "Hello all from my Tux Droid twitter gadget"
+msgid "Hello all from my Tux Droid Twitter gadget"
msgstr "Hallo allemaal van mijn Tux Droid Twitter gadget"
msgid "Check Friends updates"
@@ -40,13 +40,13 @@
msgid "You do not seem to be connected. Please, verify you username and password, then try again."
msgstr "Ik kan geen verbinding maken. Controleer of je gebruikersnaam en wachtwoord correct zijn ingegeven."
-msgid "You have a new friend update"
+msgid "There is a new Tweet available."
msgstr "Er is een nieuwe Tweet beschikbaar."
-msgid "You have {0} friend updates"
+msgid "You have {0} new Tweets."
msgstr "Je hebt {0} nieuwe Tweets."
-msgid "You don't have any friend updates."
+msgid "You don't have any new Tweets."
msgstr "Je hebt geen nieuwe Tweets."
msgid "You don't have any messages"
@@ -61,7 +61,7 @@
msgid "Your Tweet was added"
msgstr "Je nieuwe Tweet werd toegevoegd."
-msgid "Twitter is busy for now, please, try later."
+msgid "Twitter is busy for now, please, try again later."
msgstr "Twitter is bezet op het ogenblik, probeer later opnieuw."
msgid "One reply from {0}"
Modified: software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/resources/plugin.pot
===================================================================
--- software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/resources/plugin.pot 2009-10-19 07:18:33 UTC (rev 5719)
+++ software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/resources/plugin.pot 2009-10-19 09:02:14 UTC (rev 5720)
@@ -16,7 +16,7 @@
msgid "Tweet following status text"
msgstr ""
-msgid "Hello all from my Tux Droid twitter gadget"
+msgid "Hello all from my Tux Droid Twitter gadget"
msgstr ""
msgid "Check Friends updates"
@@ -40,13 +40,13 @@
msgid "You do not seem to be connected. Please, verify you username and password, then try again."
msgstr ""
-msgid "You have a new friend update"
+msgid "There is a new Tweet available."
msgstr ""
-msgid "You have {0} friend updates"
+msgid "You have {0} new Tweets."
msgstr ""
-msgid "You don't have any friend updates."
+msgid "You don't have any new Tweets."
msgstr ""
msgid "You don't have any messages"
@@ -61,7 +61,7 @@
msgid "Your Tweet was added"
msgstr ""
-msgid "Twitter is busy for now, please, try later."
+msgid "Twitter is busy for now, please, try again later."
msgstr ""
msgid "One reply from {0}"
@@ -78,4 +78,3 @@
msgid "Sorry, there was an error when connecting to Twitter. Please check your Twitter configuration."
msgstr ""
-
Modified: software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/resources/plugin.xml
===================================================================
--- software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/resources/plugin.xml 2009-10-19 07:18:33 UTC (rev 5719)
+++ software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/resources/plugin.xml 2009-10-19 09:02:14 UTC (rev 5720)
@@ -39,7 +39,7 @@
name="myStatus"
description="Tweet following status text"
type="string"
- defaultValue="Hello all from my Tux Droid twitter gadget" />
+ defaultValue="Hello all from my Tux Droid Twitter gadget" />
<parameter
category="User parameters"
name="checkFriends"
Modified: software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/TwitterPlugin.java
===================================================================
--- software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/TwitterPlugin.java 2009-10-19 07:18:33 UTC (rev 5719)
+++ software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/plugin-twitter/src/TwitterPlugin.java 2009-10-19 09:02:14 UTC (rev 5720)
@@ -258,18 +258,18 @@
if ( updateCount == 1 )
{
throwRes();
- throwMessage("You have a new friend update");
+ throwMessage("There is a new Tweet available.");
}
else if ( updateCount > 1 )
{
throwRes();
- throwMessage("You have {0} friend updates", String.valueOf(updateCount));
+ throwMessage("You have {0} new Tweets.", String.valueOf(updateCount));
}
else
{
if ( ! this.getCommand().equalsIgnoreCase("check") )
{
- throwMessage("You don't have any friend updates.");
+ throwMessage("You don't have any new Tweets.");
}
}
}
@@ -341,7 +341,7 @@
{
if ( ! this.getCommand().equalsIgnoreCase("check") )
{
- throwMessage("Twitter is busy for now, please, try later.");
+ throwMessage("Twitter is busy for now, please, try again later.");
}
this.quitGadget();
|
|
From: ks156 <c2m...@c2...> - 2009-10-19 07:18:51
|
Author: ks156 Date: 2009-10-19 09:18:33 +0200 (Mon, 19 Oct 2009) New Revision: 5719 Added: software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences/ Log: * Added a new branch for the random sentences. The purpose it to add variations in the way of giving the information. Copied: software_suite_v3/software/plugin/plugin-twitter/branches/random_sentences (from rev 5718, software_suite_v3/software/plugin/plugin-twitter/trunk) |
|
From: ks156 <c2m...@c2...> - 2009-10-16 13:14:17
|
Author: ks156
Date: 2009-10-16 15:14:06 +0200 (Fri, 16 Oct 2009)
New Revision: 5718
Modified:
software_suite_v3/software/plugin/plugin-clock/branches/random_sentences/sources/net/karmaLab/tuxDroid/plugins/ClockPlugin.java
Log:
* Detect the language before throwing the half hour message :
In dutch and german, the it's 'half TO ...' and not 'half PAST ...'
Modified: software_suite_v3/software/plugin/plugin-clock/branches/random_sentences/sources/net/karmaLab/tuxDroid/plugins/ClockPlugin.java
===================================================================
--- software_suite_v3/software/plugin/plugin-clock/branches/random_sentences/sources/net/karmaLab/tuxDroid/plugins/ClockPlugin.java 2009-10-16 11:56:27 UTC (rev 5717)
+++ software_suite_v3/software/plugin/plugin-clock/branches/random_sentences/sources/net/karmaLab/tuxDroid/plugins/ClockPlugin.java 2009-10-16 13:14:06 UTC (rev 5718)
@@ -100,7 +100,13 @@
}
}
else if (m == 30) {
- throwMessage("It's half past {0}", h);
+ String language = configuration().getLanguage();
+ if (language.equals("nl") || language.equals("de")) {
+ throwMessage("It's half past {0}", h+1);
+ }
+ else {
+ throwMessage("It's half past {0}", h);
+ }
}
else if (m == 45) {
if (random) {
|
|
From: ks156 <c2m...@c2...> - 2009-10-16 11:56:41
|
Author: ks156
Date: 2009-10-16 13:56:27 +0200 (Fri, 16 Oct 2009)
New Revision: 5717
Modified:
software_suite_v3/smart-core/smart-server/branches/user_mode/data/web_interface/user_01/xsl/gadget_configuration.xsl
software_suite_v3/smart-core/smart-server/branches/user_mode/translation/wi_user/de.po
software_suite_v3/smart-core/smart-server/branches/user_mode/translation/wi_user/en.po
software_suite_v3/smart-core/smart-server/branches/user_mode/translation/wi_user/fr.po
software_suite_v3/smart-core/smart-server/branches/user_mode/translation/wi_user/nl.po
Log:
* Merged rev 5677 to 5716 from trunk in this branch
Modified: software_suite_v3/smart-core/smart-server/branches/user_mode/data/web_interface/user_01/xsl/gadget_configuration.xsl
===================================================================
--- software_suite_v3/smart-core/smart-server/branches/user_mode/data/web_interface/user_01/xsl/gadget_configuration.xsl 2009-10-16 10:39:52 UTC (rev 5716)
+++ software_suite_v3/smart-core/smart-server/branches/user_mode/data/web_interface/user_01/xsl/gadget_configuration.xsl 2009-10-16 11:56:27 UTC (rev 5717)
@@ -107,7 +107,6 @@
</div>
</xsl:if>
</xsl:for-each>
- <!-- GADGET ALERT ATTITUNE -->
<xsl:if test="root/data/showAlertAttitune = 'True'">
<div class="gadgetConfContentFrameMiddle">
<div class="gadgetConfContentFrameSep"></div>
@@ -146,7 +145,7 @@
<xsl:when test="root/data/description/onDemandIsAble = 'true'">
<!-- BAR -->
<div class="gadgetConfTitleBarOnDemand">
- <span class="gadgetConfTitleBarLabel"><xsl:value-of select="root/translations/on_demand_config_section"/></span>
+ <span class="gadgetConfTitleBarLabel"><xsl:value-of select="root/translations/on_demand"/></span>
</div>
<div class="gadgetConfTitleBarBottom2"></div>
<!-- Content -->
@@ -179,7 +178,7 @@
</xsl:element>
<!-- BAR -->
<div class="gadgetConfTitleBarAlert">
- <span class="gadgetConfTitleBarLabel"><xsl:value-of select="translatedName"/></span>
+ <span class="gadgetConfTitleBarLabel"><xsl:value-of select="../../../translations/alerts"/></span>
</div>
<div class="gadgetConfTitleBarBottom2"></div>
<!-- CONTENT -->
Modified: software_suite_v3/smart-core/smart-server/branches/user_mode/translation/wi_user/de.po
===================================================================
--- software_suite_v3/smart-core/smart-server/branches/user_mode/translation/wi_user/de.po 2009-10-16 10:39:52 UTC (rev 5716)
+++ software_suite_v3/smart-core/smart-server/branches/user_mode/translation/wi_user/de.po 2009-10-16 11:56:27 UTC (rev 5717)
@@ -74,7 +74,7 @@
msgstr "Abbrechen"
msgid "gadget_settings"
-msgstr "Funktionseinstellungen"
+msgstr "Einstellungen"
msgid "gadget_name"
msgstr "Funktionsname"
Modified: software_suite_v3/smart-core/smart-server/branches/user_mode/translation/wi_user/en.po
===================================================================
--- software_suite_v3/smart-core/smart-server/branches/user_mode/translation/wi_user/en.po 2009-10-16 10:39:52 UTC (rev 5716)
+++ software_suite_v3/smart-core/smart-server/branches/user_mode/translation/wi_user/en.po 2009-10-16 11:56:27 UTC (rev 5717)
@@ -74,7 +74,7 @@
msgstr "Cancel"
msgid "gadget_settings"
-msgstr "Gadget settings"
+msgstr "Settings"
msgid "gadget_name"
msgstr "Gadget name"
Modified: software_suite_v3/smart-core/smart-server/branches/user_mode/translation/wi_user/fr.po
===================================================================
--- software_suite_v3/smart-core/smart-server/branches/user_mode/translation/wi_user/fr.po 2009-10-16 10:39:52 UTC (rev 5716)
+++ software_suite_v3/smart-core/smart-server/branches/user_mode/translation/wi_user/fr.po 2009-10-16 11:56:27 UTC (rev 5717)
@@ -74,7 +74,7 @@
msgstr "Annuler"
msgid "gadget_settings"
-msgstr "Paramètres du gadget"
+msgstr "Paramètres"
msgid "gadget_name"
msgstr "Nom du gadget"
Modified: software_suite_v3/smart-core/smart-server/branches/user_mode/translation/wi_user/nl.po
===================================================================
--- software_suite_v3/smart-core/smart-server/branches/user_mode/translation/wi_user/nl.po 2009-10-16 10:39:52 UTC (rev 5716)
+++ software_suite_v3/smart-core/smart-server/branches/user_mode/translation/wi_user/nl.po 2009-10-16 11:56:27 UTC (rev 5717)
@@ -74,7 +74,7 @@
msgstr "Annuleren"
msgid "gadget_settings"
-msgstr "Gadget configuratie"
+msgstr "Configuratie"
msgid "gadget_name"
msgstr "Gadget naam"
|
|
From: ks156 <c2m...@c2...> - 2009-10-16 10:40:08
|
Author: ks156
Date: 2009-10-16 12:39:52 +0200 (Fri, 16 Oct 2009)
New Revision: 5716
Modified:
software_suite_v3/smart-core/smart-server/branches/user_mode/util/applicationserver/gadget/GadgetOnline.py
software_suite_v3/smart-core/smart-server/branches/user_mode/util/applicationserver/gadget/GadgetsContainer.py
software_suite_v3/smart-core/smart-server/branches/user_mode/util/applicationserver/gadget/GadgetsOnlineContainer.py
Log:
* Merged rev 5714 from the trunk. Other rev will be merged after the release.
Modified: software_suite_v3/smart-core/smart-server/branches/user_mode/util/applicationserver/gadget/GadgetOnline.py
===================================================================
--- software_suite_v3/smart-core/smart-server/branches/user_mode/util/applicationserver/gadget/GadgetOnline.py 2009-10-16 09:57:19 UTC (rev 5715)
+++ software_suite_v3/smart-core/smart-server/branches/user_mode/util/applicationserver/gadget/GadgetOnline.py 2009-10-16 10:39:52 UTC (rev 5716)
@@ -143,3 +143,15 @@
result = "%sscg/%s.scg" % (ONLINE_GADGETS_BASE_URL,
self.getSymbolicName())
return result
+
+ # --------------------------------------------------------------------------
+ # Get the parent plugin Uuid.
+ # --------------------------------------------------------------------------
+ def getParentPluginUuid(self):
+ """Get the parent plugin Uuid.
+ @return: The parent plugin Uuid.
+ """
+ if self.__dictionary.has_key('parentPluginUuid'):
+ return self.__dictionary['parentPluginUuid']
+ else:
+ return "0"
Modified: software_suite_v3/smart-core/smart-server/branches/user_mode/util/applicationserver/gadget/GadgetsContainer.py
===================================================================
--- software_suite_v3/smart-core/smart-server/branches/user_mode/util/applicationserver/gadget/GadgetsContainer.py 2009-10-16 09:57:19 UTC (rev 5715)
+++ software_suite_v3/smart-core/smart-server/branches/user_mode/util/applicationserver/gadget/GadgetsContainer.py 2009-10-16 10:39:52 UTC (rev 5716)
@@ -100,6 +100,15 @@
return self.__gadgetsOnlineContainer
# --------------------------------------------------------------------------
+ # Get the plugins container.
+ # --------------------------------------------------------------------------
+ def getPluginsContainer(self):
+ """Get the plugins container.
+ @return: A PluginsContainer object.
+ """
+ return self.__pluginsContainer
+
+ # --------------------------------------------------------------------------
# Generate a single name.
# --------------------------------------------------------------------------
def generateSingleName(self, gadgetName, language):
@@ -167,6 +176,7 @@
gadgetData['category'] = gadget.getDescription().getCategory()
gadgetData['author'] = gadget.getDescription().getAuthor()
gadgetData['platform'] = gadget.getDescription().getPlatform()
+ gadgetData['parentPluginUuid'] = gadget.getParentPlugin().getDescription().getUuid()
gadgetData['name'] = {}
gadgetData['description'] = {}
gadgetData['helpFile'] = {}
Modified: software_suite_v3/smart-core/smart-server/branches/user_mode/util/applicationserver/gadget/GadgetsOnlineContainer.py
===================================================================
--- software_suite_v3/smart-core/smart-server/branches/user_mode/util/applicationserver/gadget/GadgetsOnlineContainer.py 2009-10-16 09:57:19 UTC (rev 5715)
+++ software_suite_v3/smart-core/smart-server/branches/user_mode/util/applicationserver/gadget/GadgetsOnlineContainer.py 2009-10-16 10:39:52 UTC (rev 5716)
@@ -154,6 +154,13 @@
cat = onlineGadget.getCategory()
if not cat.lower() in categories:
categories.append(cat.lower())
+ # Check the parent plugin
+ parentPluginUuid = onlineGadget.getParentPluginUuid()
+ if parentPluginUuid != "0":
+ pluginsContainer = self.__gadgetsContainer.getPluginsContainer()
+ parentPlugin = pluginsContainer.getPluginByUuid(parentPluginUuid)
+ if parentPlugin == None:
+ continue
# Check the category
if category != "all_gadgets":
if cat.lower() != category.lower():
|
|
From: ks156 <c2m...@c2...> - 2009-10-16 09:57:31
|
Author: ks156 Date: 2009-10-16 11:57:19 +0200 (Fri, 16 Oct 2009) New Revision: 5715 Added: software_suite_v3/software/plugin/plugin-twitter/tags/3.0/ Log: * Tagged version 3.0 (cp from rev 5688) Copied: software_suite_v3/software/plugin/plugin-twitter/tags/3.0 (from rev 5688, software_suite_v3/software/plugin/plugin-twitter/trunk) |
|
From: remi <c2m...@c2...> - 2009-10-16 09:48:02
|
Author: remi
Date: 2009-10-16 11:47:50 +0200 (Fri, 16 Oct 2009)
New Revision: 5714
Modified:
software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/gadget/GadgetOnline.py
software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/gadget/GadgetsContainer.py
software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/gadget/GadgetsOnlineContainer.py
Log:
* Parent plugin uuid of the online gadgets are now checked before to show gadgets in the online page
Modified: software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/gadget/GadgetOnline.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/gadget/GadgetOnline.py 2009-10-16 09:41:56 UTC (rev 5713)
+++ software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/gadget/GadgetOnline.py 2009-10-16 09:47:50 UTC (rev 5714)
@@ -143,3 +143,15 @@
result = "%sscg/%s.scg" % (ONLINE_GADGETS_BASE_URL,
self.getSymbolicName())
return result
+
+ # --------------------------------------------------------------------------
+ # Get the parent plugin Uuid.
+ # --------------------------------------------------------------------------
+ def getParentPluginUuid(self):
+ """Get the parent plugin Uuid.
+ @return: The parent plugin Uuid.
+ """
+ if self.__dictionary.has_key('parentPluginUuid'):
+ return self.__dictionary['parentPluginUuid']
+ else:
+ return "0"
Modified: software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/gadget/GadgetsContainer.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/gadget/GadgetsContainer.py 2009-10-16 09:41:56 UTC (rev 5713)
+++ software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/gadget/GadgetsContainer.py 2009-10-16 09:47:50 UTC (rev 5714)
@@ -100,6 +100,15 @@
return self.__gadgetsOnlineContainer
# --------------------------------------------------------------------------
+ # Get the plugins container.
+ # --------------------------------------------------------------------------
+ def getPluginsContainer(self):
+ """Get the plugins container.
+ @return: A PluginsContainer object.
+ """
+ return self.__pluginsContainer
+
+ # --------------------------------------------------------------------------
# Generate a single name.
# --------------------------------------------------------------------------
def generateSingleName(self, gadgetName, language):
@@ -167,6 +176,7 @@
gadgetData['category'] = gadget.getDescription().getCategory()
gadgetData['author'] = gadget.getDescription().getAuthor()
gadgetData['platform'] = gadget.getDescription().getPlatform()
+ gadgetData['parentPluginUuid'] = gadget.getParentPlugin().getDescription().getUuid()
gadgetData['name'] = {}
gadgetData['description'] = {}
gadgetData['helpFile'] = {}
Modified: software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/gadget/GadgetsOnlineContainer.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/gadget/GadgetsOnlineContainer.py 2009-10-16 09:41:56 UTC (rev 5713)
+++ software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/gadget/GadgetsOnlineContainer.py 2009-10-16 09:47:50 UTC (rev 5714)
@@ -154,6 +154,13 @@
cat = onlineGadget.getCategory()
if not cat.lower() in categories:
categories.append(cat.lower())
+ # Check the parent plugin
+ parentPluginUuid = onlineGadget.getParentPluginUuid()
+ if parentPluginUuid != "0":
+ pluginsContainer = self.__gadgetsContainer.getPluginsContainer()
+ parentPlugin = pluginsContainer.getPluginByUuid(parentPluginUuid)
+ if parentPlugin == None:
+ continue
# Check the category
if category != "all_gadgets":
if cat.lower() != category.lower():
|
|
From: jerome <c2m...@c2...> - 2009-10-16 09:42:08
|
Author: jerome Date: 2009-10-16 11:41:56 +0200 (Fri, 16 Oct 2009) New Revision: 5713 Modified: software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/com/kysoh/plugins/facebook/configuration/FacebookDatasStruct.java Log: * Updated source header. * Added package declaration. Modified: software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/com/kysoh/plugins/facebook/configuration/FacebookDatasStruct.java =================================================================== --- software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/com/kysoh/plugins/facebook/configuration/FacebookDatasStruct.java 2009-10-16 09:35:26 UTC (rev 5712) +++ software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/com/kysoh/plugins/facebook/configuration/FacebookDatasStruct.java 2009-10-16 09:41:56 UTC (rev 5713) @@ -1,25 +1,27 @@ -/* This file is part of "TuxDroid Gadget Facebook". +/* This file is part of "TuxDroid plugin Facebook". * Copyright 2009, kysoh * Author : Conan Jerome. * eMail : jer...@ky... * Site : http://www.kysoh.com/ * - * "TuxDroid Gadget Facebook" is free software; you can redistribute it and/or + * "TuxDroid plugin Facebook" is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * - * "TuxDroid Gadget Facebook" is distributed in the hope that it will be useful, + * "TuxDroid plugin Facebook" is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public - * License along with "TuxDroid Gadget Facebook"; if not, write to the Free + * License along with "TuxDroid plugin Facebook"; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ +package com.kysoh.plugins.facebook.configuration; + import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; |
|
From: jerome <c2m...@c2...> - 2009-10-16 09:35:37
|
Author: jerome Date: 2009-10-16 11:35:26 +0200 (Fri, 16 Oct 2009) New Revision: 5712 Added: software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/com/kysoh/plugins/facebook/configuration/FacebookDatasStruct.java Log: * Added an object to store session history. Added: software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/com/kysoh/plugins/facebook/configuration/FacebookDatasStruct.java =================================================================== --- software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/com/kysoh/plugins/facebook/configuration/FacebookDatasStruct.java (rev 0) +++ software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/com/kysoh/plugins/facebook/configuration/FacebookDatasStruct.java 2009-10-16 09:35:26 UTC (rev 5712) @@ -0,0 +1,285 @@ +/* This file is part of "TuxDroid Gadget Facebook". + * Copyright 2009, kysoh + * Author : Conan Jerome. + * eMail : jer...@ky... + * Site : http://www.kysoh.com/ + * + * "TuxDroid Gadget Facebook" is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * "TuxDroid Gadget Facebook" is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with "TuxDroid Gadget Facebook"; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.io.Serializable; +import java.util.Vector; + +public class FacebookDatasStruct extends Object implements Serializable{ + + private static final long serialVersionUID = 8395814134877723556L; + + public static final byte FRIENDS_QUERIES = 0; + public static final byte GROUP_INVITES = 1; + public static final byte EVENT_INVITE = 2; + public static final byte MESSAGES = 3; + public static final byte POKES = 4; + + public SerializedVector vktStruct; + private File structFile; + private boolean firstCycle; + + + + + public FacebookDatasStruct(String username) + { + //tds = tuxdroid datas saved. + + File path = new File(""); + structFile = new File( path.getAbsolutePath() + File.separator + username + "@facebook.sav"); + + if(structFile.exists()) + { + //Getting serialized object struct. + this.firstCycle = false; + vktStruct = this.loadStruct(); + } + else + { + this.firstCycle = true; + //Create struct. + vktStruct = new SerializedVector(); + if(vktStruct == null) + { + vktStruct = new SerializedVector(); + } + } + } + + + /** + * Regiter the structure. + */ + public void registerStruct() + { + if(this.vktStruct.size() <= 0) + { + return; + } + + try + { + FileOutputStream file = new FileOutputStream(this.structFile); + ObjectOutputStream oos = new ObjectOutputStream(file); + oos.writeObject(this.vktStruct); + oos.flush(); + oos.close(); + } + catch (java.io.IOException e) + { + e.printStackTrace(); + } + } + + + + /** + * Load the twitterDatasStruct object. + */ + private SerializedVector loadStruct() + { + try + { + FileInputStream fichier = new FileInputStream(this.structFile); + ObjectInputStream ois = new ObjectInputStream(fichier); + return (SerializedVector) ois.readObject(); + } + catch (java.io.IOException e) + { + e.printStackTrace(); + } + catch (ClassNotFoundException e) + { + e.printStackTrace(); + } + return null; + } + + + /** + * Add a message to the message hashtable. + */ + public void addMessage(String uuid) + { + this.vktStruct.addMessage(uuid); + } + + + /** + * Add a reply to the reply hashtable. + */ + public void addEventInvite(String uuid) + { + this.vktStruct.addEventInvite(uuid); + } + + + /** + * Add a status for selected friend. + */ + public void addFriendRequest(String uuid) + { + this.vktStruct.addFriendQuery(uuid); + } + + /** + * Add a reply to the reply hashtable. + */ + public void addPoke(String uuid) + { + this.vktStruct.addPoke(uuid); + } + + + /** + * Add a status for selected friend. + */ + public void addGroupInvite(String uuid) + { + this.vktStruct.addGroupInvite(uuid); + } + + + + /** + * This function return the state of cycle ( first start or not for the current user ). + * @return + */ + public boolean isFirstCycle() + { + return this.firstCycle; + } + + /** + * Return true if the target is registered. + * @param uuid. + * @return + */ + public boolean isRegistered(byte list, String uuid) + { + + switch(list) + { + case FacebookDatasStruct.FRIENDS_QUERIES: + return vktStruct.FID.contains(uuid); + + case FacebookDatasStruct.MESSAGES: + return vktStruct.MES.contains(uuid); + + case FacebookDatasStruct.GROUP_INVITES: + return vktStruct.GID.contains(uuid); + + case FacebookDatasStruct.EVENT_INVITE: + return vktStruct.EID.contains(uuid); + + case FacebookDatasStruct.POKES: + return vktStruct.POK.contains(uuid); + + default: + return false; + } + } + + + + + /** + * Handle a serialized vector of vector<String> + */ + class SerializedVector extends Vector<Object> implements Serializable{ + + private static final long serialVersionUID = 7018170438526763010L; + + private Vector<String> GID = new Vector<String>(); + private Vector<String> FID = new Vector<String>(); + private Vector<String> POK = new Vector<String>(); + private Vector<String> EID = new Vector<String>(); + private Vector<String> MES = new Vector<String>(); + + public SerializedVector() + { + super(); + } + + /** + * Add a new message in the object. + */ + public void addMessage(String uuid) + { + if (! MES.contains(uuid)) + { + MES.add(uuid); + } + } + + + /** + * Add a new event invite in the object. + */ + public void addEventInvite(String uuid) + { + if (! EID.contains(uuid)) + { + EID.add(uuid); + } + } + + + /** + * Add a new user request in the object. + */ + public void addFriendQuery(String uuid) + { + if (! FID.contains(uuid)) + { + FID.add(uuid); + } + } + + /** + * Add a new user status in the object. + */ + public void addGroupInvite(String uuid) + { + if (! GID.contains(uuid)) + { + GID.add(uuid); + } + } + + /** + * Add a new poke notification in the object. + */ + public void addPoke(String uuid) + { + if (! POK.contains(uuid)) + { + POK.add(uuid); + } + } + } +} |
Author: jerome Date: 2009-10-16 11:31:59 +0200 (Fri, 16 Oct 2009) New Revision: 5711 Added: software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/com/ software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/com/kysoh/ software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/com/kysoh/plugins/ software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/com/kysoh/plugins/facebook/ software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/com/kysoh/plugins/facebook/FacebookConnection.java software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/com/kysoh/plugins/facebook/FacebookFunctions.java software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/com/kysoh/plugins/facebook/FacebookPlugin.java software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/com/kysoh/plugins/facebook/configuration/ software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/com/kysoh/plugins/facebook/configuration/PluginFacebookConfiguration.java software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/com/kysoh/plugins/facebook/connection/ Removed: software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/FacebookConnection.java software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/FacebookFunctions.java software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/FacebookPlugin.java Modified: software_suite_v3/software/plugin/plugin-facebook/branches/october_release/resources/plugin.xml Log: * Refactored project. Modified: software_suite_v3/software/plugin/plugin-facebook/branches/october_release/resources/plugin.xml =================================================================== --- software_suite_v3/software/plugin/plugin-facebook/branches/october_release/resources/plugin.xml 2009-10-16 09:22:44 UTC (rev 5710) +++ software_suite_v3/software/plugin/plugin-facebook/branches/october_release/resources/plugin.xml 2009-10-16 09:31:59 UTC (rev 5711) @@ -2,7 +2,7 @@ <plugin> <interpreter kind="java"> - <executable> FacebookPlugin</executable> + <executable> com.kysoh.plugins.facebook.FacebookPlugin</executable> </interpreter> <description> <name>Facebook Plugin</name> Deleted: software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/FacebookConnection.java =================================================================== --- software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/FacebookConnection.java 2009-10-16 09:22:44 UTC (rev 5710) +++ software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/FacebookConnection.java 2009-10-16 09:31:59 UTC (rev 5711) @@ -1,67 +0,0 @@ -/* This file is part of "TuxDroid plugin Facebook". - * Copyright 2009, kysoh - * Author : Conan Jerome. - * eMail : jer...@ky... - * Site : http://www.kysoh.com/ - * - * "TuxDroid plugin Facebook" is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * "TuxDroid plugin Facebook" is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with "TuxDroid plugin Facebook"; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. - */ - -import com.google.code.facebookapi.FacebookJsonRestClient; - -public class FacebookConnection { - - public static String api_key = "a9eb7b7e52df160fb1dfc437b0b487c8"; - public static String f_key = "0314c8569f89d0411e5a4823372ae27a"; - private FacebookJsonRestClient client; - - - /** - * Class constructor. - */ - public FacebookConnection() - { - //TODO facebook connection. - } - - - public boolean Connect(String username, String password) - { - return true; - } - - - /** - * This function return the facebook user id. - * @return - */ - public Long getFacebookUserId() - { - //TODO - return null; - } - - - /** - * Return the JSon Facebook client object. - * @return - */ - public FacebookJsonRestClient getClient() - { - //TODO - return null; - } -} Deleted: software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/FacebookFunctions.java =================================================================== --- software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/FacebookFunctions.java 2009-10-16 09:22:44 UTC (rev 5710) +++ software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/FacebookFunctions.java 2009-10-16 09:31:59 UTC (rev 5711) @@ -1,517 +0,0 @@ -/* This file is part of "TuxDroid plugin Facebook". - * Copyright 2009, kysoh - * Author : Conan Jerome. - * eMail : jer...@ky... - * Site : http://www.kysoh.com/ - * - * "TuxDroid plugin Facebook" is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * "TuxDroid plugin Facebook" is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with "TuxDroid plugin Facebook"; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. - */ - - -import java.util.EnumSet; -import java.util.Hashtable; -import java.util.List; -import java.util.Vector; - -import com.google.code.facebookapi.FacebookException; -import com.google.code.facebookapi.ProfileField; -import com.google.code.facebookapi.schema.FriendsGetResponse; -import com.google.code.facebookapi.schema.User; -import com.google.code.facebookapi.schema.UsersGetInfoResponse; - - -public class FacebookFunctions { - - private FacebookConnection connection; - private Hashtable<String, Vector<String>> notifications = new Hashtable<String, Vector<String>>(); - - /** - * Class constructor. - * @param connection - */ - public FacebookFunctions(FacebookConnection connection) - { - this.connection = connection; - this.notifications = this.getUserNotification(); - } - - - /** - * Return the user friend list as Vector<String>. - * @return - */ - public Vector<String> getFriends() - { - Vector<String> friendsList = new Vector<String>(); - - try - { - // Get friends list - connection.getClient().friends_get(); - FriendsGetResponse response = (FriendsGetResponse) connection.getClient().getResponsePOJO(); - List<Long> friends = response.getUid(); - - // Go fetch the information for the user list of user ids - connection.getClient().users_getInfo(friends, EnumSet.of(ProfileField.NAME)); - - UsersGetInfoResponse userResponse = (UsersGetInfoResponse) connection.getClient().getResponsePOJO(); - - // Print out the user information - List<User> users = userResponse.getUser(); - for (User user : users) - { - friendsList.add(user.getName()); - } - } - catch (FacebookException e) - { - return null; - } - - return friendsList; - } - - - /** - * Gets all notifications. - */ - private Hashtable<String, Vector<String>> getUserNotification() - { - //Will contain all availables notifications. - //availables notifications : messages, pokes, shares, friends_requests, group_invites, event_invites - Hashtable<String, Vector<String>> notifications = new Hashtable<String, Vector<String>>(); - - try - { - connection.getClient().notifications_get(); - String notifs = connection.getClient().getRawResponse(); - - /** - * Getting messages notifications. - */ - if(notifs.contains("<messages")) - { - String messagesString = notifs.substring( - notifs.indexOf("<messages"), - notifs.indexOf("</messages>")); - - Vector<String> msDatas = new Vector<String>(); - - String unreaded = messagesString.substring( - messagesString.indexOf("<unread>") + "<unread>".length(), - messagesString.indexOf("</unread>")); - - msDatas.add(unreaded); - - - if(Integer.valueOf(unreaded).intValue() > 0) - { - notifications.put("messages", msDatas); - } - } - - /** - * Getting pokes notifications. - */ - if(notifs.contains("<pokes")) - { - String pokesString; - - try - { - pokesString = notifs.substring(notifs.indexOf("<pokes"), notifs.indexOf("</pokes>")); - } - catch(IndexOutOfBoundsException indexError) - { - pokesString = notifs.substring(notifs.indexOf("<pokes"), notifs.indexOf("/>")); - } - - Vector<String> pkDatas = new Vector<String>(); - - String unreaded = pokesString.substring( - pokesString.indexOf("<unread>") + "<unread>".length(), - pokesString.indexOf("</unread>")); - - pkDatas.add(unreaded); - - if(Integer.valueOf(unreaded).intValue() > 0 ) - { - notifications.put("pokes", pkDatas); - } - } - - /** - * Getting shares notifications. - */ - if(notifs.contains("<shares")) - { - String sharesString; - - try - { - sharesString = notifs.substring(notifs.indexOf("<shares"), notifs.indexOf("</shares>")); - } - catch(IndexOutOfBoundsException indexError) - { - sharesString = notifs.substring(notifs.indexOf("<shares"), notifs.indexOf("/>")); - } - - Vector<String> shDatas = new Vector<String>(); - - String unreaded = sharesString.substring( - sharesString.indexOf("<unread>") + "<unread>".length(), - sharesString.indexOf("</unread>")); - - shDatas.add(unreaded); - - if(Integer.valueOf(unreaded).intValue() > 0) - { - notifications.put("shares", shDatas); - } - } - - /** - * Get the friend_requests notifications. - */ - if(notifs.contains("<friend_requests")) - { - - String friendsString = ""; - try - { - friendsString = notifs.substring(notifs.indexOf("<friend_requests"), notifs.indexOf("</friend_requests>")); - } - catch(StringIndexOutOfBoundsException no) - { - friendsString = notifs.substring(notifs.indexOf("<friend_requests"), notifs.indexOf("/>", notifs.indexOf("<friend_requests"))); - } - - Vector<String> friendsDatas = new Vector<String>(); - Vector<Long> friendsDatasAsLong = new Vector<Long>(); - - //Getting friends uid that ask for friends. - if(friendsString.contains("<uid>")) - { - while(friendsString.contains("<uid>")) - { - String friend = friendsString.substring( - friendsString.indexOf("<uid>") + "<uid>".length(), - friendsString.indexOf("</uid>")); - - friendsString = friendsString.replace("<uid>" + friend + "</uid>", ""); - - friendsDatasAsLong.add(Long.valueOf(friend).longValue()); - } - - - // Go fetch the information for the user list of user ids - connection.getClient().users_getInfo(friendsDatasAsLong, EnumSet.of(ProfileField.NAME)); - - UsersGetInfoResponse userResponse = (UsersGetInfoResponse) connection.getClient().getResponsePOJO(); - - // Print out the user information - List<User> users = userResponse.getUser(); - for (User user : users) - { - friendsDatas.add(user.getName()); - } - - notifications.put("friend_requests", friendsDatas); - } - } - - /** - * Getting new groups invitations. - */ - if(notifs.contains("<group_invites")) - { - String groupString; - - try - { - groupString = notifs.substring(notifs.indexOf("<group_invites"), notifs.indexOf("</group_invites>")); - } - catch(IndexOutOfBoundsException indexError) - { - groupString = notifs.substring(notifs.indexOf("<group_invites"), notifs.indexOf("/>", notifs.indexOf("<group_invites"))); - } - - Vector<Long> groupsDatasAsLong = new Vector<Long>(); - Vector<String> groupsDatas = new Vector<String>(); - - //Getting friends uid that ask for friends. - if(groupString.contains("<gid>")) - { - while(groupString.contains("<gid>")) - { - String friend = groupString.substring( - groupString.indexOf("<gid>") + "<gid>".length(), - groupString.indexOf("</gid>")); - - groupString = groupString.replace("<gid>" + friend + "</gid>", ""); - - groupsDatasAsLong.add(Long.valueOf(friend).longValue()); - } - - groupsDatas.add(String.valueOf(groupsDatasAsLong.size())); - - for(Long gid : groupsDatasAsLong) - { - try - { - Thread.sleep(200); - connection.getClient().fql_query("Select name from group WHERE gid=" + gid.longValue()); - String response = connection.getClient().getRawResponse(); - if(response.contains("<group>") && response.contains("<name>")) - { - String groupName = response.substring( - response.indexOf("<name>") + "<name>".length(), - response.indexOf("</name>", response.indexOf("<name>"))); - groupsDatas.add(groupName); - } - } - catch(Exception fqlError) - { - groupsDatas.add("Unknown group"); - } - } - - //Only if they have some group invites. - if(groupsDatasAsLong.size() > 0) - { - notifications.put("group_invites", groupsDatas); - } - } - } - - /** - * Getting new events invitations. - */ - if(notifs.contains("<event_invites")) - { - String eventString = ""; - try - { - eventString = notifs.substring(notifs.indexOf("<event_invites"), notifs.indexOf("/>", notifs.indexOf("<event_invites"))); - } - catch(IndexOutOfBoundsException indexError) - { - eventString = notifs.substring(notifs.indexOf("<event_invites"), notifs.indexOf("</event_invites>")); - } - - Vector<Long> eventsDatasAsLong = new Vector<Long>(); - Vector<String> eventsDatas = new Vector<String>(); - - //Getting friends uid that ask for friends. - if(eventString.contains("<eid>") || (eventString.contains("<event_invites_elt>"))) - { - while(eventString.contains("<eid>")) - { - String event = eventString.substring( - eventString.indexOf("<eid>") + "<eid>".length(), - eventString.indexOf("</eid>")); - - eventString = eventString.replace("<eid>" + event + "</eid>", ""); - - eventsDatasAsLong.add(Long.valueOf(event).longValue()); - } - - - while(eventString.contains("<event_invites_elt>")) - { - String event = eventString.substring( - eventString.indexOf("<event_invites_elt>") + "<event_invites_elt>".length(), - eventString.indexOf("</event_invites_elt>")); - - eventString = eventString.replace("<event_invites_elt>" + event + "</event_invites_elt>", ""); - eventsDatasAsLong.add(Long.valueOf(event).longValue()); - } - - //Adding the number of event invites. - eventsDatas.add(String.valueOf(eventsDatasAsLong.size())); - - for(Long eid : eventsDatasAsLong) - { - try - { - Thread.sleep(200); - connection.getClient().fql_query("Select name from event WHERE eid=" + eid.longValue()); - String response = connection.getClient().getRawResponse(); - if(response.contains("<event>") && response.contains("<name>")) - { - String groupName = response.substring( - response.indexOf("<name>") + "<name>".length(), - response.indexOf("</name>", response.indexOf("<name>"))); - eventsDatas.add(groupName); - } - } - catch(Exception fqlError) - { - eventsDatas.add("Unknown event"); - } - - } - - if(eventsDatasAsLong.size() > 0) - { - notifications.put("event_invites", eventsDatas); - } - } - } - } - catch (FacebookException e) - { - ; - } - - return notifications; - } - - - /** - * Return email notifications. - */ - public Integer getEmailNotifications() - { - if(this.notifications.containsKey("messages")) - { - return Integer.valueOf(this.notifications.get("messages").get(0)); - } - else - { - return 0; - } - } - - - /** - * Return how many pokes user has. - * @return - */ - public Integer getPokesCount() - { - if(this.notifications.containsKey("pokes")) - { - return Integer.valueOf(this.notifications.get("pokes").get(0)); - } - else - { - return 0; - } - } - - - /** - * Return the number of friend requests. - * @return - */ - public Integer getFriendRequestsCount() - { - if(this.notifications.containsKey("friend_requests")) - { - return Integer.valueOf(this.notifications.get("friend_requests").size()); - } - else - { - return 0; - } - } - - - /** - * Return the name of people that ask to be a friend of user. - * @return - */ - public Vector<String> getFriendRequestNames() - { - Vector<String> friends = new Vector<String>(); - - if(this.notifications.containsKey("friend_requests")) - { - Vector<String> dat = this.notifications.get("friend_requests"); - friends = dat; - } - return friends; - } - - - /** - * Return the number of availables groups invites. - * @return - */ - public Integer getGroupsInvitesCount() - { - if(this.notifications.containsKey("group_invites")) - { - return Integer.valueOf(this.notifications.get("group_invites").get(0)); - } - else - { - return 0; - } - } - - - /** - * Return the name of groups invites. - * @return - */ - public Vector<String> getGroupInvitesNames() - { - Vector<String> groups = new Vector<String>(); - - if(this.notifications.containsKey("group_invites")) - { - Vector<String> dat = this.notifications.get("group_invites"); - dat.remove(0); - groups = dat; - } - return groups; - } - - /** - * Return the number of events invites. - * @return - */ - public Integer getEventsInvitesCount() - { - if(this.notifications.containsKey("event_invites")) - { - return Integer.valueOf(this.notifications.get("event_invites").get(0)); - } - else - { - return 0; - } - } - - /** - * Return the name of events invites. - * @return - */ - public Vector<String> getEventInvitesNames() - { - Vector<String> events = new Vector<String>(); - - if(this.notifications.containsKey("event_invites")) - { - Vector<String> dat = this.notifications.get("event_invites"); - dat.remove(0); - events = dat; - } - return events; - } -} Deleted: software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/FacebookPlugin.java =================================================================== --- software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/FacebookPlugin.java 2009-10-16 09:22:44 UTC (rev 5710) +++ software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/FacebookPlugin.java 2009-10-16 09:31:59 UTC (rev 5711) @@ -1,231 +0,0 @@ -/* This file is part of "TuxDroid plugin Facebook". - * Copyright 2009, kysoh - * Author : Conan Jerome. - * eMail : jer...@ky... - * Site : http://www.kysoh.com/ - * - * "TuxDroid plugin Facebook" is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * "TuxDroid plugin Facebook" is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with "TuxDroid plugin Facebook"; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. - */ - -import com.kysoh.tuxdroid.plugin.framework.plugin.SimplePlugin; -import com.kysoh.plugins.facebook.configuration.PluginFacebookConfiguration; - - -public class FacebookPlugin extends SimplePlugin<PluginFacebookConfiguration>{ - - private boolean check = false; - - /** - * Gadget start method. - */ - @Override - protected void start() throws Throwable - { - boolean throwNotif = false; - boolean news = false; - - if(getCommand().equals("check")) - { - this.check = true; - } - FacebookConnection facebook = new FacebookConnection(); - if ( facebook.Connect(this.configuration().getLogin(), this.configuration().getPassword()) ) - { - FacebookFunctions functions = new FacebookFunctions(facebook); - - //Get email informations. - if(this.configuration().getNotifyEmail()) - { - if(functions.getEmailNotifications().intValue() > 0) - { - news = true; - if(this.check && (!throwNotif)) - { - throwNotif = true; - this.throwResult(true); - } - - if(functions.getEmailNotifications().intValue() == 1) - { - throwMessage("You have one new message"); - } - else - { - throwMessage("You have {0} new messages", functions.getEmailNotifications().intValue()); - } - } - } - - //Get friend requests notification. - if(this.configuration().getShowFriendRequests()) - { - if(functions.getFriendRequestsCount().intValue() > 0) - { - news = true; - if(this.check && (!throwNotif)) - { - throwNotif = true; - this.throwResult(true); - } - - if(functions.getFriendRequestsCount().intValue() == 1) - { - throwMessage("You have one friend request"); - } - else - { - throwMessage("You have {0} friend requests", functions.getFriendRequestsCount()); - } - - for(String friendName : functions.getFriendRequestNames()) - { - if(this.check && (!throwNotif)) - { - throwNotif = true; - this.throwResult(true); - } - throwMessage("From {0}", friendName); - } - } - } - - //Get group invites notifications. - if(this.configuration().getShowGroupsInvites()) - { - news = true; - if(functions.getGroupsInvitesCount().intValue() > 0) - { - if(this.check && (!throwNotif)) - { - throwNotif = true; - this.throwResult(true); - } - - if(functions.getGroupsInvitesCount().intValue() == 1) - { - throwMessage("You have one group invite"); - } - else - { - throwMessage("You have {0} group invites", functions.getGroupsInvitesCount().intValue()); - } - - for(String group : functions.getGroupInvitesNames()) - { - if(this.check && (!throwNotif)) - { - throwNotif = true; - this.throwResult(true); - } - throwMessage("to {0}", group); - } - } - } - - //Get pokes notification. - if(this.configuration().getShowEventsInvites()) - { - if(functions.getEventsInvitesCount().intValue() > 0) - { - news = true; - if(this.check && (!throwNotif)) - { - throwNotif = true; - this.throwResult(true); - } - - if(functions.getEventsInvitesCount().intValue() == 1) - { - throwMessage("You have one event invite"); - } - else - { - throwMessage("You have {0} event invites", functions.getEventsInvitesCount().intValue()); - } - - for(String event : functions.getEventInvitesNames()) - { - if(this.check && (!throwNotif)) - { - throwNotif = true; - this.throwResult(true); - } - throwMessage("to {0}", event); - } - } - } - - if(this.configuration().getShowPokes()) - { - if(functions.getPokesCount().intValue() > 0) - { - news = true; - if(this.check && (!throwNotif)) - { - throwNotif = true; - this.throwResult(true); - } - - if(functions.getPokesCount().intValue() == 1) - { - throwMessage("You have one poke"); - } - else - { - throwMessage("You have {0} pokes", functions.getPokesCount().intValue()); - } - } - } - - if((!throwNotif) && this.check ) - { - this.throwResult(false); - } - else if((!this.check) && (!news)) - { - this.throwMessage("Nothing new on your account"); - } - } - else - { - this.throwMessage("I cannot get connected to your facebook account."); - } - } - - - /** - * Main entry point. - * @param args - */ - public static void main(String[] args) - { - new FacebookPlugin().boot(args, new PluginFacebookConfiguration()); - } - - - @Override - protected void onPluginEvent(String arg0, String[] arg1) throws Throwable - { - ; - } - - - @Override - protected void onPluginStop() throws Throwable - { - ; - } -} Added: software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/com/kysoh/plugins/facebook/FacebookConnection.java =================================================================== --- software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/com/kysoh/plugins/facebook/FacebookConnection.java (rev 0) +++ software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/com/kysoh/plugins/facebook/FacebookConnection.java 2009-10-16 09:31:59 UTC (rev 5711) @@ -0,0 +1,69 @@ +/* This file is part of "TuxDroid plugin Facebook". + * Copyright 2009, kysoh + * Author : Conan Jerome. + * eMail : jer...@ky... + * Site : http://www.kysoh.com/ + * + * "TuxDroid plugin Facebook" is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * "TuxDroid plugin Facebook" is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with "TuxDroid plugin Facebook"; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ + +package com.kysoh.plugins.facebook; + +import com.google.code.facebookapi.FacebookJsonRestClient; + +public class FacebookConnection { + + public static String api_key = "a9eb7b7e52df160fb1dfc437b0b487c8"; + public static String f_key = "0314c8569f89d0411e5a4823372ae27a"; + private FacebookJsonRestClient client; + + + /** + * Class constructor. + */ + public FacebookConnection() + { + //TODO facebook connection. + } + + + public boolean Connect(String username, String password) + { + return true; + } + + + /** + * This function return the facebook user id. + * @return + */ + public Long getFacebookUserId() + { + //TODO + return null; + } + + + /** + * Return the JSon Facebook client object. + * @return + */ + public FacebookJsonRestClient getClient() + { + //TODO + return null; + } +} Added: software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/com/kysoh/plugins/facebook/FacebookFunctions.java =================================================================== --- software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/com/kysoh/plugins/facebook/FacebookFunctions.java (rev 0) +++ software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/com/kysoh/plugins/facebook/FacebookFunctions.java 2009-10-16 09:31:59 UTC (rev 5711) @@ -0,0 +1,519 @@ +/* This file is part of "TuxDroid plugin Facebook". + * Copyright 2009, kysoh + * Author : Conan Jerome. + * eMail : jer...@ky... + * Site : http://www.kysoh.com/ + * + * "TuxDroid plugin Facebook" is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * "TuxDroid plugin Facebook" is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with "TuxDroid plugin Facebook"; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ + +package com.kysoh.plugins.facebook; + + +import java.util.EnumSet; +import java.util.Hashtable; +import java.util.List; +import java.util.Vector; + +import com.google.code.facebookapi.FacebookException; +import com.google.code.facebookapi.ProfileField; +import com.google.code.facebookapi.schema.FriendsGetResponse; +import com.google.code.facebookapi.schema.User; +import com.google.code.facebookapi.schema.UsersGetInfoResponse; + + +public class FacebookFunctions { + + private FacebookConnection connection; + private Hashtable<String, Vector<String>> notifications = new Hashtable<String, Vector<String>>(); + + /** + * Class constructor. + * @param connection + */ + public FacebookFunctions(FacebookConnection connection) + { + this.connection = connection; + this.notifications = this.getUserNotification(); + } + + + /** + * Return the user friend list as Vector<String>. + * @return + */ + public Vector<String> getFriends() + { + Vector<String> friendsList = new Vector<String>(); + + try + { + // Get friends list + connection.getClient().friends_get(); + FriendsGetResponse response = (FriendsGetResponse) connection.getClient().getResponsePOJO(); + List<Long> friends = response.getUid(); + + // Go fetch the information for the user list of user ids + connection.getClient().users_getInfo(friends, EnumSet.of(ProfileField.NAME)); + + UsersGetInfoResponse userResponse = (UsersGetInfoResponse) connection.getClient().getResponsePOJO(); + + // Print out the user information + List<User> users = userResponse.getUser(); + for (User user : users) + { + friendsList.add(user.getName()); + } + } + catch (FacebookException e) + { + return null; + } + + return friendsList; + } + + + /** + * Gets all notifications. + */ + private Hashtable<String, Vector<String>> getUserNotification() + { + //Will contain all availables notifications. + //availables notifications : messages, pokes, shares, friends_requests, group_invites, event_invites + Hashtable<String, Vector<String>> notifications = new Hashtable<String, Vector<String>>(); + + try + { + connection.getClient().notifications_get(); + String notifs = connection.getClient().getRawResponse(); + + /** + * Getting messages notifications. + */ + if(notifs.contains("<messages")) + { + String messagesString = notifs.substring( + notifs.indexOf("<messages"), + notifs.indexOf("</messages>")); + + Vector<String> msDatas = new Vector<String>(); + + String unreaded = messagesString.substring( + messagesString.indexOf("<unread>") + "<unread>".length(), + messagesString.indexOf("</unread>")); + + msDatas.add(unreaded); + + + if(Integer.valueOf(unreaded).intValue() > 0) + { + notifications.put("messages", msDatas); + } + } + + /** + * Getting pokes notifications. + */ + if(notifs.contains("<pokes")) + { + String pokesString; + + try + { + pokesString = notifs.substring(notifs.indexOf("<pokes"), notifs.indexOf("</pokes>")); + } + catch(IndexOutOfBoundsException indexError) + { + pokesString = notifs.substring(notifs.indexOf("<pokes"), notifs.indexOf("/>")); + } + + Vector<String> pkDatas = new Vector<String>(); + + String unreaded = pokesString.substring( + pokesString.indexOf("<unread>") + "<unread>".length(), + pokesString.indexOf("</unread>")); + + pkDatas.add(unreaded); + + if(Integer.valueOf(unreaded).intValue() > 0 ) + { + notifications.put("pokes", pkDatas); + } + } + + /** + * Getting shares notifications. + */ + if(notifs.contains("<shares")) + { + String sharesString; + + try + { + sharesString = notifs.substring(notifs.indexOf("<shares"), notifs.indexOf("</shares>")); + } + catch(IndexOutOfBoundsException indexError) + { + sharesString = notifs.substring(notifs.indexOf("<shares"), notifs.indexOf("/>")); + } + + Vector<String> shDatas = new Vector<String>(); + + String unreaded = sharesString.substring( + sharesString.indexOf("<unread>") + "<unread>".length(), + sharesString.indexOf("</unread>")); + + shDatas.add(unreaded); + + if(Integer.valueOf(unreaded).intValue() > 0) + { + notifications.put("shares", shDatas); + } + } + + /** + * Get the friend_requests notifications. + */ + if(notifs.contains("<friend_requests")) + { + + String friendsString = ""; + try + { + friendsString = notifs.substring(notifs.indexOf("<friend_requests"), notifs.indexOf("</friend_requests>")); + } + catch(StringIndexOutOfBoundsException no) + { + friendsString = notifs.substring(notifs.indexOf("<friend_requests"), notifs.indexOf("/>", notifs.indexOf("<friend_requests"))); + } + + Vector<String> friendsDatas = new Vector<String>(); + Vector<Long> friendsDatasAsLong = new Vector<Long>(); + + //Getting friends uid that ask for friends. + if(friendsString.contains("<uid>")) + { + while(friendsString.contains("<uid>")) + { + String friend = friendsString.substring( + friendsString.indexOf("<uid>") + "<uid>".length(), + friendsString.indexOf("</uid>")); + + friendsString = friendsString.replace("<uid>" + friend + "</uid>", ""); + + friendsDatasAsLong.add(Long.valueOf(friend).longValue()); + } + + + // Go fetch the information for the user list of user ids + connection.getClient().users_getInfo(friendsDatasAsLong, EnumSet.of(ProfileField.NAME)); + + UsersGetInfoResponse userResponse = (UsersGetInfoResponse) connection.getClient().getResponsePOJO(); + + // Print out the user information + List<User> users = userResponse.getUser(); + for (User user : users) + { + friendsDatas.add(user.getName()); + } + + notifications.put("friend_requests", friendsDatas); + } + } + + /** + * Getting new groups invitations. + */ + if(notifs.contains("<group_invites")) + { + String groupString; + + try + { + groupString = notifs.substring(notifs.indexOf("<group_invites"), notifs.indexOf("</group_invites>")); + } + catch(IndexOutOfBoundsException indexError) + { + groupString = notifs.substring(notifs.indexOf("<group_invites"), notifs.indexOf("/>", notifs.indexOf("<group_invites"))); + } + + Vector<Long> groupsDatasAsLong = new Vector<Long>(); + Vector<String> groupsDatas = new Vector<String>(); + + //Getting friends uid that ask for friends. + if(groupString.contains("<gid>")) + { + while(groupString.contains("<gid>")) + { + String friend = groupString.substring( + groupString.indexOf("<gid>") + "<gid>".length(), + groupString.indexOf("</gid>")); + + groupString = groupString.replace("<gid>" + friend + "</gid>", ""); + + groupsDatasAsLong.add(Long.valueOf(friend).longValue()); + } + + groupsDatas.add(String.valueOf(groupsDatasAsLong.size())); + + for(Long gid : groupsDatasAsLong) + { + try + { + Thread.sleep(200); + connection.getClient().fql_query("Select name from group WHERE gid=" + gid.longValue()); + String response = connection.getClient().getRawResponse(); + if(response.contains("<group>") && response.contains("<name>")) + { + String groupName = response.substring( + response.indexOf("<name>") + "<name>".length(), + response.indexOf("</name>", response.indexOf("<name>"))); + groupsDatas.add(groupName); + } + } + catch(Exception fqlError) + { + groupsDatas.add("Unknown group"); + } + } + + //Only if they have some group invites. + if(groupsDatasAsLong.size() > 0) + { + notifications.put("group_invites", groupsDatas); + } + } + } + + /** + * Getting new events invitations. + */ + if(notifs.contains("<event_invites")) + { + String eventString = ""; + try + { + eventString = notifs.substring(notifs.indexOf("<event_invites"), notifs.indexOf("/>", notifs.indexOf("<event_invites"))); + } + catch(IndexOutOfBoundsException indexError) + { + eventString = notifs.substring(notifs.indexOf("<event_invites"), notifs.indexOf("</event_invites>")); + } + + Vector<Long> eventsDatasAsLong = new Vector<Long>(); + Vector<String> eventsDatas = new Vector<String>(); + + //Getting friends uid that ask for friends. + if(eventString.contains("<eid>") || (eventString.contains("<event_invites_elt>"))) + { + while(eventString.contains("<eid>")) + { + String event = eventString.substring( + eventString.indexOf("<eid>") + "<eid>".length(), + eventString.indexOf("</eid>")); + + eventString = eventString.replace("<eid>" + event + "</eid>", ""); + + eventsDatasAsLong.add(Long.valueOf(event).longValue()); + } + + + while(eventString.contains("<event_invites_elt>")) + { + String event = eventString.substring( + eventString.indexOf("<event_invites_elt>") + "<event_invites_elt>".length(), + eventString.indexOf("</event_invites_elt>")); + + eventString = eventString.replace("<event_invites_elt>" + event + "</event_invites_elt>", ""); + eventsDatasAsLong.add(Long.valueOf(event).longValue()); + } + + //Adding the number of event invites. + eventsDatas.add(String.valueOf(eventsDatasAsLong.size())); + + for(Long eid : eventsDatasAsLong) + { + try + { + Thread.sleep(200); + connection.getClient().fql_query("Select name from event WHERE eid=" + eid.longValue()); + String response = connection.getClient().getRawResponse(); + if(response.contains("<event>") && response.contains("<name>")) + { + String groupName = response.substring( + response.indexOf("<name>") + "<name>".length(), + response.indexOf("</name>", response.indexOf("<name>"))); + eventsDatas.add(groupName); + } + } + catch(Exception fqlError) + { + eventsDatas.add("Unknown event"); + } + + } + + if(eventsDatasAsLong.size() > 0) + { + notifications.put("event_invites", eventsDatas); + } + } + } + } + catch (FacebookException e) + { + ; + } + + return notifications; + } + + + /** + * Return email notifications. + */ + public Integer getEmailNotifications() + { + if(this.notifications.containsKey("messages")) + { + return Integer.valueOf(this.notifications.get("messages").get(0)); + } + else + { + return 0; + } + } + + + /** + * Return how many pokes user has. + * @return + */ + public Integer getPokesCount() + { + if(this.notifications.containsKey("pokes")) + { + return Integer.valueOf(this.notifications.get("pokes").get(0)); + } + else + { + return 0; + } + } + + + /** + * Return the number of friend requests. + * @return + */ + public Integer getFriendRequestsCount() + { + if(this.notifications.containsKey("friend_requests")) + { + return Integer.valueOf(this.notifications.get("friend_requests").size()); + } + else + { + return 0; + } + } + + + /** + * Return the name of people that ask to be a friend of user. + * @return + */ + public Vector<String> getFriendRequestNames() + { + Vector<String> friends = new Vector<String>(); + + if(this.notifications.containsKey("friend_requests")) + { + Vector<String> dat = this.notifications.get("friend_requests"); + friends = dat; + } + return friends; + } + + + /** + * Return the number of availables groups invites. + * @return + */ + public Integer getGroupsInvitesCount() + { + if(this.notifications.containsKey("group_invites")) + { + return Integer.valueOf(this.notifications.get("group_invites").get(0)); + } + else + { + return 0; + } + } + + + /** + * Return the name of groups invites. + * @return + */ + public Vector<String> getGroupInvitesNames() + { + Vector<String> groups = new Vector<String>(); + + if(this.notifications.containsKey("group_invites")) + { + Vector<String> dat = this.notifications.get("group_invites"); + dat.remove(0); + groups = dat; + } + return groups; + } + + /** + * Return the number of events invites. + * @return + */ + public Integer getEventsInvitesCount() + { + if(this.notifications.containsKey("event_invites")) + { + return Integer.valueOf(this.notifications.get("event_invites").get(0)); + } + else + { + return 0; + } + } + + /** + * Return the name of events invites. + * @return + */ + public Vector<String> getEventInvitesNames() + { + Vector<String> events = new Vector<String>(); + + if(this.notifications.containsKey("event_invites")) + { + Vector<String> dat = this.notifications.get("event_invites"); + dat.remove(0); + events = dat; + } + return events; + } +} Added: software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/com/kysoh/plugins/facebook/FacebookPlugin.java =================================================================== --- software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/com/kysoh/plugins/facebook/FacebookPlugin.java (rev 0) +++ software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/com/kysoh/plugins/facebook/FacebookPlugin.java 2009-10-16 09:31:59 UTC (rev 5711) @@ -0,0 +1,234 @@ +/* This file is part of "TuxDroid plugin Facebook". + * Copyright 2009, kysoh + * Author : Conan Jerome. + * eMail : jer...@ky... + * Site : http://www.kysoh.com/ + * + * "TuxDroid plugin Facebook" is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * "TuxDroid plugin Facebook" is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with "TuxDroid plugin Facebook"; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ + +package com.kysoh.plugins.facebook; + + +import com.kysoh.tuxdroid.plugin.framework.plugin.SimplePlugin; +import com.kysoh.plugins.facebook.configuration.PluginFacebookConfiguration; + + +public class FacebookPlugin extends SimplePlugin<PluginFacebookConfiguration>{ + + private boolean check = false; + + /** + * Gadget start method. + */ + @Override + protected void start() throws Throwable + { + boolean throwNotif = false; + boolean news = false; + + if(getCommand().equals("check")) + { + this.check = true; + } + FacebookConnection facebook = new FacebookConnection(); + if ( facebook.Connect(this.configuration().getLogin(), this.configuration().getPassword()) ) + { + FacebookFunctions functions = new FacebookFunctions(facebook); + + //Get email informations. + if(this.configuration().getNotifyEmail()) + { + if(functions.getEmailNotifications().intValue() > 0) + { + news = true; + if(this.check && (!throwNotif)) + { + throwNotif = true; + this.throwResult(true); + } + + if(functions.getEmailNotifications().intValue() == 1) + { + throwMessage("You have one new message"); + } + else + { + throwMessage("You have {0} new messages", functions.getEmailNotifications().intValue()); + } + } + } + + //Get friend requests notification. + if(this.configuration().getShowFriendRequests()) + { + if(functions.getFriendRequestsCount().intValue() > 0) + { + news = true; + if(this.check && (!throwNotif)) + { + throwNotif = true; + this.throwResult(true); + } + + if(functions.getFriendRequestsCount().intValue() == 1) + { + throwMessage("You have one friend request"); + } + else + { + throwMessage("You have {0} friend requests", functions.getFriendRequestsCount()); + } + + for(String friendName : functions.getFriendRequestNames()) + { + if(this.check && (!throwNotif)) + { + throwNotif = true; + this.throwResult(true); + } + throwMessage("From {0}", friendName); + } + } + } + + //Get group invites notifications. + if(this.configuration().getShowGroupsInvites()) + { + news = true; + if(functions.getGroupsInvitesCount().intValue() > 0) + { + if(this.check && (!throwNotif)) + { + throwNotif = true; + this.throwResult(true); + } + + if(functions.getGroupsInvitesCount().intValue() == 1) + { + throwMessage("You have one group invite"); + } + else + { + throwMessage("You have {0} group invites", functions.getGroupsInvitesCount().intValue()); + } + + for(String group : functions.getGroupInvitesNames()) + { + if(this.check && (!throwNotif)) + { + throwNotif = true; + this.throwResult(true); + } + throwMessage("to {0}", group); + } + } + } + + //Get pokes notification. + if(this.configuration().getShowEventsInvites()) + { + if(functions.getEventsInvitesCount().intValue() > 0) + { + news = true; + if(this.check && (!throwNotif)) + { + throwNotif = true; + this.throwResult(true); + } + + if(functions.getEventsInvitesCount().intValue() == 1) + { + throwMessage("You have one event invite"); + } + else + { + throwMessage("You have {0} event invites", functions.getEventsInvitesCount().intValue()); + } + + for(String event : functions.getEventInvitesNames()) + { + if(this.check && (!throwNotif)) + { + throwNotif = true; + this.throwResult(true); + } + throwMessage("to {0}", event); + } + } + } + + if(this.configuration().getShowPokes()) + { + if(functions.getPokesCount().intValue() > 0) + { + news = true; + if(this.check && (!throwNotif)) + { + throwNotif = true; + this.throwResult(true); + } + + if(functions.getPokesCount().intValue() == 1) + { + throwMessage("You have one poke"); + } + else + { + throwMessage("You have {0} pokes", functions.getPokesCount().intValue()); + } + } + } + + if((!throwNotif) && this.check ) + { + this.throwResult(false); + } + else if((!this.check) && (!news)) + { + this.throwMessage("Nothing new on your account"); + } + } + else + { + this.throwMessage("I cannot get connected to your facebook account."); + } + } + + + /** + * Main entry point. + * @param args + */ + public static void main(String[] args) + { + new FacebookPlugin().boot(args, new PluginFacebookConfiguration()); + } + + + @Override + protected void onPluginEvent(String arg0, String[] arg1) throws Throwable + { + ; + } + + + @Override + protected void onPluginStop() throws Throwable + { + ; + } +} Added: software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/com/kysoh/plugins/facebook/configuration/PluginFacebookConfiguration.java =================================================================== --- software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/com/kysoh/plugins/facebook/configuration/PluginFacebookConfiguration.java (rev 0) +++ software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/com/kysoh/plugins/facebook/configuration/PluginFacebookConfiguration.java 2009-10-16 09:31:59 UTC (rev 5711) @@ -0,0 +1,171 @@ +/* This file is part of "TuxDroid plugin Facebook". + * Copyright 2009, kysoh + * Author : Conan Jerome. + * eMail : jer...@ky... + * Site : http://www.kysoh.com/ + * + * "TuxDroid plugin Facebook" is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * "TuxDroid plugin Facebook" is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with "TuxDroid plugin Facebook"; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ + +package com.kysoh.plugins.facebook.configuration; + +import com.kysoh.tuxdroid.plugin.framework.plugin.SimplePluginConfiguration; + +public class PluginFacebookConfiguration extends SimplePluginConfiguration{ + + private String login = ""; + private String password = ""; + + private boolean showFriendRequests = true; + private boolean showGroupsInvites = true; + private boolean showEventsInvites = true; + private boolean showPokes = true; + private boolean notifyEmail = true; + + /** + * Return the user login. + * @return + */ + public String getLogin() + { + return this.login; + } + + + /** + * Set the user login. + * @param aLogin + */ + public void setLogin(String aLogin) + { + this.login = aLogin; + } + + + /** + * Return tthe user password. + * @return + */ + public String getPassword() + { + return this.password; + } + + + /** + * Set the user password. + * @param aPassword + */ + public void setPassword(String aPassword) + { + this.password = aPassword; + } + + + /** + * Return true if user want to hear his email notifications. + * @return + */ + public boolean getNotifyEmail() + { + return this.notifyEmail; + } + + + /** + * Set the notify email parameter value. + * @param aNotifyEmail + */ + public void setNotifyEmail(boolean aNotifyEmail) + { + this.notifyEmail = aNotifyEmail; + } + + /** + * Return true if user want to hear his pokes notifications. + * @return + */ + public boolean getShowPokes() + { + return this.showPokes; + } + + + /** + * Set the show pokes parameter value. + * @param aShowPokes + */ + public void setShowPokes(boolean aShowPokes) + { + this.showPokes = aShowPokes; + } + + /** + * Return true if user want to hear his events invites. + * @return + */ + public boolean getShowEventsInvites() + { + return this.showEventsInvites; + } + + + /** + * Set the show events invites parameter value. + * @param aEventsInvites + */ + public void setShowEventsInvites(boolean aEventsInvites) + { + this.showEventsInvites = aEventsInvites; + } + + /** + * Return true if user want to hear his group invites. + * @return + */ + public boolean getShowGroupsInvites() + { + return this.showGroupsInvites; + } + + + /** + * Sets the show group invites parameter value. + * @param aShowGroupsInvites + */ + public void setShowGroupsInvites(boolean aShowGroupsInvites) + { + this.showGroupsInvites = aShowGroupsInvites; + } + + /** + * Return true if user want to hear his friend requests. + * @return + */ + public boolean getShowFriendRequests() + { + return this.showFriendRequests; + } + + /** + * Set the friend request value. + * @param aShowFriendRequests + */ + public void setShowFriendRequests(boolean aShowFriendRequests) + { + this.showFriendRequests = aShowFriendRequests; + } +} |
|
From: jerome <c2m...@c2...> - 2009-10-16 09:22:54
|
Author: jerome
Date: 2009-10-16 11:22:44 +0200 (Fri, 16 Oct 2009)
New Revision: 5710
Modified:
software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/FacebookPlugin.java
Log:
* Moved the configuration on a new package.
* Created new FB connection directory.
Modified: software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/FacebookPlugin.java
===================================================================
--- software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/FacebookPlugin.java 2009-10-16 09:14:49 UTC (rev 5709)
+++ software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/FacebookPlugin.java 2009-10-16 09:22:44 UTC (rev 5710)
@@ -21,169 +21,14 @@
*/
import com.kysoh.tuxdroid.plugin.framework.plugin.SimplePlugin;
-import com.kysoh.tuxdroid.plugin.framework.plugin.SimplePluginConfiguration;
+import com.kysoh.plugins.facebook.configuration.PluginFacebookConfiguration;
-/**
- * Facebook gadget class.
- * @author nux
- *
- */
-public class FacebookPlugin extends SimplePlugin<FacebookPlugin.Configuration>{
+
+public class FacebookPlugin extends SimplePlugin<PluginFacebookConfiguration>{
private boolean check = false;
/**
- * Configuration Class.
- * @author nux
- */
- public static class Configuration extends SimplePluginConfiguration{
-
- private String login = "";
- private String password = "";
-
- private boolean showFriendRequests = true;
- private boolean showGroupsInvites = true;
- private boolean showEventsInvites = true;
- private boolean showPokes = true;
- private boolean notifyEmail = true;
-
- /**
- * Return the user login.
- * @return
- */
- public String getLogin()
- {
- return this.login;
- }
-
-
- /**
- * Set the user login.
- * @param aLogin
- */
- public void setLogin(String aLogin)
- {
- this.login = aLogin;
- }
-
-
- /**
- * Return tthe user password.
- * @return
- */
- public String getPassword()
- {
- return this.password;
- }
-
-
- /**
- * Set the user password.
- * @param aPassword
- */
- public void setPassword(String aPassword)
- {
- this.password = aPassword;
- }
-
-
- /**
- * Return true if user want to hear his email notifications.
- * @return
- */
- public boolean getNotifyEmail()
- {
- return this.notifyEmail;
- }
-
-
- /**
- * Set the notify email parameter value.
- * @param aNotifyEmail
- */
- public void setNotifyEmail(boolean aNotifyEmail)
- {
- this.notifyEmail = aNotifyEmail;
- }
-
- /**
- * Return true if user want to hear his pokes notifications.
- * @return
- */
- public boolean getShowPokes()
- {
- return this.showPokes;
- }
-
-
- /**
- * Set the show pokes parameter value.
- * @param aShowPokes
- */
- public void setShowPokes(boolean aShowPokes)
- {
- this.showPokes = aShowPokes;
- }
-
- /**
- * Return true if user want to hear his events invites.
- * @return
- */
- public boolean getShowEventsInvites()
- {
- return this.showEventsInvites;
- }
-
-
- /**
- * Set the show events invites parameter value.
- * @param aEventsInvites
- */
- public void setShowEventsInvites(boolean aEventsInvites)
- {
- this.showEventsInvites = aEventsInvites;
- }
-
- /**
- * Return true if user want to hear his group invites.
- * @return
- */
- public boolean getShowGroupsInvites()
- {
- return this.showGroupsInvites;
- }
-
-
- /**
- * Sets the show group invites parameter value.
- * @param aShowGroupsInvites
- */
- public void setShowGroupsInvites(boolean aShowGroupsInvites)
- {
- this.showGroupsInvites = aShowGroupsInvites;
- }
-
- /**
- * Return true if user want to hear his friend requests.
- * @return
- */
- public boolean getShowFriendRequests()
- {
- return this.showFriendRequests;
- }
-
- /**
- * Set the friend request value.
- * @param aShowFriendRequests
- */
- public void setShowFriendRequests(boolean aShowFriendRequests)
- {
- this.showFriendRequests = aShowFriendRequests;
- }
- }
-
-
- /**
* Gadget start method.
*/
@Override
@@ -196,210 +41,178 @@
{
this.check = true;
}
-
- if ( !(this.configuration().notifyEmail || this.configuration().showEventsInvites || this.configuration().showFriendRequests
- || this.configuration().showGroupsInvites || this.configuration().showPokes))
+ FacebookConnection facebook = new FacebookConnection();
+ if ( facebook.Connect(this.configuration().getLogin(), this.configuration().getPassword()) )
{
- this.quitGadget();
- }
-
- if(true)
- {
- FacebookConnection facebook = new FacebookConnection();
- if ( facebook.Connect(this.configuration().getLogin(), this.configuration().getPassword()) )
+ FacebookFunctions functions = new FacebookFunctions(facebook);
+
+ //Get email informations.
+ if(this.configuration().getNotifyEmail())
{
- FacebookFunctions functions = new FacebookFunctions(facebook);
-
- //Get email informations.
- if(this.configuration().notifyEmail)
+ if(functions.getEmailNotifications().intValue() > 0)
{
- if(functions.getEmailNotifications().intValue() > 0)
+ news = true;
+ if(this.check && (!throwNotif))
{
- news = true;
- if(this.check && (!throwNotif))
- {
- throwNotif = true;
- this.throwResult(true);
- }
-
- if(functions.getEmailNotifications().intValue() == 1)
- {
- throwMessage("You have one new message");
- }
- else
- {
- throwMessage("You have {0} new messages", functions.getEmailNotifications().intValue());
- }
+ throwNotif = true;
+ this.throwResult(true);
}
+
+ if(functions.getEmailNotifications().intValue() == 1)
+ {
+ throwMessage("You have one new message");
+ }
+ else
+ {
+ throwMessage("You have {0} new messages", functions.getEmailNotifications().intValue());
+ }
}
-
- //Get friend requests notification.
- if(this.configuration().showFriendRequests)
+ }
+
+ //Get friend requests notification.
+ if(this.configuration().getShowFriendRequests())
+ {
+ if(functions.getFriendRequestsCount().intValue() > 0)
{
- if(functions.getFriendRequestsCount().intValue() > 0)
+ news = true;
+ if(this.check && (!throwNotif))
{
- news = true;
+ throwNotif = true;
+ this.throwResult(true);
+ }
+
+ if(functions.getFriendRequestsCount().intValue() == 1)
+ {
+ throwMessage("You have one friend request");
+ }
+ else
+ {
+ throwMessage("You have {0} friend requests", functions.getFriendRequestsCount());
+ }
+
+ for(String friendName : functions.getFriendRequestNames())
+ {
if(this.check && (!throwNotif))
{
throwNotif = true;
this.throwResult(true);
}
-
- if(functions.getFriendRequestsCount().intValue() == 1)
- {
- throwMessage("You have one friend request");
- }
- else
- {
- throwMessage("You have {0} friend requests", functions.getFriendRequestsCount());
- }
-
- for(String friendName : functions.getFriendRequestNames())
- {
- if(this.check && (!throwNotif))
- {
- throwNotif = true;
- this.throwResult(true);
- }
- throwMessage("From {0}", friendName);
- }
+ throwMessage("From {0}", friendName);
}
}
-
- //Get group invites notifications.
- if(this.configuration().showGroupsInvites)
+ }
+
+ //Get group invites notifications.
+ if(this.configuration().getShowGroupsInvites())
+ {
+ news = true;
+ if(functions.getGroupsInvitesCount().intValue() > 0)
{
- news = true;
- if(functions.getGroupsInvitesCount().intValue() > 0)
+ if(this.check && (!throwNotif))
{
+ throwNotif = true;
+ this.throwResult(true);
+ }
+
+ if(functions.getGroupsInvitesCount().intValue() == 1)
+ {
+ throwMessage("You have one group invite");
+ }
+ else
+ {
+ throwMessage("You have {0} group invites", functions.getGroupsInvitesCount().intValue());
+ }
+
+ for(String group : functions.getGroupInvitesNames())
+ {
if(this.check && (!throwNotif))
{
throwNotif = true;
this.throwResult(true);
}
-
- if(functions.getGroupsInvitesCount().intValue() == 1)
- {
- throwMessage("You have one group invite");
- }
- else
- {
- throwMessage("You have {0} group invites", functions.getGroupsInvitesCount().intValue());
- }
-
- for(String group : functions.getGroupInvitesNames())
- {
- if(this.check && (!throwNotif))
- {
- throwNotif = true;
- this.throwResult(true);
- }
- throwMessage("to {0}", group);
- }
+ throwMessage("to {0}", group);
}
}
-
- //Get pokes notification.
- if(this.configuration().showEventsInvites)
+ }
+
+ //Get pokes notification.
+ if(this.configuration().getShowEventsInvites())
+ {
+ if(functions.getEventsInvitesCount().intValue() > 0)
{
- if(functions.getEventsInvitesCount().intValue() > 0)
+ news = true;
+ if(this.check && (!throwNotif))
{
- news = true;
+ throwNotif = true;
+ this.throwResult(true);
+ }
+
+ if(functions.getEventsInvitesCount().intValue() == 1)
+ {
+ throwMessage("You have one event invite");
+ }
+ else
+ {
+ throwMessage("You have {0} event invites", functions.getEventsInvitesCount().intValue());
+ }
+
+ for(String event : functions.getEventInvitesNames())
+ {
if(this.check && (!throwNotif))
{
throwNotif = true;
this.throwResult(true);
}
-
- if(functions.getEventsInvitesCount().intValue() == 1)
- {
- throwMessage("You have one event invite");
- }
- else
- {
- throwMessage("You have {0} event invites", functions.getEventsInvitesCount().intValue());
- }
-
- for(String event : functions.getEventInvitesNames())
- {
- if(this.check && (!throwNotif))
- {
- throwNotif = true;
- this.throwResult(true);
- }
- throwMessage("to {0}", event);
- }
+ throwMessage("to {0}", event);
}
}
-
- if(this.configuration().showPokes)
+ }
+
+ if(this.configuration().getShowPokes())
+ {
+ if(functions.getPokesCount().intValue() > 0)
{
- if(functions.getPokesCount().intValue() > 0)
+ news = true;
+ if(this.check && (!throwNotif))
{
- news = true;
- if(this.check && (!throwNotif))
- {
- throwNotif = true;
- this.throwResult(true);
- }
-
- if(functions.getPokesCount().intValue() == 1)
- {
- throwMessage("You have one poke");
- }
- else
- {
- throwMessage("You have {0} pokes", functions.getPokesCount().intValue());
- }
+ throwNotif = true;
+ this.throwResult(true);
}
+
+ if(functions.getPokesCount().intValue() == 1)
+ {
+ throwMessage("You have one poke");
+ }
+ else
+ {
+ throwMessage("You have {0} pokes", functions.getPokesCount().intValue());
+ }
}
-
- if((!throwNotif) && this.check )
- {
- this.throwResult(false);
- }
- else if((!this.check) && (!news))
- {
- this.throwMessage("Nothing new on your account");
- }
}
- else
+
+ if((!throwNotif) && this.check )
{
- this.throwMessage("I cannot get connected to your facebook account.");
+ this.throwResult(false);
}
+ else if((!this.check) && (!news))
+ {
+ this.throwMessage("Nothing new on your account");
+ }
}
else
{
- if(!this.check)
- {
- throwMessage("I must be connected to access your facebook account.");
- }
- else
- {
- this.throwResult(false);
- }
+ this.throwMessage("I cannot get connected to your facebook account.");
}
-
- this.quitGadget();
}
/**
- * Called when user stop the gadget.
- */
- private void quitGadget()
- {
- System.exit(0);
- }
-
-
- /**
* Main entry point.
* @param args
*/
public static void main(String[] args)
{
- new FacebookPlugin().boot(args, new Configuration());
+ new FacebookPlugin().boot(args, new PluginFacebookConfiguration());
}
|
|
From: jerome <c2m...@c2...> - 2009-10-16 09:15:06
|
Author: jerome Date: 2009-10-16 11:14:49 +0200 (Fri, 16 Oct 2009) New Revision: 5709 Modified: software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/FacebookConnection.java software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/FacebookFunctions.java software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/FacebookPlugin.java Log: * Fixed source headers. Modified: software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/FacebookConnection.java =================================================================== --- software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/FacebookConnection.java 2009-10-16 09:10:53 UTC (rev 5708) +++ software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/FacebookConnection.java 2009-10-16 09:14:49 UTC (rev 5709) @@ -1,21 +1,21 @@ -/* This file is part of "TuxDroid Gadget Facebook". +/* This file is part of "TuxDroid plugin Facebook". * Copyright 2009, kysoh * Author : Conan Jerome. * eMail : jer...@ky... * Site : http://www.kysoh.com/ * - * "TuxDroid Gadget Facebook" is free software; you can redistribute it and/or + * "TuxDroid plugin Facebook" is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * - * "TuxDroid Gadget Facebook" is distributed in the hope that it will be useful, + * "TuxDroid plugin Facebook" is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public - * License along with "TuxDroid Gadget Facebook"; if not, write to the Free + * License along with "TuxDroid plugin Facebook"; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ Modified: software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/FacebookFunctions.java =================================================================== --- software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/FacebookFunctions.java 2009-10-16 09:10:53 UTC (rev 5708) +++ software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/FacebookFunctions.java 2009-10-16 09:14:49 UTC (rev 5709) @@ -1,21 +1,21 @@ -/* This file is part of "TuxDroid Gadget Facebook". +/* This file is part of "TuxDroid plugin Facebook". * Copyright 2009, kysoh * Author : Conan Jerome. * eMail : jer...@ky... * Site : http://www.kysoh.com/ * - * "TuxDroid Gadget Facebook" is free software; you can redistribute it and/or + * "TuxDroid plugin Facebook" is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * - * "TuxDroid Gadget Facebook" is distributed in the hope that it will be useful, + * "TuxDroid plugin Facebook" is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public - * License along with "TuxDroid Gadget Facebook"; if not, write to the Free + * License along with "TuxDroid plugin Facebook"; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ Modified: software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/FacebookPlugin.java =================================================================== --- software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/FacebookPlugin.java 2009-10-16 09:10:53 UTC (rev 5708) +++ software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/FacebookPlugin.java 2009-10-16 09:14:49 UTC (rev 5709) @@ -1,21 +1,21 @@ -/* This file is part of "TuxDroid Gadget Facebook". +/* This file is part of "TuxDroid plugin Facebook". * Copyright 2009, kysoh * Author : Conan Jerome. * eMail : jer...@ky... * Site : http://www.kysoh.com/ * - * "TuxDroid Gadget Facebook" is free software; you can redistribute it and/or + * "TuxDroid plugin Facebook" is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * - * "TuxDroid Gadget Facebook" is distributed in the hope that it will be useful, + * "TuxDroid plugin Facebook" is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public - * License along with "TuxDroid Gadget Facebook"; if not, write to the Free + * License along with "TuxDroid plugin Facebook"; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ |
|
From: jerome <c2m...@c2...> - 2009-10-16 09:11:06
|
Author: jerome Date: 2009-10-16 11:10:53 +0200 (Fri, 16 Oct 2009) New Revision: 5708 Removed: software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/BareBonesBrowserLaunch.java Log: * Removed browser launcher. Deleted: software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/BareBonesBrowserLaunch.java =================================================================== --- software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/BareBonesBrowserLaunch.java 2009-10-16 09:04:39 UTC (rev 5707) +++ software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/BareBonesBrowserLaunch.java 2009-10-16 09:10:53 UTC (rev 5708) @@ -1,52 +0,0 @@ -///////////////////////////////////////////////////////// -// Bare Bones Browser Launch // -// Version 1.5 // -// December 10, 2005 // -// Supports: Mac OS X, GNU/Linux, Unix, Windows XP // -// Example Usage: // -// String url = "http://www.centerkey.com/"; // -// BareBonesBrowserLaunch.openURL(url); // -// Public Domain Software -- Free to Use as You Like // -///////////////////////////////////////////////////////// - -import java.lang.reflect.Method; - -public class BareBonesBrowserLaunch -{ - - @SuppressWarnings("unchecked") - public static void openURL(String url) - { - String osName = System.getProperty("os.name"); - try - { - if (osName.startsWith("Mac OS")) - { - Class fileMgr = Class.forName("com.apple.eio.FileManager"); - Method openURL = fileMgr.getDeclaredMethod("openURL", - new Class[] {String.class}); - openURL.invoke(null, new Object[] {url}); - } - else if (osName.startsWith("Windows")) - Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + url); - else - { //assume Unix or Linux - String[] browsers = { - "firefox", "opera", "konqueror", "epiphany", "mozilla", "netscape" }; - String browser = null; - for (int count = 0; count < browsers.length && browser == null; count++) - if (Runtime.getRuntime().exec( - new String[] {"which", browsers[count]}).waitFor() == 0) - browser = browsers[count]; - if (browser == null) - throw new Exception("Could not find web browser"); - else - Runtime.getRuntime().exec(new String[] {browser, url}); - } - } - catch (Exception e) - { - } - } -} - |
|
From: jerome <c2m...@c2...> - 2009-10-16 09:04:52
|
Author: jerome Date: 2009-10-16 11:04:39 +0200 (Fri, 16 Oct 2009) New Revision: 5707 Modified: software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/FacebookConnection.java software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/FacebookFunctions.java software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/FacebookPlugin.java Log: * Removed old connection job. Modified: software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/FacebookConnection.java =================================================================== --- software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/FacebookConnection.java 2009-10-16 08:44:43 UTC (rev 5706) +++ software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/FacebookConnection.java 2009-10-16 09:04:39 UTC (rev 5707) @@ -20,90 +20,27 @@ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -import java.io.File; -import java.io.IOException; +import com.google.code.facebookapi.FacebookJsonRestClient; -import com.facebook.api.FacebookException; -import com.facebook.api.FacebookRestClient; - public class FacebookConnection { public static String api_key = "a9eb7b7e52df160fb1dfc437b0b487c8"; public static String f_key = "0314c8569f89d0411e5a4823372ae27a"; - private FacebookRestClient client; - private Long userId; - private boolean state = true; + private FacebookJsonRestClient client; + /** * Class constructor. */ - public FacebookConnection(FacebookPlugin plugin, String login, String password) + public FacebookConnection() { - try - { - //Create the client instance - client = new FacebookRestClient(FacebookConnection.api_key, FacebookConnection.f_key); - - //Is this a desktop app - client.setIsDesktop(true); - - //Getting an auth-token to log in with - String token = client.auth_createToken(); - - // Build the authentication URL for the user to fill out - String url = "http://www.facebook.com/login.php?api_key=" + FacebookConnection.api_key + "&v=1.0" + "&auth_token=" + token; - - - File app = new File("./resources/Facebook_connection.exe"); - - if(app.exists()) - { - - String[] cmd = new String[]{app.getAbsolutePath(), url, login, password}; - - Process log = Runtime.getRuntime().exec(cmd); - try - { - log.waitFor(); - } - catch (InterruptedException e) - { - e.printStackTrace(); - } - } - - // fetch session key - String session = client.auth_getSession(token); - - if(session == null) - { - plugin.throwMessage("I cannot get connected to your facebook account."); - state = false; - } - - // keep track of the logged in user id - userId = client.users_getLoggedInUser(); - } - catch(FacebookException connectionError) - { - plugin.throwMessage("I cannot get connected to your facebook account."); - state = false; - } - catch (IOException e) - { - e.printStackTrace(); - state = false; - } + //TODO facebook connection. } - /** - * Return the connection state. - * @return - */ - public synchronized boolean getState() + public boolean Connect(String username, String password) { - return this.state; + return true; } @@ -113,16 +50,18 @@ */ public Long getFacebookUserId() { - return this.userId; + //TODO + return null; } /** - * Return the JSon object. + * Return the JSon Facebook client object. * @return */ - public FacebookRestClient getClient() + public FacebookJsonRestClient getClient() { - return this.client; + //TODO + return null; } } Modified: software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/FacebookFunctions.java =================================================================== --- software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/FacebookFunctions.java 2009-10-16 08:44:43 UTC (rev 5706) +++ software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/FacebookFunctions.java 2009-10-16 09:04:39 UTC (rev 5707) @@ -21,19 +21,16 @@ */ -import java.io.IOException; import java.util.EnumSet; import java.util.Hashtable; import java.util.List; import java.util.Vector; -import com.facebook.api.FacebookException; -import com.facebook.api.ProfileField; -import com.facebook.api.schema.Event; -import com.facebook.api.schema.EventsGetResponse; -import com.facebook.api.schema.FriendsGetResponse; -import com.facebook.api.schema.User; -import com.facebook.api.schema.UsersGetInfoResponse; +import com.google.code.facebookapi.FacebookException; +import com.google.code.facebookapi.ProfileField; +import com.google.code.facebookapi.schema.FriendsGetResponse; +import com.google.code.facebookapi.schema.User; +import com.google.code.facebookapi.schema.UsersGetInfoResponse; public class FacebookFunctions { @@ -83,10 +80,6 @@ { return null; } - catch (IOException e) - { - return null; - } return friendsList; } @@ -383,10 +376,6 @@ { ; } - catch (IOException e) - { - ; - } return notifications; } Modified: software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/FacebookPlugin.java =================================================================== --- software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/FacebookPlugin.java 2009-10-16 08:44:43 UTC (rev 5706) +++ software_suite_v3/software/plugin/plugin-facebook/branches/october_release/src/FacebookPlugin.java 2009-10-16 09:04:39 UTC (rev 5707) @@ -205,161 +205,168 @@ if(true) { - FacebookConnection facebook = new FacebookConnection(this, this.configuration().getLogin(), this.configuration().getPassword()); - FacebookFunctions functions = new FacebookFunctions(facebook); - - //Get email informations. - if(this.configuration().notifyEmail) + FacebookConnection facebook = new FacebookConnection(); + if ( facebook.Connect(this.configuration().getLogin(), this.configuration().getPassword()) ) { - if(functions.getEmailNotifications().intValue() > 0) + FacebookFunctions functions = new FacebookFunctions(facebook); + + //Get email informations. + if(this.configuration().notifyEmail) { - news = true; - if(this.check && (!throwNotif)) + if(functions.getEmailNotifications().intValue() > 0) { - throwNotif = true; - this.throwResult(true); + news = true; + if(this.check && (!throwNotif)) + { + throwNotif = true; + this.throwResult(true); + } + + if(functions.getEmailNotifications().intValue() == 1) + { + throwMessage("You have one new message"); + } + else + { + throwMessage("You have {0} new messages", functions.getEmailNotifications().intValue()); + } } - - if(functions.getEmailNotifications().intValue() == 1) - { - throwMessage("You have one new message"); - } - else - { - throwMessage("You have {0} new messages", functions.getEmailNotifications().intValue()); - } } - } - - //Get friend requests notification. - if(this.configuration().showFriendRequests) - { - if(functions.getFriendRequestsCount().intValue() > 0) + + //Get friend requests notification. + if(this.configuration().showFriendRequests) { - news = true; - if(this.check && (!throwNotif)) + if(functions.getFriendRequestsCount().intValue() > 0) { - throwNotif = true; - this.throwResult(true); - } - - if(functions.getFriendRequestsCount().intValue() == 1) - { - throwMessage("You have one friend request"); - } - else - { - throwMessage("You have {0} friend requests", functions.getFriendRequestsCount()); - } - - for(String friendName : functions.getFriendRequestNames()) - { + news = true; if(this.check && (!throwNotif)) { throwNotif = true; this.throwResult(true); } - throwMessage("From {0}", friendName); + + if(functions.getFriendRequestsCount().intValue() == 1) + { + throwMessage("You have one friend request"); + } + else + { + throwMessage("You have {0} friend requests", functions.getFriendRequestsCount()); + } + + for(String friendName : functions.getFriendRequestNames()) + { + if(this.check && (!throwNotif)) + { + throwNotif = true; + this.throwResult(true); + } + throwMessage("From {0}", friendName); + } } } - } - - //Get group invites notifications. - if(this.configuration().showGroupsInvites) - { - news = true; - if(functions.getGroupsInvitesCount().intValue() > 0) + + //Get group invites notifications. + if(this.configuration().showGroupsInvites) { - if(this.check && (!throwNotif)) + news = true; + if(functions.getGroupsInvitesCount().intValue() > 0) { - throwNotif = true; - this.throwResult(true); - } - - if(functions.getGroupsInvitesCount().intValue() == 1) - { - throwMessage("You have one group invite"); - } - else - { - throwMessage("You have {0} group invites", functions.getGroupsInvitesCount().intValue()); - } - - for(String group : functions.getGroupInvitesNames()) - { if(this.check && (!throwNotif)) { throwNotif = true; this.throwResult(true); } - throwMessage("to {0}", group); + + if(functions.getGroupsInvitesCount().intValue() == 1) + { + throwMessage("You have one group invite"); + } + else + { + throwMessage("You have {0} group invites", functions.getGroupsInvitesCount().intValue()); + } + + for(String group : functions.getGroupInvitesNames()) + { + if(this.check && (!throwNotif)) + { + throwNotif = true; + this.throwResult(true); + } + throwMessage("to {0}", group); + } } } - } - - //Get pokes notification. - if(this.configuration().showEventsInvites) - { - if(functions.getEventsInvitesCount().intValue() > 0) + + //Get pokes notification. + if(this.configuration().showEventsInvites) { - news = true; - if(this.check && (!throwNotif)) + if(functions.getEventsInvitesCount().intValue() > 0) { - throwNotif = true; - this.throwResult(true); - } - - if(functions.getEventsInvitesCount().intValue() == 1) - { - throwMessage("You have one event invite"); - } - else - { - throwMessage("You have {0} event invites", functions.getEventsInvitesCount().intValue()); - } - - for(String event : functions.getEventInvitesNames()) - { + news = true; if(this.check && (!throwNotif)) { throwNotif = true; this.throwResult(true); } - throwMessage("to {0}", event); + + if(functions.getEventsInvitesCount().intValue() == 1) + { + throwMessage("You have one event invite"); + } + else + { + throwMessage("You have {0} event invites", functions.getEventsInvitesCount().intValue()); + } + + for(String event : functions.getEventInvitesNames()) + { + if(this.check && (!throwNotif)) + { + throwNotif = true; + this.throwResult(true); + } + throwMessage("to {0}", event); + } } } - } - - if(this.configuration().showPokes) - { - if(functions.getPokesCount().intValue() > 0) + + if(this.configuration().showPokes) { - news = true; - if(this.check && (!throwNotif)) + if(functions.getPokesCount().intValue() > 0) { - throwNotif = true; - this.throwResult(true); + news = true; + if(this.check && (!throwNotif)) + { + throwNotif = true; + this.throwResult(true); + } + + if(functions.getPokesCount().intValue() == 1) + { + throwMessage("You have one poke"); + } + else + { + throwMessage("You have {0} pokes", functions.getPokesCount().intValue()); + } } - - if(functions.getPokesCount().intValue() == 1) - { - throwMessage("You have one poke"); - } - else - { - throwMessage("You have {0} pokes", functions.getPokesCount().intValue()); - } } + + if((!throwNotif) && this.check ) + { + this.throwResult(false); + } + else if((!this.check) && (!news)) + { + this.throwMessage("Nothing new on your account"); + } } - - if((!throwNotif) && this.check ) + else { - this.throwResult(false); + this.throwMessage("I cannot get connected to your facebook account."); } - else if((!this.check) && (!news) && (facebook.getState())) - { - this.throwMessage("Nothing new on your account"); - } } else { |
|
From: jerome <c2m...@c2...> - 2009-10-16 08:44:57
|
Author: jerome
Date: 2009-10-16 10:44:43 +0200 (Fri, 16 Oct 2009)
New Revision: 5706
Modified:
software_suite_v3/software/plugin/plugin-facebook/branches/october_release/pom.xml
Log:
* Updated dependencies.
Modified: software_suite_v3/software/plugin/plugin-facebook/branches/october_release/pom.xml
===================================================================
--- software_suite_v3/software/plugin/plugin-facebook/branches/october_release/pom.xml 2009-10-16 08:38:37 UTC (rev 5705)
+++ software_suite_v3/software/plugin/plugin-facebook/branches/october_release/pom.xml 2009-10-16 08:44:43 UTC (rev 5706)
@@ -38,7 +38,7 @@
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
- <version>2.1.3</version>
+ <version>2.1.9</version>
</dependency>
<dependency>
@@ -52,6 +52,11 @@
<version>2.1.1</version>
</dependency>
<dependency>
+ <groupId>com.google.code.facebookapi</groupId>
+ <artifactId>facebook-java-api-schema</artifactId>
+ <version>2.1.1</version>
+ </dependency>
+ <dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<version>3.1</version>
|