]+)>; rel="next"/', $headers['Link'], $matches); $followings_url = $matches[1] ?? null; } else { $followings_url = null; } } while ($followings_url); return $found_target; } echo "Followers:

"; $followers_url = 'https://alceawis.com/alceawis/followers'; $followers = getFollowersFromUrl($followers_url); foreach ($followers as $follower_url) { preg_match('#https?://([a-zA-Z0-9.-]+)/users/([^/]+)#', $follower_url, $matches); if (count($matches) === 3) { $instance_url = 'https://' . $matches[1]; $username = $matches[2]; $domain = $matches[1]; $user_id = getUserId($instance_url, $username, $access_token); if ($user_id) { $found_target = checkFollowings($instance_url, $user_id, $target_username, $access_token); $found_target_str = $found_target ? 'Yes' : 'No'; echo "@$username@$domain: $found_target_str
\n"; } else { echo "User @$username not found on instance $domain
\n"; } } } ?>