This screenshot shows an example tweet. The bottom numbers display the term's elapsed days / days left / total days.
Term Progress is a Twitter bot written in C#
/.NET Core
and inspired by @year_progress
that periodically creates tweets with information about public officials' terms advance status. It was created originally for @mandatopresiAR
, to track the argentine presidential term, but it can be extended to any public official tenure.
It's designed as a web API that listens to incoming status creation requests, and a worker (Azure Function) responsible for making those requests on a time schedule.
-
Get a Twitter dev account on https://developer.twitter.com/.
-
Set the following environment variables on your
TermProgress.WebAPI
production environment:ApplicationOptions:ApiKey
: the API key.TwitterClientOptions:AccessToken
: your Twitter access token.TwitterClientOptions:AccessTokenSecret
: your Twitter access token secret.TwitterClientOptions:ConsumerKey
: your Twitter consumer key.TwitterClientOptions:ConsumerSecret
: your Twitter consumer secret.
-
Set the following values on
TermProgress.WebAPI/appsettings.json
:Culture
: Set the desired culture that will be used on tweet generation. By default, it ises-AR
.StartingDateTime
: set a date and time corresponding to the first day of the term. For example, if the term you would like to track starts on January, 1st, 2021, you should set the value to2021-01-01T00:00:00
.EndingDateTime
: set a date and time corresponding to the midnight after the last day of the term. For example, if the term you would like to track ends on December, 31st, 2021, you should set the value to2022-01-01T00:00:00
.
-
Set the following environment variables on your
TermProgress.Functions
production environment:ApplicationOptions:ApiKey
: the API key; must be the same as the one you set on yourTermProgress.WebApi
ApplicationOptions:ApiKey
environment variable.ApplicationOptions:PublishingEndpointUrl
: your publishing endpoint URL. By default, it isyourdomain.com/api/v1/termprogress/twitter
.
You should set your worker function as a timer triggered every midnight.
This software is licensed under the GNU General Public License v3.0.