Scrape Mastodon link

Extracts metadata from a Mastodon status URL for reuse in other shortcuts.

Matthew's Score
Total Actions
Built For

Shortcut Information

This shortcut creates a custom JSON dictionary of metadata from a status post on Mastodon.

Use this shortcut as subroutine (using Run Shortcut) inside your other shortcuts to extract information like the author name or body of the post.

This shortcut passes the ID and instance to the public Mastodon endpoint for statuses, then reforms the resulting dictionary into a custom format that only includes a single layer of data.

Note: this does not include every piece of data from the status endpoint, only those I found relevant for my uses so far.

Actions Used

Get Component of URL
Gets the specified part of the URL passed into the action. URLs are structured as follows: scheme://user:[email protected]:port/path?query#fragment.
Set Variable
Sets the value of the specified variable to the input of this action.
Split Text
Separates text passed into the action into a list.
Get Item from List
Returns one or more items from the list passed as input. You can get the first item, the last item, a random item, the item at a particular index, or items in a range of indexes.
Passes the specified URL to the next action.
Get Contents of URL
Gets the contents of URLs passed into the action. Useful for downloading files and web content, or for making API requests. Includes GET, POST, PUT, PATCH, DELETE methods, and options to add headers. To make a multipart HTTP request, choose “Form” as the request body type and add files as field values.

Extra Details

Run Shortcut deep link
Open Shortcut deep link
AppleScript code
tell application “Shortcuts Events” run shortcut “Scrape Mastodon link” end tell

More From This Folder

You Might Also Like

Get way deeper into Shortcuts – become a member.