Skip to content

Commit

Permalink
Graph component #1
Browse files Browse the repository at this point in the history
  • Loading branch information
Scobiform committed Apr 20, 2024
1 parent 35a9bdc commit 68bfd03
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions start.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,9 @@ async def fetch_followers():
if followers:
all_followers.extend(followers)

return jsonify(all_followers)
local_followers = [user for user in all_followers if ('@' in user['acct'] and user['acct'].split('@')[1] == config['instance_url']) or '@' not in user['acct']]

return jsonify(local_followers)
except Exception as e:
return jsonify({'error': str(e)}), 500

Expand All @@ -186,8 +188,10 @@ async def fetch_following():
following = mastodon.fetch_next(following)
if following:
all_following.extend(following)

local_following = [user for user in all_following if ('@' in user['acct'] and user['acct'].split('@')[1] == config['instance_url']) or '@' not in user['acct']]

return jsonify(all_following)
return jsonify(local_following)
except Exception as e:
return jsonify({'error': str(e)}), 500

Expand Down

0 comments on commit 68bfd03

Please sign in to comment.