Skip to content

Commit

Permalink
Saving work in progress on full Mastodon post embeds.
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanbohacek committed Feb 24, 2023
1 parent 6fd09a4 commit 9b4d1b1
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions includes/post-types/bots.php
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,23 @@ function save_meta( $post_id ) {
else {
global $helpers;
if ( $helpers->is_mastodon_instance($tweet_url) ){

// $domain = $helpers->get_domain_from_url( $tweet_url );
// $bot_post_id = end(explode('/', $tweet_url));

// $request_url = "https://$domain/api/v1/statuses/$bot_post_id";

// $response = wp_remote_get( $request_url );
// $body = wp_remote_retrieve_body( $response );
// $data = json_decode( $body );

// if( !is_wp_error( $response ) ) {
// log_this(array(
// '$tweet_url' => $tweet_url,
// '$domain' => $data,
// ));
// }

$bot_tweets_html .= '<blockquote><iframe src="' . $tweet_url . '/embed" class="mastodon-embed" style="max-width: 100%; border: 0" width="400"></iframe></blockquote>';
}
}
Expand Down

0 comments on commit 9b4d1b1

Please sign in to comment.