A twitter-clone backend using Python and Redis
Project description
A twitter-clone backend using Python and Redis.
Note that this package requires Python 3.6 and later since it depends on Python 3.6 built-in module `secrets <https://docs.python.org/3/library/secrets.html>`__.
To get the help information,
$ ./pytwis_clt.py -h
$ ./pytwis_clt.py --help
1. Connect to the twitter clone.
Connect to the local Redis server at the default port 6379 with no password.
$ ./pytwis_clt.py
Connect to a remote Redis server with IP = xxx.xxx.xxx.xxx at port yyyy with password zzzzzz.
$ ./pytwis_clt.py -h xxx.xxx.xxx.xxx -p yyyy -a zzzzzz
2. Online commands after successfully connecting to the twitter clone.
Note that the following commands have to be executed after a successful log-in.
logout
changepassword
follow
unfollow
followers
followings
post
Register a new user xxxxxx with password yyyyyy.
> register xxxxxx yyyyyy
Log into a user xxxxxxx with password yyyyyy.
> login xxxxxx yyyyyy
Log out.
> logout
Change the password. Assume that the old password is yyyyyy and the new password is zzzzzz.
> changepassword yyyyyy zzzzzz zzzzzz
Follow a user xxxxxx.
> follow xxxxxx
Unfollow a user.
> unfollow xxxxxx
Get the follower list of a user.
> followers
Get the following list of a user.
> followings
Post a tweet
> post tweet
Get the general/user timeline.
> timeline [max-tweet-count]
It will return the user timeline if a user is logged in and will return the general timeline otherwise. Also, it will return all the tweets in the timeline if max-tweet-count is not specified.
Exit the console program.
> exit
or
> quit
3. Unit test.
Since this unit test requires a running local Redis server, it is in fact a small integration test. To run the test,
$ python3 -m unittest -v
or
$ python3 pytwis_test.py
or
$ ./pytwis_test.py
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.