The standard Windows users however may not be as comfortable around CLI (Command Line interface) apps as they are around Graphical User Interface (GUI) programs.
I. Describing the need
- The first need is to provide a simple GUI interface. I am tired of opening a shell, going to the script directory and typing something like:
perl twit.pl -s "I am so lazy" -a
every time I want to update my Twitter and Identica messages. I just want to type my text and click on a "Send" button. - Monitor the number of characters being typed so that it doesn't go over the 140-character limit.
- Provide a standalone application that my mom would find easy to use.
- I would also like to have the possibility of removing the last post for both Twitter and Identica, in case of a spelling mistake detected after sending the update for example.
From using Padre, wxPerl is already installed on my system in the form of the Wx module. I'll hence be using it (and it will help me understand the innards of Padre as a bonus).
Other options for GUI librairies would be Tk and Win32::GUI (the last one for Windows only obviously).
To build the standalone application, I have Perl2Exe in mind. However, I have not done much research on the subject yet. If you want to tell about your favorite choice in the comments section, I'll select from the list (or I might open a poll). Documention for the Wx module also mentions PAR and Perl2App.
II. Design the UI
Here's the list of needed elements:
- Text box to enter up to 140 characters (2 lines of 70?)
- 2 check boxes for twitter
- 2 check boxes for identica
- 1 "Send" button
- 1 "Delete Last" button
- 1 menu item to create/open login file
- Errors will be displayed through message boxes.
- In the Login menu, choices will be:
- "Select Login File": window opens asking for file location. Default location used at start up.
Parses selected file and displays error message if format not recognized.
Stores login + password for whatever social website is recognized
Back in the main form, Twitter and/or Identica boxes are greyed out if no login is found.
No login/password encryption planned for the moment
- "Edit Login File" : window first pops up asking for login file location.
Allows the login file to be edited from the application. - The Twitter and Identi.ca boxes of the "Status" area will both be checked by default (if logins are provided)
- Not sure how I'm going to implement the "Delete Last" functionality yet. There is a destroy_status() method in the Net::Twitter module. I'll have to read the doc.
I'd like to use Test Driven Development for this little project but I have no experience in either TDD or writing tests for Perl applications.
For TDD, I know that you must first write a test, check that it fails, code so that the test succeeds then write the next test. Once some tests are written and pass, you can improve the program's code knowing that you have a test suite ready to check that all the features still work. That's about the extent of my knowledge on this subject but it sounds like fun :)
Concerning the tests themselves, I've read through Modern Perl Book's recent posts on testing but it hasn't sunk in with me yet. I guess I'll have to start by looking into this.
Larry Wall's quote of the day:
"The whole intent of Perl 5's module system was to encourage the growth of Perl culture rather than the Perl core."