Added user buffers (buffers for followers, following, blocked and muted users for now)

This commit is contained in:
2022-11-13 22:17:28 -06:00
parent 2a0e73ad33
commit 035de92496
10 changed files with 216 additions and 29 deletions

View File

@@ -95,24 +95,22 @@ def render_toot(toot, template, relative_times=False, offset_hours=0):
result = remove_unneeded_variables(result, toot_variables)
return result
def render_person(user, template, relative_times=True, offset_hours=0):
def render_user(user, template, relative_times=True, offset_hours=0):
""" Renders persons by using the provided template.
Available data will be stored in the following variables:
$display_name: The name of the user, as theyve defined it. Not necessarily a persons name. Typically capped at 50 characters, but subject to change.
$screen_name: The screen name, handle, or alias that this user identifies themselves with.
$location: The user-defined location for this accounts profile. Not necessarily a location, nor machine-parseable.
$description: The user-defined UTF-8 string describing their account.
$followers: The number of followers this account currently has. This value might be inaccurate.
$following: The number of users this account is following (AKA their “followings”). This value might be inaccurate.
$favorites: The number of Tweets this user has liked in the accounts lifetime. This value might be inaccurate.
$tweets: The number of Tweets (including retweets) issued by the user. This value might be inaccurate.
$toots: The number of Tweets (including retweets) issued by the user. This value might be inaccurate.
$created_at: The date and time that the user account was created on Twitter.
"""
global person_variables
display_name = user.display_name
if display_name == "":
display_name = user.username
available_data = dict(display_name=display_name, screen_name=user.acct, followers=user.followers_count, following=user.following_count, favorites=user.favourites_count, toots=user.statuses_count)
available_data = dict(display_name=display_name, screen_name=user.acct, followers=user.followers_count, following=user.following_count, toots=user.statuses_count)
# Nullable values.
nullables = ["description"]
for nullable in nullables: