James commited on
Commit
c98a796
·
2 Parent(s): 6da814ecccb37c

Merge branch 'main' of https://huggingface.co/spaces/User1342/Ivory

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -4,19 +4,21 @@ from pprint import pprint
4
  from mastodon import Mastodon, MastodonNotFoundError # Mastodon.py
5
 
6
  list_of_servers = ['peoplemaking.games',
7
- 'ani.work',
8
  'libretooth.gr',
9
  'tilde.zone',
10
  'hostux.social',
11
  'social.linux.pizza',
 
12
  'toot.wales',
13
  'kolektiva.social',
 
14
  'seo.chat',
15
  'ioc.exchange',
16
  'glasgow.social',
17
  'mindly.social',
18
  'mstdn.party',
19
  'universeodon.com',
 
20
  'ravenation.club',
21
  'home.social',
22
  'techhub.social',
@@ -229,7 +231,7 @@ def block_user(user_id, user, reason):
229
  user ="alcinnz@floss.social"
230
  user_dict = client.account_search(user)
231
  pprint(user_dict)
232
-
233
  client.account_block(user_dict[0]["id"])
234
  print("Blocked {} for {}".format(user, reason))
235
  except MastodonNotFoundError as e:
@@ -263,13 +265,13 @@ def block_users(client, threshold, dataset):
263
  print("Reviewing user {}".format(user))
264
  if "Violent" in dataset:
265
  if user["violence-threshold"] >= threshold:
266
- user_id = str(user["username"])
267
  if block_user(user_id, user, "Violent"):
268
  num_users_blocked = num_users_blocked + 1
269
  continue
270
  if "Hate Speech" in dataset:
271
  if user["toxicity-threshold"] >= threshold:
272
- user_id = str(user["username"])
273
  if block_user(user_id, user, "Hate Speech"):
274
  num_users_blocked = num_users_blocked + 1
275
  continue
 
4
  from mastodon import Mastodon, MastodonNotFoundError # Mastodon.py
5
 
6
  list_of_servers = ['peoplemaking.games',
 
7
  'libretooth.gr',
8
  'tilde.zone',
9
  'hostux.social',
10
  'social.linux.pizza',
11
+ 'nerdculture.de',
12
  'toot.wales',
13
  'kolektiva.social',
14
+ 'noc.social',
15
  'seo.chat',
16
  'ioc.exchange',
17
  'glasgow.social',
18
  'mindly.social',
19
  'mstdn.party',
20
  'universeodon.com',
21
+ 'learningdisability.social',
22
  'ravenation.club',
23
  'home.social',
24
  'techhub.social',
 
231
  user ="alcinnz@floss.social"
232
  user_dict = client.account_search(user)
233
  pprint(user_dict)
234
+
235
  client.account_block(user_dict[0]["id"])
236
  print("Blocked {} for {}".format(user, reason))
237
  except MastodonNotFoundError as e:
 
265
  print("Reviewing user {}".format(user))
266
  if "Violent" in dataset:
267
  if user["violence-threshold"] >= threshold:
268
+ user_id = str(user["acct"])
269
  if block_user(user_id, user, "Violent"):
270
  num_users_blocked = num_users_blocked + 1
271
  continue
272
  if "Hate Speech" in dataset:
273
  if user["toxicity-threshold"] >= threshold:
274
+ user_id = str(user["acct"])
275
  if block_user(user_id, user, "Hate Speech"):
276
  num_users_blocked = num_users_blocked + 1
277
  continue