[tuxdroid-svn] r5689 - in software_suite_v3/software/plugin/plugin-twitter/trunk/plugin-twitter: .
Status: Beta
Brought to you by:
ks156
|
From: ks156 <c2m...@c2...> - 2009-10-15 14:13:54
|
Author: ks156
Date: 2009-10-15 16:13:44 +0200 (Thu, 15 Oct 2009)
New Revision: 5689
Modified:
software_suite_v3/software/plugin/plugin-twitter/trunk/plugin-twitter/pom.xml
software_suite_v3/software/plugin/plugin-twitter/trunk/plugin-twitter/resources/de.po
software_suite_v3/software/plugin/plugin-twitter/trunk/plugin-twitter/resources/en.po
software_suite_v3/software/plugin/plugin-twitter/trunk/plugin-twitter/resources/en.wiki
software_suite_v3/software/plugin/plugin-twitter/trunk/plugin-twitter/resources/fr.po
software_suite_v3/software/plugin/plugin-twitter/trunk/plugin-twitter/resources/fr.wiki
software_suite_v3/software/plugin/plugin-twitter/trunk/plugin-twitter/resources/nl.po
software_suite_v3/software/plugin/plugin-twitter/trunk/plugin-twitter/resources/plugin.pot
software_suite_v3/software/plugin/plugin-twitter/trunk/plugin-twitter/resources/plugin.xml
software_suite_v3/software/plugin/plugin-twitter/trunk/plugin-twitter/src/Configuration.java
software_suite_v3/software/plugin/plugin-twitter/trunk/plugin-twitter/src/TwitterDatasStruct.java
software_suite_v3/software/plugin/plugin-twitter/trunk/plugin-twitter/src/TwitterPlugin.java
Log:
* Merged rev 5595 to 5688 from the october branch in the trunk
The merge is not tested. I'm not sure if the trunk remains stable.
Modified: software_suite_v3/software/plugin/plugin-twitter/trunk/plugin-twitter/pom.xml
===================================================================
--- software_suite_v3/software/plugin/plugin-twitter/trunk/plugin-twitter/pom.xml 2009-10-15 14:10:37 UTC (rev 5688)
+++ software_suite_v3/software/plugin/plugin-twitter/trunk/plugin-twitter/pom.xml 2009-10-15 14:13:44 UTC (rev 5689)
@@ -4,7 +4,7 @@
<groupId>com.kysoh</groupId>
<artifactId>plugin-twitter</artifactId>
<packaging>jar</packaging>
- <version>3.0</version>
+ <version>4.0</version>
<name>Twitter plugin for Tux Droid</name>
<url>http://www.tuxisalive.com</url>
Modified: software_suite_v3/software/plugin/plugin-twitter/trunk/plugin-twitter/resources/de.po
===================================================================
--- software_suite_v3/software/plugin/plugin-twitter/trunk/plugin-twitter/resources/de.po 2009-10-15 14:10:37 UTC (rev 5688)
+++ software_suite_v3/software/plugin/plugin-twitter/trunk/plugin-twitter/resources/de.po 2009-10-15 14:13:44 UTC (rev 5689)
@@ -1,84 +1,77 @@
-msgid "Twitter Plugin"
-msgstr "Twitter Plugin"
-
-msgid "The Twitter plugin will make Tux Droid read your tweets from your Twitter account."
-msgstr "Über das Twitter-Plugin kann Tux Droid die Tweets Ihres Twitter-Kontos vorlesen."
-
-msgid "Username"
-msgstr "Benutzername"
-
-msgid "your_user_name"
-msgstr "Ihr Benutzername"
-
-msgid "Password"
-msgstr "Kennwort"
-
-msgid "Tweet your new status"
-msgstr "Tweeten Sie Ihren neuen Status"
-
-msgid "Tweet following status text"
-msgstr "Tweeten Sie entsprechend dem Statustext"
-
-msgid "Hello all from my Tux Droid twitter gadget"
-msgstr "Hallo an Alle von meinem Twitter - Tux Droid"
-
-msgid "Maximum tweets to read"
-msgstr "Höchstzahl zu lesender Tweets"
-
-msgid "Give replies sent between followers"
-msgstr "Gibt die unter den Followern gegebenen Antworten wieder"
-
-msgid "Give my messages/replies"
-msgstr "Meine Nachrichten/Antworten wiedergeben"
-
-msgid "Read / update your tweets from your Twitter account."
-msgstr "Tweets von Ihrem Twitter-Konto lesen/aktualisieren."
-
-msgid "Read your tweets from your Twitter account."
-msgstr "Tweets von Ihrem Twitter-Konto lesen."
-
-msgid "Start every x"
-msgstr "Echtzeitbericht"
-
-msgid "Start me every x"
-msgstr "Benachrichtigen Sie mich bei Änderungen in Echtzeit"
-
-msgid "Start every x from full hour"
-msgstr "Regelmäßiger Bericht"
-
-msgid "Start me every x (From full hour)"
-msgstr "Ich möchte einen regelmäßigen Bericht"
-
-msgid "Start daily at"
-msgstr "Täglicher Bericht"
-
-msgid "Start me daily"
-msgstr "Berichte mir täglich"
-
-msgid "You do not seem to be connected. Please, verify you username and password, then try again."
-msgstr "Anscheinend sind Sie nicht verbunden. Prüfen Sie Benutzername und Kennwort und versuchen Sie es wieder."
-
-msgid "Reply from {0} to {0}, the reply is : {2}"
-msgstr "Antwort von {0} an {0}, die Antwort lautet: {2}"
-
-msgid "No new tweets available."
-msgstr "Keine neuen Tweets vorhanden."
-
-msgid "Twitter is busy for now, please, try later."
-msgstr "Twitter ist ausgelastet, versuchen Sie es später."
-
-msgid "reply from {0}, the reply is: {1}"
-msgstr "Antwort von {0}, die Antwort lautet: {1}"
-
-msgid "you don't have replies"
-msgstr "Sie haben keine Antworten"
-
-msgid "message from {0}, the message is: {1}"
-msgstr "Nachricht von {0}, die Nachricht lautet: {1}"
-
-msgid "you don't have private messages"
-msgstr "Sie haben keine privaten Nachrichten"
-
-msgid "I cannot get connected to your twitter account. Please, verify your internet connection."
-msgstr "Verbindung zu Ihrem Twitter-Konto nicht möglich. Überprüfen Sie Ihren Internet-Anschluss."
-
+msgid "Twitter Plugin"
+msgstr "Twitter Plugin"
+
+msgid "The Twitter plugin will make Tux Droid check your Twitter account."
+msgstr "Dieses Twitter-Plugin weist Sie auf alle Aktualisierungen Ihres Twitter-Kontos hin."
+
+msgid "Username"
+msgstr "Benutzername"
+
+msgid "Password"
+msgstr "Passwort"
+
+msgid "Tweet your new status"
+msgstr "Tweeten Sie Ihren neuen Status"
+
+msgid "Tweet following status text"
+msgstr "Tweeten Sie entsprechend dem Statustext"
+
+msgid "Hello all from my Tux Droid twitter gadget"
+msgstr "Hallo an alle von meinem Twitter - Tux Droid"
+
+msgid "Check Friends updates"
+msgstr "Freund Updates prüfen"
+
+msgid "Check my messages/replies"
+msgstr "Nachrichten/Antworten überprüfen"
+
+msgid "Check your Twitter account."
+msgstr "Mein Twitter-Konto überprüfen."
+
+msgid "Check your tweets from your Twitter account."
+msgstr "Überprüfen Sie Ihre Tweets."
+
+msgid "Start me every x"
+msgstr "Überprüfen Sie mein Twitter-Konto automatisch"
+
+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"
+msgstr "Sie haben eine neue Freund Aktualisierung."
+
+msgid "You have {0} friend updates"
+msgstr "Sie haben {0} Freund Aktualisierungen."
+
+msgid "You don't have any friend updates."
+msgstr "Sie haben keine Freund Aktualisierungen."
+
+msgid "You don't have any messages"
+msgstr "Sie haben keine Nachrichten."
+
+msgid "You don't have any replies"
+msgstr "Sie haben keine Antworten."
+
+msgid "Your new Tweet was not set, please, try again later"
+msgstr "Ihre neue Tweet wurde nicht hinzugefügt, versuchen Sie es später."
+
+msgid "Your Tweet was added"
+msgstr "Ihre neue Tweet wurde hinzugefügt."
+
+msgid "Twitter is busy for now, please, try later."
+msgstr "Twitter ist ausgelastet, versuchen Sie es später wieder."
+
+msgid "One reply from {0}"
+msgstr "Sie haben eine Antwort von {0}."
+
+msgid "{0} replies from {1}"
+msgstr "Sie haben {0} Antworten von {1}."
+
+msgid "One message from {0}"
+msgstr "Sie haben eine Nachricht von {0}."
+
+msgid "{0} messages from {1}"
+msgstr "Sie haben {0} Nachrichten von {1}."
+
+msgid "Sorry, there was an error when connecting to Twitter. Please check your Twitter configuration."
+msgstr "Sorry, Bei der Verbindung mit Twitter gab es einen Fehler. Prüfen Sie Ihre Twitter-Konfiguration."
Modified: software_suite_v3/software/plugin/plugin-twitter/trunk/plugin-twitter/resources/en.po
===================================================================
--- software_suite_v3/software/plugin/plugin-twitter/trunk/plugin-twitter/resources/en.po 2009-10-15 14:10:37 UTC (rev 5688)
+++ software_suite_v3/software/plugin/plugin-twitter/trunk/plugin-twitter/resources/en.po 2009-10-15 14:13:44 UTC (rev 5689)
@@ -1,83 +1,78 @@
-msgid "Twitter Plugin"
-msgstr "Twitter Plugin"
-
-msgid "The Twitter plugin will make Tux Droid read your tweets from your Twitter account."
-msgstr "The Twitter plugin will make Tux Droid read your tweets from your Twitter account."
-
-msgid "Username"
-msgstr "Username"
-
-msgid "your_user_name"
-msgstr "your user name"
-
-msgid "Password"
-msgstr "Password"
-
-msgid "Tweet your new status"
-msgstr "Tweet your 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 "Maximum tweets to read"
-msgstr "Maximum tweets to read"
-
-msgid "Give replies sent between followers"
-msgstr "Give replies sent between followers"
-
-msgid "Give my messages/replies"
-msgstr "Give my messages/replies"
-
-msgid "Read / update your tweets from your Twitter account."
-msgstr "Read / update your tweets from your Twitter account."
-
-msgid "Read your tweets from your Twitter account."
-msgstr "Read your tweets from your Twitter account."
-
-msgid "Start every x"
-msgstr "Real time report"
-
-msgid "Start me every x"
-msgstr "Notify me of changes in real time"
-
-msgid "Start every x from full hour"
-msgstr "Regular report"
-
-msgid "Start me every x (From full hour)"
-msgstr "Give me a report regularly"
-
-msgid "Start daily at"
-msgstr "Daily report"
-
-msgid "Start me daily"
-msgstr "Give me a daily report"
-
-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 "Reply from {0} to {0}, the reply is : {2}"
-msgstr "Reply from {0} to {0}, the reply is : {2}"
-
-msgid "No new tweets available."
-msgstr "No new tweets available."
-
-msgid "Twitter is busy for now, please, try later."
-msgstr "Twitter is busy for now, please, try later."
-
-msgid "reply from {0}, the reply is: {1}"
-msgstr "reply from {0}, the reply is: {1}"
-
-msgid "you don't have replies"
-msgstr "you don't have replies"
-
-msgid "message from {0}, the message is: {1}"
-msgstr "message from {0}, the message is: {1}"
-
-msgid "you don't have private messages"
-msgstr "you don't have private messages"
-
-msgid "I cannot get connected to your twitter accound. Please, verify your internet connection."
-msgstr "I cannot get connected to your twitter accound. Please, verify your internet connection."
+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 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 "You have a new friend update"
+msgstr "There is a new Tweet available."
+
+msgid "You have {0} friend updates"
+msgstr "You have {0} new Tweets."
+
+msgid "You don't have any friend updates."
+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 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/trunk/plugin-twitter/resources/en.wiki
===================================================================
--- software_suite_v3/software/plugin/plugin-twitter/trunk/plugin-twitter/resources/en.wiki 2009-10-15 14:10:37 UTC (rev 5688)
+++ software_suite_v3/software/plugin/plugin-twitter/trunk/plugin-twitter/resources/en.wiki 2009-10-15 14:13:44 UTC (rev 5689)
@@ -1,9 +1,8 @@
= Synopsis =
-This plugin will read your Twitter messages.Not familiar with Twitter? Have a look at http://www.twitter.com
+This plugin will check your Twitter account.Not familiar with Twitter? Have a look at http://www.twitter.com
After entering your Twitter login and password you can customize several options :
-* Tweet your new status : Every time the gadget is started it will make a new tweet on your twitter page.
+* Tweet my new status : Every time the gadget is started it will make a new tweet on your twitter page.
* Tweet following status text : Here you can specify the text of the tweet for the above option.
-* Maximum tweets to read : Select the number of most recent tweets Tux Droid has to read.
-* Give replies sent between followers : Will make Tux Droid read the replies between followers.
-* Give my messages/replies : Will make Tux Droid read your own messages and replies on twitter.
+* Check Friends updates : Will make Tux Droid check for new friends Tweets.
+* Check my messages/replies : Will make Tux Droid check your own messages and replies on twitter.
Modified: software_suite_v3/software/plugin/plugin-twitter/trunk/plugin-twitter/resources/fr.po
===================================================================
--- software_suite_v3/software/plugin/plugin-twitter/trunk/plugin-twitter/resources/fr.po 2009-10-15 14:10:37 UTC (rev 5688)
+++ software_suite_v3/software/plugin/plugin-twitter/trunk/plugin-twitter/resources/fr.po 2009-10-15 14:13:44 UTC (rev 5689)
@@ -1,84 +1,79 @@
msgid "Twitter Plugin"
msgstr "Plugin Twitter"
-msgid "The Twitter plugin will make Tux Droid read your tweets from your Twitter account."
-msgstr "Le plugin Twitter permet à Tux Droid de lire vos tweets à partir de votre compte Twitter."
+msgid "The Twitter plugin will make Tux Droid check your Twitter account."
+msgstr "Le plugin Twitter permet à Tux Droid de vous tenir au courrant dès qu'il y a du nouveau sur votre compte Twitter."
msgid "Username"
msgstr "Utilisateur"
-msgid "your_user_name"
-msgstr "Votre nom d'utilisateur"
-
msgid "Password"
msgstr "Mot de passe"
msgid "Tweet your new status"
-msgstr "Publier un nouveau tweet"
+msgstr "Publier un nouveau Tweet"
msgid "Tweet following status text"
-msgstr "Tweet à ajouter"
+msgstr "Tweet à publier"
msgid "Hello all from my Tux Droid twitter gadget"
msgstr "Bonjour à tous à partir du gadget Twitter de mon Tux Droid"
-msgid "Maximum tweets to read"
-msgstr "Tweets maximum à lire"
+msgid "Check Friends updates"
+msgstr "Vérifier les Tweets de mes amis"
-msgid "Give replies sent between followers"
-msgstr "Donner les réponses entre followers"
+msgid "Check my messages/replies"
+msgstr "Vérifier mes messages / réponses"
-msgid "Give my messages/replies"
-msgstr "Donner mes messages / réponses"
+msgid "Check your Twitter account."
+msgstr "Vérifier votre compte Twitter"
-msgid "Read / update your tweets from your Twitter account."
-msgstr "Lire / Mettre à jour vos tweets"
+msgid "Check your tweets from your Twitter account."
+msgstr "Vérifier vos Tweets"
-msgid "Read your tweets from your Twitter account."
-msgstr "Lire vos tweets"
-
-msgid "Start every x"
-msgstr "Rapport en temps réel"
-
msgid "Start me every x"
-msgstr "Me notifier des changements en temps réel"
+msgstr "Vérifier automatiquement mon compte Twitter."
-msgid "Start every x from full hour"
-msgstr "Rapport régulier"
+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 "Start me every x (From full hour)"
-msgstr "Me donner un rapport régulier"
+msgid "You have a new friend update"
+msgstr "Un ami à publié un nouveau Tweet"
-msgid "Start daily at"
-msgstr "Raport journalier"
+msgid "You have {0} friend updates"
+msgstr "{0} de vos amis ont publié un nouveau Tweet"
-msgid "Start me daily"
-msgstr "Me donner un rapport journalier"
+msgid "You don't have any friend updates."
+msgstr "Vos amis n'ont pas publié de Tweets"
-msgid "You do not seem to be connected. Please, verify you username and password, then try again."
-msgstr "Il semble que vous n'êtes pas connecté. Vérifiez votre login et votre mot de passe et essayez à nouveau."
+msgid "You don't have any messages"
+msgstr "Vous n'avez pas de nouveau messages"
-msgid "Reply from {0} to {0}, the reply is : {2}"
-msgstr "Reply from {0} to {0}, the reply is : {2}"
+msgid "You don't have any replies"
+msgstr "Vous n'avez pas de nouvelles réponses"
-msgid "No new tweets available."
-msgstr "Aucun nouveau tweet disponible."
+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."
+msgid "Your Tweet was added"
+msgstr "Votre Tweet a été publié"
+
msgid "Twitter is busy for now, please, try later."
msgstr "Twitter est occupé pour le moment, veuillez réessayer plus tard."
-msgid "reply from {0}, the reply is: {1}"
-msgstr "Réponse de {0}, la réponse est: {1}"
+msgid "One reply from {0}"
+msgstr "Une réponse de {0}"
-msgid "you don't have replies"
-msgstr "Vous n'avez pas de réponses"
+msgid "{0} replies from {1}"
+msgstr "{0} réponses de {1} "
-msgid "message from {0}, the message is: {1}"
-msgstr "Message de {0}, les message est: {1}"
+msgid "One message from {0}"
+msgstr "Un message de {0}"
-msgid "you don't have private messages"
-msgstr "Vous n'avez pas de messages privés."
+msgid "{0} messages from {1}"
+msgstr "{0} messages de {1}"
-msgid "I cannot get connected to your twitter accound. Please, verify your internet connection."
-msgstr "Je ne peux me connecter à votre compte Twitter. S'il vous plait, vérifiez votre connexion internet."
+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/trunk/plugin-twitter/resources/fr.wiki
===================================================================
--- software_suite_v3/software/plugin/plugin-twitter/trunk/plugin-twitter/resources/fr.wiki 2009-10-15 14:10:37 UTC (rev 5688)
+++ software_suite_v3/software/plugin/plugin-twitter/trunk/plugin-twitter/resources/fr.wiki 2009-10-15 14:13:44 UTC (rev 5689)
@@ -1,9 +1,9 @@
= Synopsis =
-Ce plugin va lire vos messages sur Twitter. Pas familier avec Twitter? Rendez-vous sur http://www.twitter.com
+Ce plugin vous notifie des mises à jour sur votre compte Twitter.
+Pas familier avec Twitter? Rendez-vous sur http://www.twitter.com
Après avoir entré votre login Twitter et votre mot de passe, vous pourrez personnaliser quelques options :
-* Publier un nouveau tweet : Chaque fois que le gadget est lancé, il ajoutera un nouveau tweet sur votre page.
-* Tweet à ajouter : Ici, vous pouvez spécifier le texte du nouveau tweet à ajouter dans le cas ou l'option précédante est activée.
-* Tweets maximum à lire : Selectionnez le nombre maximum de tweets que Tux Droid doit lire.
-* Donner les réponses entre followers : Va autoriser Tux Droid à lire les réponses envoyées entre vos followers.
-* Donnes mes messages/réponses : Tux Droid lira vos messages et réponse sur Twitter.
+* Publier un nouveau Tweet : Chaque fois que le gadget est lancé, il ajoutera un nouveau tweet sur votre page.
+* Tweet à publier : Ici, vous pouvez spécifier le texte du nouveau tweet à ajouter dans le cas ou l'option précédante est activée.
+* Vérifier les Tweets de mes amis : Tux Droid vérifiera si vos amis ont publié de nouveaux tweets
+* Vérifier mes messages / réponses : Tux Droid lira vos messages et réponse sur Twitter.
Modified: software_suite_v3/software/plugin/plugin-twitter/trunk/plugin-twitter/resources/nl.po
===================================================================
--- software_suite_v3/software/plugin/plugin-twitter/trunk/plugin-twitter/resources/nl.po 2009-10-15 14:10:37 UTC (rev 5688)
+++ software_suite_v3/software/plugin/plugin-twitter/trunk/plugin-twitter/resources/nl.po 2009-10-15 14:13:44 UTC (rev 5689)
@@ -1,83 +1,77 @@
-msgid "Twitter Plugin"
-msgstr "Twitter Plugin"
-
-msgid "The Twitter plugin will make Tux Droid read your tweets from your Twitter account."
-msgstr "De Twitter gadget zal Tux Droid je tweets doen lezen van je Twitter account."
-
-msgid "Username"
-msgstr "Gebruikersnaam"
-
-msgid "your_user_name"
-msgstr "uw 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 "Maximum tweets to read"
-msgstr "Maximum te lezen tweets"
-
-msgid "Give replies sent between followers"
-msgstr "Geef antwoorden weer tussen followers"
-
-msgid "Give my messages/replies"
-msgstr "Geef mijn berichten/antwoorden weer"
-
-msgid "Read / update your tweets from your Twitter account."
-msgstr "Lees / update jouw tweets van jouw Twitter account."
-
-msgid "Read your tweets from your Twitter account."
-msgstr "Lees jouw tweets van jouw Twitter account."
-
-msgid "Start every x"
-msgstr "Check jouw Twitter account automatisch"
-
-msgid "Start me every x"
-msgstr "Check jouw Twitter account automatisch"
-
-msgid "Start every x from full hour"
-msgstr "Start op regelmatige tijdstippen"
-
-msgid "Start me every x (From full hour)"
-msgstr "Start op regelmatige tijdstippen"
-
-msgid "Start daily at"
-msgstr "Start mij dagelijks"
-
-msgid "Start me daily"
-msgstr "Start mij dagelijks"
-
-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 "Reply from {0} to {0}, the reply is : {2}"
-msgstr "antwoord van {0} op {0}, het antwoord is : {2}"
-
-msgid "No new tweets available."
-msgstr "Er zijn geen nieuwe tweets beschikbaar."
-
-msgid "Twitter is busy for now, please, try later."
-msgstr "Twitter is bezet op het ogenblik. Probeer later opnieuw."
-
-msgid "reply from {0}, the reply is: {1}"
-msgstr "antwoord van {0}, het antwoord is: {1}"
-
-msgid "you don't have replies"
-msgstr "Er zijn geen antwoorden"
-
-msgid "message from {0}, the message is: {1}"
-msgstr "bericht van {0}, het bericht is: {1}"
-
-msgid "you don't have private messages"
-msgstr "Je hebt geen persoonlijke berichten"
-
-msgid "I cannot get connected to your twitter accound. Please, verify your internet connection."
-msgstr "Ik kan geen verbinding maken met je twitter account. Gelieve je internet connectie te controleren."
+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 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 "You have a new friend update"
+msgstr "Er is een nieuwe Tweet beschikbaar."
+
+msgid "You have {0} friend updates"
+msgstr "Je hebt {0} nieuwe Tweets."
+
+msgid "You don't have any friend updates."
+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 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/trunk/plugin-twitter/resources/plugin.pot
===================================================================
--- software_suite_v3/software/plugin/plugin-twitter/trunk/plugin-twitter/resources/plugin.pot 2009-10-15 14:10:37 UTC (rev 5688)
+++ software_suite_v3/software/plugin/plugin-twitter/trunk/plugin-twitter/resources/plugin.pot 2009-10-15 14:13:44 UTC (rev 5689)
@@ -1,15 +1,12 @@
msgid "Twitter Plugin"
msgstr ""
-msgid "The Twitter plugin will make Tux Droid read your tweets from your Twitter account."
+msgid "The Twitter plugin will make Tux Droid check your Twitter account."
msgstr ""
msgid "Username"
msgstr ""
-msgid "your_user_name"
-msgstr ""
-
msgid "Password"
msgstr ""
@@ -22,62 +19,60 @@
msgid "Hello all from my Tux Droid twitter gadget"
msgstr ""
-msgid "Maximum tweets to read"
+msgid "Check Friends updates"
msgstr ""
-msgid "Give replies sent between followers"
+msgid "Check my messages/replies"
msgstr ""
-msgid "Give my messages/replies"
+msgid "Check your Twitter account."
msgstr ""
-msgid "Read / update your tweets from your Twitter account."
+msgid "Check your tweets from your Twitter account."
msgstr ""
-msgid "Read your tweets from your Twitter account."
+msgid "Start me every x"
msgstr ""
-msgid "Start every x"
+msgid "You do not seem to be connected. Please, verify you username and password, then try again."
msgstr ""
-msgid "Start me every x"
+msgid "You have a new friend update"
msgstr ""
-msgid "Start every x from full hour"
+msgid "You have {0} friend updates"
msgstr ""
-msgid "Start me every x (From full hour)"
+msgid "You don't have any friend updates."
msgstr ""
-msgid "Start daily at"
+msgid "You don't have any messages"
msgstr ""
-msgid "Start me daily"
+msgid "You don't have any replies"
msgstr ""
-msgid "You do not seem to be connected. Please, verify you username and password, then try again."
+msgid "Your new Tweet was not set, please, try again later"
msgstr ""
-msgid "Reply from {0} to {0}, the reply is : {2}"
+msgid "Your Tweet was added"
msgstr ""
-msgid "No new tweets available."
-msgstr ""
-
msgid "Twitter is busy for now, please, try later."
msgstr ""
-msgid "reply from {0}, the reply is: {1}"
+msgid "One reply from {0}"
msgstr ""
-msgid "you don't have replies"
+msgid "{0} replies from {1}"
msgstr ""
-msgid "message from {0}, the message is: {1}"
+msgid "One message from {0}"
msgstr ""
-msgid "you don't have private messages"
+msgid "{0} messages from {1}"
msgstr ""
-msgid "I cannot get connected to your twitter accound. Please, verify your internet connection."
+msgid "Sorry, there was an error when connecting to Twitter. Please check your Twitter configuration."
msgstr ""
+
Modified: software_suite_v3/software/plugin/plugin-twitter/trunk/plugin-twitter/resources/plugin.xml
===================================================================
--- software_suite_v3/software/plugin/plugin-twitter/trunk/plugin-twitter/resources/plugin.xml 2009-10-15 14:10:37 UTC (rev 5688)
+++ software_suite_v3/software/plugin/plugin-twitter/trunk/plugin-twitter/resources/plugin.xml 2009-10-15 14:13:44 UTC (rev 5689)
@@ -7,9 +7,9 @@
<description>
<name>Twitter Plugin</name>
<ttsName>Twitter</ttsName>
- <description>The Twitter plugin will make Tux Droid read your tweets from your Twitter account.</description>
+ <description>The Twitter plugin will make Tux Droid check your Twitter account.</description>
<author>Jérôme Conan</author>
- <version>3.0</version>
+ <version>4.0</version>
<iconFile>resources/plugin.png</iconFile>
<executionMode>command</executionMode>
<uuid>623afa3f-7ae3-43f9-b89b-bc5a8185b0cf</uuid>
@@ -33,7 +33,7 @@
name="updateStatus"
description="Tweet your new status"
type="boolean"
- defaultValue="true" />
+ defaultValue="false" />
<parameter
category="User parameters"
name="myStatus"
@@ -42,30 +42,24 @@
defaultValue="Hello all from my Tux Droid twitter gadget" />
<parameter
category="User parameters"
- name="maxRead"
- description="Maximum tweets to read"
- type="enum(10, 15, 20, 25, 30)"
- defaultValue="10" />
- <parameter
- category="User parameters"
- name="giveOtherReplies"
- description="Give replies sent between followers"
+ name="checkFriends"
+ description="Check Friends updates"
type="boolean"
defaultValue="true" />
<parameter
category="User parameters"
- name="giveMessages"
- description="Give my messages/replies"
+ name="checkMessages"
+ description="Check my messages/replies"
type="boolean"
defaultValue="true" />
</parameters>
<commands>
<command
name="run"
- description="Read / update your tweets from your Twitter account." />
+ description="Check your Twitter account." />
<command
name="check"
- description="Read your tweets from your Twitter account." />
+ description="Check your tweets from your Twitter account." />
</commands>
<tasks>
<task
@@ -77,53 +71,11 @@
weekMask="true,true,true,true,true,true,true"
weekMaskType="weekpart"
- weekMaskVisible="true"
+ weekMaskVisible="false"
delay="00:01:00"
delayMask="true,true,true"
delayVisible="false"
/>
- <task
- name="Start every x from full hour"
- description="Start me every x (From full hour)"
- command="check"
- type="every x from full hour"
- activated="false"
-
- weekMask="true,true,true,true,true,true,true"
- weekMaskType="weekpart"
- weekMaskVisible="true"
-
- date="0000/00/00"
- dateVisible="false"
-
- hoursBegin="00:00:00"
- hoursBeginMask="true,true,true"
- hoursBeginVisible="false"
-
- hoursEnd="23:59:00"
- hoursEndMask="true,true,true"
- hoursEndVisible="false"
-
- delay="00:15:00"
- delayType="quarters"
- delayMask="true,true,false"
- delayVisible="true"
- />
- <task
- name="Start daily at"
- description="Start me daily"
- command="check"
- type="daily at"
- activated="false"
-
- weekMask="true,true,true,true,true,true,true"
- weekMaskType="weekpart"
- weekMaskVisible="true"
-
- hoursBegin="07:00:00"
- hoursBeginMask="true,true,false"
- hoursBeginVisible="true"
- />
</tasks>
</plugin>
Modified: software_suite_v3/software/plugin/plugin-twitter/trunk/plugin-twitter/src/Configuration.java
===================================================================
--- software_suite_v3/software/plugin/plugin-twitter/trunk/plugin-twitter/src/Configuration.java 2009-10-15 14:10:37 UTC (rev 5688)
+++ software_suite_v3/software/plugin/plugin-twitter/trunk/plugin-twitter/src/Configuration.java 2009-10-15 14:13:44 UTC (rev 5689)
@@ -1,5 +1,3 @@
-import com.kysoh.tuxdroid.plugin.framework.plugin.SimplePluginConfiguration;
-
/* This file is part of "Tux Droid Gadget Twitter".
* Copyright 2008, kysoh
* Author : Jerome Conan
@@ -22,18 +20,24 @@
*/
+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 = true;
- private String maxRead = "10";
- private boolean giveMessages = true;
- private boolean giveOtherReplies = true;
+ 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
@@ -50,6 +54,11 @@
*/
public String getUsername()
{
+ if (this.username.equalsIgnoreCase(this.defaultUser))
+ {
+ return null;
+ }
+
return this.username;
}
@@ -70,6 +79,10 @@
*/
public String getPassword()
{
+ if (this.password.equalsIgnoreCase(this.defaultPassword))
+ {
+ return null;
+ }
return this.password;
}
@@ -114,61 +127,42 @@
/**
- * Set giveMessages parameter.
- * @param giveMessages
+ * Set or not the checkf friends updates check.
+ * @param updateStatus
*/
- public void setGiveMessages(boolean giveMessages)
+ public void setCheckFriends(boolean aCheckFriends)
{
- this.giveMessages = giveMessages;
+ this.checkFriends = aCheckFriends;
}
/**
- * Return true if user want to hear his messages.
+ * Return true if user want to check his new friends statuses.
* @return
*/
- public boolean getGiveMessages()
+ public boolean getCheckFriends()
{
- return this.giveMessages;
+ return this.checkFriends;
}
/**
- * Return true if users want the heard replies giver by different user to an other one.
- * @return
+ * Set or not the check messages option.
+ * @param updateStatus
*/
- public boolean getGiveOtherReplies()
+ public void setCheckMessages(boolean aCheckMessages)
{
- return this.giveOtherReplies;
+ this.checkMessages = aCheckMessages;
}
/**
- * Set 'give other replies' option.
- * @param give
- */
- public void setGiveOtherReplies(boolean give)
- {
- this.giveOtherReplies = give;
- }
-
-
- /**
- * Set the maximum entries to read.
- * @param value
- */
- public void setMaxRead(String value)
- {
- this.maxRead = value;
- }
-
-
- /**
- * Return the maximum entries allowed to be read.
+ * Return true if user want to check his replies / messages.
* @return
*/
- public int getMaxRead()
+ public boolean getCheckMessages()
{
- return Integer.valueOf(this.maxRead).intValue();
+ return this.checkMessages;
}
+
}
Modified: software_suite_v3/software/plugin/plugin-twitter/trunk/plugin-twitter/src/TwitterDatasStruct.java
===================================================================
--- software_suite_v3/software/plugin/plugin-twitter/trunk/plugin-twitter/src/TwitterDatasStruct.java 2009-10-15 14:10:37 UTC (rev 5688)
+++ software_suite_v3/software/plugin/plugin-twitter/trunk/plugin-twitter/src/TwitterDatasStruct.java 2009-10-15 14:13:44 UTC (rev 5689)
@@ -38,21 +38,26 @@
public SerializedVector vktStruct;
private File structFile;
+ private boolean firstCycle;
+
public TwitterDatasStruct(String username)
{
- //Getting file where was registered serialized vector.
+ //tds = tuxdroid datas saved.
+
File path = new File("");
- //tds = tuxdroid datas saved.
- structFile = new File(path.getAbsolutePath() + File.separator + username + "@twitter.sav");
+ 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)
@@ -145,7 +150,17 @@
}
+
/**
+ * 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
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-15 14:10:37 UTC (rev 5688)
+++ software_suite_v3/software/plugin/plugin-twitter/trunk/plugin-twitter/src/TwitterPlugin.java 2009-10-15 14:13:44 UTC (rev 5689)
@@ -1,29 +1,30 @@
-/* This file is part of "Tux Droid Gadget Twitter".
+/* This file is part of "Tux Droid Plugin 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
+ * "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 Gadget Twitter" is distributed in the hope that it will be useful,
+ * "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 Gadget Twitter"; if not, write to the Free
+ * 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;
@@ -33,298 +34,402 @@
public class TwitterPlugin extends SimplePlugin<Configuration>{
- private TwitterDatasStruct savedStruct;
+ private static TwitterDatasStruct savedStruct;
+ private static byte REPLY = 0;
+ private static byte MESSAGE = 1;
- private boolean isCheck = false;
+ private List<String> messagesList = new ArrayList<String>();
+ private List<String> repliesList = new ArrayList<String>();
+
private boolean throwed = false;
- private String[] smileys = new String[]{":)", ":-)", ":(", ":-(", ":|", ":-|",
- ":$", ":-$", ";)", ";-)", ";(", ";-(",
- "o/", "\\o", "\\o/", ":o", ":-o", ":@",
- ":-@", ":D", ":-D", ":p", ":d", ":-p",
- ":-d", "=)", "=-)", "$)", "$-)"};
-
- @Override
- protected void start() throws Throwable
+ /***
+ 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("check"))
+ if(this.getCommand().equalsIgnoreCase("run"))
{
- this.isCheck = true;
- }
-
- savedStruct = new TwitterDatasStruct(this.configuration().getUsername());
- // Getting connected to twitter.
- Twitter twitter = null;
- twitter = new Twitter(this.configuration().getUsername(), this.configuration().getPassword());
-
-
- twitter.setSource("tuxdroid");
-
- if(!this.isCheck)
- {
//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)
{
- throwMessage("You do not seem to be connected. Please, verify you username and password, then try again.");
+ if (!this.getCommand().equalsIgnoreCase("check"))
+ {
+ throwMessage("You do not seem to be connected. Please, verify you username and password, then try again.");
+ }
this.quitGadget();
}
}
}
- Vector<Twitter.Status> repliesToOtherUsers = new Vector<Twitter.Status>();
-
- try
+ 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++ )
{
- boolean noStatuses = true;
- List<User> friend = twitter.getFriends();
-
- int max = 0;
-
- for(int i=0; i < twitter.getFriends().size(); i++)
- {
- try
- {
-
- if( max >= this.configuration().getMaxRead() )
- {
- break;
- }
-
- Status status = friend.get(i).getStatus();
+ try
+ {
+ Status status = friend.get(i).getStatus();
- String statusText = status.getText();
- String username = status.getUser().getName();
+ String statusText = status.getText();
+ String username = status.getUser().getName();
+
- //if a new status was set for this user.
- boolean said = this.savedStruct.isRegistered(TwitterDatasStruct.FRIENDS_STATUSES, username, statusText);
- if((statusText != "null") && !said)
+ //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))
{
- noStatuses = false;
- String stat = statusText.replace("&", "");
-
- for(String simley : this.smileys)
- {
- stat = stat.replace(simley, "");
- }
-
- stat = this.urlFilter(stat);
-
- if(isReplyToOtherUser(stat))
- {
- repliesToOtherUsers.add(status);
- }
-
- else
- {
- if(this.isCheck && (!throwed))
- {
- this.throwResult(true);
- this.throwed = true;
- }
- throwMessage(username + ", " + stat);
- max += 1;
- }
-
+ statusesCount += 1;
//Saving last entry.
- this.savedStruct.addFriendStatus(username, statusText);
- }
- }
- catch(NullPointerException statusNotExists)
- {
- ;
- }
+ savedStruct.addFriendStatus(username, statusText);
+ }
+ }
}
-
-
- if((repliesToOtherUsers.size() > 0) && this.configuration().getGiveOtherReplies())
- {
- max = this.configuration().getMaxRead();
+ catch(NullPointerException statusNotExists)
+ {
+ //Simply pass in case of exception, friend status change will not be counted.
+ ;
+ }
- for(Twitter.Status state : repliesToOtherUsers)
- {
- if( max <= 0 )
- {
- return;
- }
-
- String sender = state.getUser().getName();
- String to = state.getText().substring(1, state.getText().indexOf(" "));
- if(!to.equals(this.configuration().getUsername()))
- {
- String reply = state.getText().substring(state.getText().indexOf(" ") + 1 );
- reply = this.urlFilter(reply);
-
- if(this.isCheck && (!throwed))
- {
- this.throwResult(true);
- this.throwed = true;
- }
-
- throwMessage("Reply from {0} to {0}, the reply is : {2}", sender, to, reply);
- }
-
- max -= 1;
- }
- }
-
-
- if(noStatuses)
+ }
+
+ 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
{
- if(!this.isCheck)
- {
- throwMessage("No new tweets available.");
- }
+ //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)
+ {
+ ;
+ }
}
- catch(TwitterException badRequest)
+
+ 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)
{
- if(!this.isCheck)
+ try
{
- throwMessage("Twitter is busy for now, please, try later.");
+ 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();
}
-
-
- //Getting provates and public messages.
- if(this.configuration().getGiveMessages())
+ //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
{
- boolean noReplies = true;
- boolean noMessage = true;
-
- try
- {
- List<Message> replies = twitter.getReplies();
- List<Message> messages = twitter.getDirectMessages();
+ 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("You have a new friend update");
+ }
+ else if ( updateCount > 1 )
+ {
+ throwRes();
+ throwMessage("You have {0} friend updates", String.valueOf(updateCount));
+ }
+ else
+ {
+ if ( ! this.getCommand().equalsIgnoreCase("check") )
+ {
+ throwMessage("You don't have any friend updates.");
+ }
+ }
+ }
+ }
- //Getting replies first.
- if(replies.size() > 0)
+
+ /**
+ * Getting, sorting new user private / public ( replies ) messages.
+ * if option is enabled.
+ */
+ if (this.configuration().getCheckMessages())
{
- int maxRead = this.configuration().getMaxRead();
-
- //then give replies.
- for(Message reply : replies)
+ if ( getPrivateMessagesCount(twitter) > 0 )
{
- boolean can = maxRead > 0 ? true : false;
-
- if(!can)
+ //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") )
{
- break;
+ throwMessage("You don't have any messages");
}
-
- String username = reply.getSender().getName();
-
- boolean said = this.savedStruct.isRegistered(TwitterDatasStruct.REPLIES, username, reply.getText());
-
- if((reply.getText() != "null") && !said)
+ }
+
+ //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") )
{
- noReplies = false;
- String repl = reply.getText().replace("&", "").replace("@" + this.configuration().getUsername(), "");
-
- for(String simley : this.smileys)
- {
- repl = repl.replace(simley, "");
- }
-
- repl = this.urlFilter(repl);
-
- if(this.isCheck && (!throwed))
- {
- this.throwResult(true);
- this.throwed = true;
- }
-
- throwMessage("reply from {0}, the reply is: {1}", username, repl);
- this.savedStruct.addReply(username, reply.getText());
+ throwMessage("You don't have any replies");
}
-
- maxRead -= 1;
}
+
+ //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");
}
-
- if(noReplies)
+ else
{
- if(!this.isCheck)
- {
- throwMessage("you don't have replies");
- }
+ this.throwMessage("Your Tweet was added");
}
+ }
+ }
+ catch(TwitterException badRequest)
+ {
+ if ( ! this.getCommand().equalsIgnoreCase("check") )
+ {
+ throwMessage("Twitter is busy for now, please, try later.");
+ }
- if(messages.size() > 0)
+ 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 )
{
- int maxRead = this.configuration().getMaxRead();
-
- //then give messages.
- for(Message message : messages)
- {
- boolean can = maxRead > 0 ? true : false;
-
- if(!can)
- {
- break;
- }
-
- String username = message.getSender().getName();
- boolean said = this.savedStruct.isRegistered(TwitterDatasStruct.MESSAGES, username, message.getText());
- if((message.getText() != "null") && !said)
- {
- noMessage = false;
- String mess = message.getText().replace("&", "");
-
- for(String simley : this.smileys)
- {
- mess = mess.replace(simley, "");
- }
-
- mess = this.urlFilter(mess);
-
- if(this.isCheck && (!throwed))
- {
- this.throwResult(true);
- this.throwed = true;
- }
-
- throwMessage("message from {0}, the message is: {1}", username, mess);
- this.savedStruct.addMessage(username, message.getText());
- }
-
- maxRead -=1;
- }
+ throwMessage("One reply from {0}", it);
}
-
- if(noMessage)
+ else
{
- if(!this.isCheck)
- {
- throwMessage("you don't have private messages");
- }
+ throwMessage ("{0} replies from {1}", count, it);
}
}
- catch(TwitterException badRequest)
+ else
{
- if(!this.isCheck)
+ if ( count == 1 )
{
- throwMessage("Twitter is busy for now, please, try later.");
+ throwMessage("One message from {0}", it);
}
- this.quitGadget();
+ else
+ {
+ throwMessage("{0} messages from {1}", count, it);
+ }
}
}
-
- //RegisterStruct.
- this.savedStruct.registerStruct();
}
-
-
+
+
/**
* Return true if the text value indicates that the message was sent from a user
- * to an other user , but not the current connected one.
+ * to an other user , but not the TuxDroid owner.
* @param value
* @return
*/
@@ -338,6 +443,11 @@
}
+ /***
+ * Remove Url's from text.
+ * @param string
+ * @return
+ ***/
public String urlFilter(String string)
{
while(string.contains("http://"))
@@ -399,7 +509,7 @@
*/
public void quitGadget()
{
- if(this.isCheck && this.throwed)
+ if(this.getCommand().equalsIgnoreCase("check") && this.throwed)
{
this.throwResult(false);
}
@@ -414,15 +524,15 @@
@Override
- protected void onPluginEvent(String arg0, String[] arg1) throws Throwable {
- // TODO Auto-generated method stub
+ protected void onPluginEvent(String arg0, String[] arg1) throws Throwable
+ {
;
}
@Override
- protected void onPluginStop() throws Throwable {
- // TODO Auto-generated method stub
+ protected void onPluginStop() throws Throwable
+ {
;
}
|