
內容簡介
TootPress是一個將你的Mastodon訊息持續複製到WordPress的外掛程式,它可以按時間順序在部落格上顯示訊息,使其他人可以在Mastodon之外查看你的時間軸,並讓你重新擁有自己的數據所有權。
特點:
- 將你的toots複製回來
- 複製你的tooted圖像回來
- 在部落格上顯示你的toots
- 检索你的完整時間軸
- 語言:英語,德語(僅限前端)
問題與答案:
1. TootPress 可以刪除 Mastodon 訊息嗎?
- 不可以,它只是將你的Mastodon訊息持續複製到WordPress。
2. TootPress 可以在部落格上顯示 Mastodon 訊息嗎?
- 可以。使用 TootPress 可以按時間順序在部落格上顯示訊息,使其他人可以在Mastodon之外查看你的時間軸。
3. TootPress 需要哪些步驟進行設置?
- 首先在 WordPress 安裝外掛程式,然後在 Mastodon 上創建一個應用程序,限制授權為讀取所有數據。接下來需要維護Mastodon實例和訪問令牌,在WordPress中檢索您的帳戶ID,繼續創建一個新的WordPress頁面,啟動Steady Fetch等步驟。
4. TootPress 支援哪些 Toot 對象?
- TootPress 支援以下對象:文本,圖像,URL,Hashtags和提及。
5. TootPress 不支援哪些 Toot 對象?
- TootPress 不支援以下對象:畫廊,音頻,視頻,投票,表情符號和概述。
6. TootPress 從數據傳輸中排除了哪些 Toot 類型?
- TootPress 從數據傳輸中排除了以下 Toot 類型:提高,回复和私人Toots。
外掛標籤
開發者團隊
原文外掛簡介
TootPress copies your toots from Mastodon to WordPress continuously. The toots can be displayed chronologically in the blog, making your timeline accessible to other people outside of Mastodon. In addition, you regain ownership of your own data back.
Features
Copy your toots back
Copy your tooted images back
Display your toots on the blog
Retrieve your complete timeline
Languague: English, German (only FrontEnd)
Live Demo
Here!
Setup Manual
Install the Plugin in WordPress
Create an Application on your Mastodon Instance to get API Access (under Settings/Development)
Restrict the Authorization of the created Application to Read (all data)
Maintain Mastodon Instance and Access Token in the TootPress Settings
Retrieve your Account ID (in WordPress under Tools/Toots)
Maintain the Account ID in the TootPress Settings
Create a new WordPress Page and add the Page to your Menu
Maintain the Page ID in the TootPress Settings (you find the Page ID in URL of the Browser when editing the Page in WordPress)
Run Mastodon API Request once (in WordPress under Tools/Toots)
Activate Steady Fetch
That’s it!
Instructions for Use
You find TootPress in WordPress in the area of Settings and Tools
Steady Fetch activates the automatic and regular load of new toots
First API Request will copy your last 40 toots
New toots will be loaded every 15 minutes (customizable)
You can load your complete timeline into WordPress with the eponymous function
Loading your complete timeline can take several hours depending of the amount of toots
480 toots are loaded per hour as maximum
You can run a Mastodon API Request everytime at your own with the eponymous function
There is no prescribed order for the execution of Steady Fetch, Complete Timeline or manual requests
If problems occur, TootPress provides a Healthy Check
Further Information
Supported Toot Objects
Following toot objects are supported.
Text
Images
Galleries
URLs
Hashtags
Mentions
Not supported Toot Objects
Following toot objects are not supported.
Audio
Video
Poll
Teaser
Quotes
Excluded Toot Types
Following toot types are excluded from the data transfer.
Boosts
Replys
Private Toots
Architecture
Data storage and process logic is separated from the WordPress Framework. The toots are not saved in the table wp_posts. And TootPress is not registering a custom post type for the toots as well.
CSS classes
TootPress comes with basic CSS Styles. For best fit it is required to add additional styles in your theme. All TootPress UI elements can be addressed with individual CSS selectors. Please use the browser development tools to find the right classes.
Data & Files
TootPress creates 2 folders within the WordPress Uploads Directory.
tootpress-mastodonapidata = Archive of the received Mastodon API data
tootpress-images = Toot Image Folder
wpCrons
Steady Fetch (every 15 minutes, customizable)
Load Complete Timeline (every 5 minutes)
TootPress API
Action: tootpress_toots_update
It will be fired after toot update to execute custom post-processing.
You can use the following code.
function tootpress_toots_update_postprocessing() {
// Add your code to be executed here
}
add_action('tootpress_toots_update', 'tootpress_toots_update_postprocessing');
Filter: tootpress_preamble_filter
It outputs html content before the toot loop.
You can use the following code.
function tootpress_preamble_add( $preamble ) {
// Add your filter code here
// Example: $preamble='
Hello World.
';
return $preamble;
}
add_filter( 'tootpress_preamble_filter', 'tootpress_preamble_add', 10, 1 );
Filter: tootpress_closing_filter
It outputs html content after the last toot loop.
You can use the following code.
function tootpress_closing_add( $content ) {
// Add your filter code here
// Example: $content='
Hello World.
';
return $content;
}
add_filter( 'tootpress_closing_filter', 'tootpress_closing_add', 10, 1 );
Filter: tootpress_menu_forward_label
This filter overwrites the forward label in the bottom navigation.
You can use the following code.
function tootpress_menu_forward_label_change( $label ) {
// Add your filter code here
// Example: $label='Newer Posts';
return $label;
}
add_filter( 'tootpress_menu_forward_label', 'tootpress_menu_forward_label_change', 10, 1 );
Filter: tootpress_menu_backward_label
This filter overwrites the backward label in the bottom navigation.
You can use the following code.
function tootpress_menu_backward_label_change( $label ) {
// Add your filter code here
// Example: $label='Older Posts';
return $label;
}
add_filter( 'tootpress_menu_backward_label', 'tootpress_menu_backward_label_change', 10, 1 );
Filter: tootpress_beforeloop_filter
This filter outputs content before the toot loop (on all tootpress pages).
You can use the following code.
function tootpress_beforeloop_filter_add( $content, $page_number ) {
// Add your filter code here
// Example: $content='
Page '.$page_number.'
';
return $label;
}
add_filter( 'tootpress_beforeloop_filter', 'tootpress_beforeloop_filter_add', 10, 2 );
Filter: tootpress_afterloop_filter
This filter outputs content after the toot loop (on all tootpress pages).
You can use the following code.
function tootpress_afterloop_add( $content, $current_page_number, $last_page_number ) {
// Add your filter code here
// Example: $content='
Page '.$current_page_number.' of '.$last_page_number.'
';
return $content;
}
add_filter( 'tootpress_afterloop_filter', 'tootpress_afterloop_add', 10, 3 );
Filter: tootpress_mastodon_logo_filter
This filter overwrites the Mastodon Logo with Custom Logo.
You can use the following code.
function tootpress_mastodon_logo_change ( $img ) {
// Standard Value
//
// Add your filter code here
// Example: $img='';
return $img;
}
add_filter( 'tootpress_mastodon_logo_filter', 'tootpress_mastodon_logo_change', 10, 1 );
Filter: tootpress_between_filter
This filter adds custom HTML between the toots.
You can use the following code.
function tootpress_create_element_between ( $content ) {
// Add your filter code here
// $content='
';
return $content;
}
add_filter( 'tootpress_between_filter', 'tootpress_create_element_between', 10, 1 );
Filter: tootpress_toot_content_filter
This filter can be used to manipulate the toot content.
You can use the following code.
function tootpress_manipulate_content ( $content ) {
// Add your filter code here
// $content=str_replace('href=','target="_blank" href=',$content);
return $content;
}
add_filter( 'tootpress_toot_content_filter', 'tootpress_manipulate_content', 10, 1 );
Filter: tootpress_date_filter
This filter overwrites the date output with custom format.
You can use the following code.
function tootpress_date_custom_format ( $date, $year, $month, $day, $hour, $minute, $second ) {
// $date = 2023-05-30 22:40:28
// $year = 2023
// $month = 05
// $day = 30
// $hour = 22
// $minute = 40
// $second = 28
// Add your filter code here
// $date=$day.'.'.$month.'.'.$year.' '.$hour.':'.$minute.':'.$second;
return $date;
}
add_filter( 'tootpress_date_filter', 'tootpress_date_custom_format', 10, 7 );
Filter: tootpress_image_filter
This filter can be used to manipulate image tags.
You can use the following code.
function tootpress_image_manipulate ($img_tag,$filename,$description,$width,$height,$image_directory_path,$amount_of_images,$image_number) {
// Amount of Images
// ----------------
// 1 = Single Image
// >1 = Gallery + Size of Gallery
// Image Number
// ------------
// This number indicates position within the gallery
// Add your filter code here
// $img_tag=str_replace('alt=','class="tootpress-image" alt=',$img_tag);
return $img_tag;
}
add_filter( 'tootpress_image_filter', 'tootpress_image_manipulate', 1, 8 );
Related Links
Source Code @ GitHub
Official Plugin Page (German)
