https://github.com/ncrocfer/twitter-calendar
Twitter contributions calendar
https://github.com/ncrocfer/twitter-calendar
Last synced: 9 months ago
JSON representation
Twitter contributions calendar
- Host: GitHub
- URL: https://github.com/ncrocfer/twitter-calendar
- Owner: ncrocfer
- Created: 2015-08-22T17:26:01.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2015-08-22T17:27:29.000Z (almost 11 years ago)
- Last Synced: 2025-02-16T14:07:34.455Z (over 1 year ago)
- Language: Python
- Size: 141 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
Awesome Lists containing this project
README
Twitter contributions calendar
==============================
Like Github does it for its `contributions calendar `_, this tool displays a user's tweets in a dynamic calendar using the awesome `Cal-Heatmap `_ library:
.. image:: https://raw.githubusercontent.com/ncrocfer/twitter-calendar/master/calendar.png
:alt: Twitter contributions calendar
:width: 700
:height: 282
:align: center
Usage
-----
It's a simple script to launch, so I don't create the :code:`setup.py` file. To use it :
.. code-block:: bash
$ git clone https://github.com/ncrocfer/twitter-calendar.git
$ cd twitter-calendar
$ pip install -r requirements.txt
Create a new `Twitter app `_ and fill in the :code:`CONSUMER_KEY`, :code:`CONSUMER_SECRET`, :code:`ACCESS_KEY` and :code:`ACCESS_SECRET` variables. Then you can get the tweets specifying the user's account :
.. code-block:: bash
$ python twitter-calendar.py -u ncrocfer
[*] 399 tweets downloaded
[*] 598 tweets downloaded
...
You can now copy the generated :code:`tweets.json` and :code:`index.html` files in your web root directory and see the results :)
Notes
-----
- Due to a limitation `imposed `_ by Twitter, this script can only return up to **3,200** of a user's most recent Tweets.
- It is a simple script for now, but many improvements are possible (for example the script can be placed in a CRON job, or it could be a real web app with the help of Flask or Django). I will look to do this in the future.