TweetMyPC : Piloter son ordinateur à distance via Twitter9 minute(s) de lecture

Vous avec un PC?  Vous êtes loin de chez vous et souhaitez agir sur votre ordinateur à distance?  Si en plus il heberge votre système domotique ça pourrait être bien de lui faire exécuter des actions alors que vous n’êtes pas devant l’écra mais simplement avec votre smartphone. Pas de soucis il suffit de lui envoyer des ordres via Twitter et il s’exécutera.  C’est simple et gratuit : TweetMyPC est un petit utilitaire pour commander votre ordinateur au Tweet et à l’œil…

Présentation

Prendre à distance son PC pour vérifier qu’il marche, pour le mettre en veille car on est parti trop vite en oubliant de l’arrêter ou tout simplement pour lui faire exécuter des tâches c’est maintenant possible en utilisant les fonctionnalités de la plateforme de micro bloging Twitter.

Le principe est simple.  Depuis un compte Twitter, pour lequel vous aurez pris le soin de cocher la case le rendant privé, il vous suffit d’envoyer un ordre à votre ordinateur.  Cela se fait en créant un Tweet avec une liste de mots prédéfinis.  Votre ordinateur étant également connecté à Twitter sur ce même compte lit le Tweet qui vous lui avez rédigé, l’interprète, exécute l’ordre et vous réponds par un autre Tweet.

Cela se fait via TweetMyPC qui est une petite application gratuite pour Windows.  Elle est écrite en VB.Net et nécessite le Framework .Net v3.5 SP1.  C’est ce programme qui vous permettra de contrôler votre machine et d’y accéder depuis n’importe où en lui envoyant des messages twitter spécifiques.

Pour les utilisateurs de MAC il existe de même TweetMyMac

Mise en œuvre

Comment piloter son PC par lignes de commandes via Twitter?

La mise en œuvre est très simple. Il n’y a pas de firewall à modifier, il n’y a pas de ports à ouvrir il n’y a pas d’utilisation de logiciels tels que Remote Desktop ou que VNC.  Vous avez simplement besoin de 2 choses: un compte Twitter et que le programme TweetMyPC soit installé et qu’il tourne en tâche de fond. 

Création d’un compte Twitter

Il n’est pas exigé que ce compte soit dédié à cette utilisation, mais cela pourra éviter quelques surprises.  Si vous avez un compte existant avec lequel vous discutez beaucoup cela pourrait alourdir le travail de votre PC qui doit scanner tous les messages du compte Twitter pour ne pas passer à côté d’un ordre.

Pour créer un compte rendez-vous le plus simplement du monde sur www.twitter.com  et pour y créer un compte de manière classique et n’oubliez pas de cocher la case : “Confidentialité: Protéger mes Tweets”!  Cela rendra votre compte Twitter privé. C’est mieux 😉  N’hésitez pas à utiliser un mot de passe digne de ce nom.

Installation du logiciel

 Le logiciel à installer s’appelle TweetMyPC il est gratuit et disponible sur le site du développeur http://tweetmypc.codeplex.com/.

Suivez les instructions suivantes pour l’installation:

  • télécharger le logiciel via cette adresse http://tweetmypc.basisbit.de/
  • L’installer
  • paramétrer le compte Twitter en cliquant sur “Sign In with Twitter”.  Vous serez alors dirigés sur le site de Twitter afin de vous y identifier.  Cela vous permettra de récupérer un code PIN qu’il faudra renseigner dans la fenêtre de l’application TweetMyPC
  • renseigner une adresse personnelle sur Gmail.  Cela est nécessaire uniquement pour obtenir les résultats de commandes telles que  getprocesslist, getfile and getfilelist.
  • Cliquer sur “Save&Hide button” afin d’activer TweetMyPC

 

Utilisation de la solution

 Pour envoyer un ordre au PC il suffit de se connecter sur Twitter via l’application Web www.twitter.com ou via une application Smartphone ou tablette.  Il vous suffit alors tout simplement de rédiger des messages Twitter.  Ces lignes de commandes seront lues par votre ordinateur est exécutées.

Voici les mots à utiliser pour réaliser des actions que je vous reporte depuis la documentation officielle :

 

