bovine.utils
activity_pub_object_id_from_html_body(body)
Determines the object identifier from the html body by parsing it and looking for link tags with rel=”alternate” and type application/activity+json
Source code in bovine/bovine/utils/__init__.py
check_max_offset_now(dt, minutes=5)
Checks that offset of a datetime to now to be less than minutes
Source code in bovine/bovine/utils/__init__.py
get_gmt_now()
Returns the current time in UTC as a GMT formatted string as used in the HTTP Date header
now_isoformat()
Returns now in Isoformat, e.g. “2023-05-31T18:11:35Z”, to be used as the value of published
parse_fediverse_handle(account)
Splits fediverse handle in name and domain Supported forms are:
- user@domain -> (user, domain)
- @user@domain -> (user, domain)
- acct:user@domain -> (user, domain)
Source code in bovine/bovine/utils/__init__.py
parse_gmt(date_string)
Parses a GMT formatted string as used in HTTP Date header
pydantic_to_json(obj)
Transforms a pydantic object from bovine.models into a dictionary, that can be serialized as json
webfinger_response_json(account, url)
helper to generate a webfinger response