This project implements a command line API and mimics the basic workings of a platform like twitter. It is written in Python 3.4 and is to be run in the terminal.
It is possible to register new users and to log them in and out from the terminal. When a user is logged in he can post status updates and follow other users and display the posts of all uses he is following. Only one user can be logged on through the terminal session. A public time line is visible of each user regardless of the logon status.
Error messages are displayed upon invalid input. The terminal session is ended by pressing Enter.
Currently tests are available for the service api.
-
To start the program in the terminal type:
$python3 start_api.py
-
To register a user you can type '--register' or '-r'. This command needs to be followed by the first, last and user name and password for the new user. If the user is registered successfully a registration message is displayed. eg:
--register Tim Timber timt qwerty
-
A user can be logged in with '--login' or '-li' followed by the user name and password of the user. The logged in user is then displayed. eg:
-li timt qwerty
-
Once a user is logged in he can post with '--post' or '-p' followed by a text. The post is then confirmed. eg:
--post This is my first post.
-
A logged in user can follow other users with '--follow' or '-f' followed by a valid user name. The connection is then confirmed. eg:
--follow benh
-
A logged in user can see all the posts of the uses he is following by typing '--showfollowing' or '-sf':
-sf
-
A logged in user can be logged out with '--logout' or '-lo' and the user name:
--logout timt
-
To view the public time line of users use '--timeline' or '-tl' followed by the user name. eg:
-tl timt
-
The help menu can be viewed by entering '--help' or '-h'.
This program is by no means complete and many features can be added to mature it.
Those things can be added to improve usability:
- restricting the length of posts
- some more basic features for user interactions
- tests for the other program parts
- folder structure of the project
- more descriptive error messages
When there is lots of time and it should become a real project continue here:
- date and time adding
- password strength tester
- session token expiration
- connect the repository to a data base
- user management