Command Purpose
shutdown This command will shut down your computer after showing a warning and a wait-time of one minute.
restart restarts your computer after a warning and a one minute delay
standby Don’t want to shutdown? Then you can make your pc go to standby mode with this command.
hibernate This command will hibernate your computer after showing a warning and a wait-time of one minute
lock This command locks your Windows pc – TweetMyPC will still continue running and answer to tweets
logoff Locking the account is not what you want? Try logoff to log off your Windows-Account and close all programs
abortshutdown You accidentally tweeted shutdown or hibernate? Don’t worry. You still can stop it by tweeting “abortshutdown” to stop it – if you are fast enough!
physical memory As the name says, this command will let you know the free Physical Memory of your pc
virtual memory Want to know the free virtual memory of your pc? Just tweet virtual memory
os This is one of the command which does not have much value. Tweeting “os” will make TweetMyPC to tweet about your Operating System version.
ip Know your pc’s internal and external IP-Address from anywhere in the world with this command
screenshot Want to know what is happening in your pc when you are not around? Just tweet screenshot and TweetMyPC will take a screenshot of your desktop and post it to Twitpic.
getprocesslist This is one of the very useful commands. On receiving this command TweetMyPC will generate a list of running programs, along with the process ID, and email it to a predefined email address.
kill <process id> This is used along with the above command. Once you receive the process list you can close a program using the kill command.
download <URL> Want to download an interesting video but you are on the move? Don’t worry – just tweet download followed by the download URL and TweetMyPC will download it for you and it will be ready when you return back. Note: Twitter automatically converts long URLs into short one using bit.ly. TweetMyPC can download files only if the URL is in the short form for security reasons. Please use bit.ly to shorten your URL before posting.
getfile <filepath> Missed an important document and you are traveling somewhere? No problem. Just tweet get followed by the file path and TweetMyPC will email the file as attachment to a predefined email. Don’t know the path? Don’t worry. Just checkout the next command.
getfilelist <drive> This command will make TweetMyPC to send you the list of files and folders in a drive. You can use this command to email you a file once you know the complete path of the file.
volinc Increases the volume of the main speaker by 20%
voldec Decreases the volume of the main speaker by 20%
volmute Mutes the main speaker
volunmute Un-mutes the main speaker
wallpaper <URL> You found a nice image and want to use set it as background at your TweetMyPC-Computer? Just use this command with the URL of the Image to set it fast and easy from anywhere!
url <URL> This command helps a lot for example if you find a website, a document or a download-file you want to review it at your computer. Then you can just open the URL by using this command, and see it at the screen when you are back at the pc. (the url has to start with http:// or www
powerstate This tweets the battery-state (Charging or not, if power-cable is plugged in and how long the remaining battery-running-time is)
ping When TweetMyPC reads this, it will answer that it is running and checks for tweets – This is really helpful to see if TweetMyPC is working and if your commands will have any effect. +fun link 😉 try it!
message <your message-text> Thanks to this command you can send a custom message to your computer, which will be shown as message-box, so you can communicate with other people sitting in front of your computer or just send a notification to yourself to read them later.
stopscr This stops the screensaver
darkscreen darkens/turns off your screen for example to save energy or to hide what the desktop shows
print <URL> TweetMyPC will download and then print the specified file – currently just .doc, .docx or *.pdf supported
<Custom Command> <optional with parameters> This is the most interesting feature of TweetMyPC. You think the above list of commands is not enough? No problem! With this new release of TweetMyPC you can start any program or shell-command with parameters just by using twitter and this program! You can start any program you want by adding it in the CustomCommand-Window of TweetMyPC and then tweeting the specified name of it. But also you can just add parameters to the tweets. Thanks to this you can now for example start your torrent-client with the torrent download-url as parameter or you can open Winamp and play a webstream, local file or whatever you want. (Example: add %windir%\system32\cmd.exe in the custom-commands window and tweet “command /K defrag /M /U” – see http://ss64.com/nt/cmd.html

Twitter vous interdit de rédiger 2 fois le même message. Cela peut être contourné  en ajoutant  “##” suivi de  n’importe quel texte après la commande. TweetMyPC ignorera tout simplement le texte additionnel et exécutera la commande.

Pour créer des commandes personnalisées il suffit d’aller dans le menu Setting->Custom Commands et de renseigner les champs correspondants au mot clé et au programme à lancer puis d’appuyer sur le bouton “add command”.  Voici à titre d’exemple comment lancer VLC.

Ca vous donne des idées d’utilisation?

Conclusion

Ça marche et c’est assez bluffant.  Cela ouvre toute un monde de possibilités si vous utilisez un PC en tant que serveur domotique par exemple.  Vous aurez ainsi à moindre coût une porte ouverte sur votre système où que vous soyez. Vous pourrez commander votre système domotique via Twitter ! 

La possibilité de créer ses propres ordres permet d’implémenter toute sorte de fonctionnalités.  Votre imagination sera mise à rude épreuve!

La version PC est toujours en version Alpha mais semble assez stable.

Voici un petit outil sympathique à suivre.

3 Comments

  1. Fx said:

    Il est pas possible d’envoyer un tweet avec le SIRI de l’iphone ? ca serait sympa

    24 novembre 2011
    Reply
    • abavala said:

      Je n’ai pas la chance d’avoir l’Iphone 4S je n’ai donc pas pu tester cela. Par contre je te rejoins sur le côté sympa du montage 😉

      24 novembre 2011
      Reply

Laisser un commentaire

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *

Prouvez que vous êtes humain: * Time limit is exhausted. Please reload CAPTCHA.