Salmention Features
The process_salmention() function accepts two versions of a page: the page stored by a Webmention endpoint, and the current page.
The function compares the old and new versions of the page, looking for specified h-* objects. If it finds any, they will be added to a list.
All responses in _both_ the old and new page version are sent a Webmention notifying them that the source page has a new response.
The function returns:
A list of all the new mentions that were added to the page;
The Webmentions sent by the function and;
A list of all the mentions that were removed from the page.
- indieweb_utils.process_salmention(current_page_contents: str, original_post_contents: str, page_url: str, supported_types: list = ['h-entry'], send_upstream_webmentions: bool = True) Tuple[List[dict], List[str], List[str]] [source]
Process a Salmention. Call this function only when you receive a Webmention to a page that has already received a Webmention.
- Parameters:
- Returns:
The new nested responses, the URLs of the webmentions sent, and the URLs of the deleted posts.
- Return type:
Example:
from indieweb_utils import process_salmention process_salmention('<html>...</html>', '<html>...</html>')
There are two pre-defined helper constants that you can pass in the `supported_types`_ parameter of the process_salmention() function:
`indieweb_utils.salmention.salmention.SUPPORTED_TYPES`_ - All supported types of mentions
`indieweb_utils.salmention.salmention.EXPANDED_SUPPORTED_TYPES`_ - All supported types of mentions except replies