Tiny Care Terminal - Dashbaord Tool to show Tweets, Git Commits and Weather

April 25, 2017 | By in LINUX HOWTO
| Reply More

Tiny Care TerminalIf you use terminal a lot and lost deep inside the code or blinking cursor then Tiny-Care-Terminal is a small dashboard that reminds you to take a break and take care of yourself. The dashboard displays your git commits for the last week, the weather and non intrusive little messages from a wistful parrot urging you to de-stress a little. The @tinycarebot tweet affirmations to their followers. "It’s totally fine if you need to take a break!" The other two bots are @selfcare_bot and @magicrealismbot. You can also configure your own twitter bot replacing any one these bots. This article covers installation of Tiny Care Terminal in Ubuntu 16.10.

1. Install NodeJS/NPM

To install Tiny care terminal uses node package manager. Therefore we will install these two in the first step.

 # curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -
 # sudo apt-get install nodejs
 # nodejs --version
 # npm --version

2. Install Tiny Care Terminal

Use node package manager to install tiny care terminal.

 # npm install -g tiny-care-terminal

Tiny care terminal uses git-standup under the hood to display the git commits in the dashboard.

 # npm install -g git-standup

3. Configure Tiny Care Terminal

Tiny Care Terminal uses few environment variable to set the city for weather information, Twitter Secret/Token, Git repository information. Set it depends on which shell you are using-

If you're using zsh, set it in .zshrc in the home directory.
if you're using bash, set it in bash_profile or profile in the home directory.
if you're using fish, use set -gx key value in ~/.config/fish/config.fish .

All the environmental variable and their values are described in github. The variables are-

TTC_BOTS: 3 twitter bots to check. The first entry in this list will be displayed in the party parrot.
TTC_REPOS: A comma separated list of repository to look at for git commits. This uses git-standup under the hood for the git commits.
TTC_WEATHER: The location to check the weather for.
TTC_CELSIUS: True or False (by default true)
TTC_APIKEYS: Make this to false if you don't want to use Twitter API keys and instead want to scrape the tweets.
TTC_UPDATE_INTERVAL: Update frequency in minutes. default is 20 minutes.

Set Twitter API keys

The dashboard reads tweet in two ways. One using API keys or through scraping. We will use API keys to read the tweets.

You need to create a new twitter apps by visiting https://apps.twitter.com/ . Click 'Create new apps' in the apps dashboard and then provide 'Name', 'Description' and 'website' value. Provide a place holder value for 'website' if you don't own a website or you don't want to place your website URL here. Tick 'Twitter development agreement' and press 'Create Your twitter application' at the bottom of the page. You can now view 'API Key' and 'API Secret' under 'keys and Access Tokens' tab. Create Access Token by clicking 'create my access token' in 'Your Access Token' section. You will get a confirmation of token generation. Copy 'API Key', 'API Secret' , 'Access Token' and 'Access Token secret' in a notepad.

Update the API key and token in the following variable.


Edit .profile or .bash_profile depending on which one you are using and append the following. Change the value according to your choice.

# cd ~
# vi .profile
# List of accounts to read the last tweet from, comma separated
# The first in the list is read by the party parrot.
export TTC_BOTS='tinycarebot,selfcare_bot,magicrealismbot'

# List of folders to look into for `git` commits, comma separated.

export TTC_REPOS='~/Tiny-Care'

# Location/zip code to check the weather for. Both 90210 and "San Francisco, CA"
# _should_ be ok (the zip code doesn't always work -- use a location
# first, if you can). It's using weather.service.msn.com behind the curtains.
export TTC_WEATHER='Guwahati'

# Set to false if you're an imperial savage. <3
export TTC_CELSIUS=true

# Unset this if you _don't_ want to use Twitter keys and want to
# use web scraping instead.
export TTC_APIKEYS=true

# Refresh the dashboard every 20 minutes.

# Twitter api keys
export TTC_CONSUMER_KEY='Your Tweeter Consumer key'
export TTC_CONSUMER_SECRET='Your Tweeter Consumer secret'
export TTC_ACCESS_TOKEN='Your Tweeter Access token'
export TTC_ACCESS_TOKEN_SECRET='Your Tweeter Access token secret'

Read the new environment.

 # source ~/.profile

Before executing the tiny care terminal, check whether you can list the commits from command line using standup-helper assuming you have already set up local git repository in ~/Tiny-Care.

 # cd /usr/lib/node_modules/tiny-care-terminal
 # sh standup-helper.sh ~/Tiny-Care
 26c0817 - Initial Commit (2 hours ago)

Once the standup helper script list the commits in the terminal, Run the tiny care terminal by executing following command from the terminal.

 # tiny-care-terminal


Google developer Monica Dinculescu created this free dashboard, which pulls messages from Twitter bots focused on self-care. Tiny care terminal is available to download on GitHub, and Dinculescu will keep updating the dashboard. Her next step is to add a bunny mascot, for those who don’t want to party with a parrot.


Tagged With :

Free Linux Ebook to Download

Leave a Reply

All comments are subject to moderation.