Skip to content

Instantly share code, notes, and snippets.

@minimasoft
Created March 17, 2025 19:44
Show Gist options
  • Select an option

  • Save minimasoft/b97c1700ba71b04e08b3160d9986bcd9 to your computer and use it in GitHub Desktop.

Select an option

Save minimasoft/b97c1700ba71b04e08b3160d9986bcd9 to your computer and use it in GitHub Desktop.
misa_loader
from pathlib import Path
from time import sleep
import requests
import json
url = 'https://mass-block-twitter-server.rxliuli.com/api/modlists/users'
headers = {
'accept': '*/*',
'accept-language': 'en-US,en;q=0.9,es-US;q=0.8,es;q=0.7',
'authorization': 'Bearer #GET_YOURS_:D_#',
'cache-control': 'no-cache',
'content-type': 'application/json',
'dnt': '1',
'origin': 'https://x.com',
'pragma': 'no-cache',
'priority': 'u=1, i',
'referer': 'https://x.com/',
'sec-ch-ua': '"Chromium";v="134", "Not:A-Brand";v="24", "Google Chrome";v="134"',
'sec-ch-ua-mobile': '?0',
'sec-ch-ua-platform': '"Linux"',
'sec-fetch-dest': 'empty',
'sec-fetch-mode': 'cors',
'sec-fetch-site': 'cross-site',
'user-agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36'
}
with open('misa.json', 'r', encoding='utf-8') as misa_file:
misa_members = json.load(misa_file);
pager_path = Path('misa_pager.json')
if pager_path.exists() == True:
with open('misa_pager.json', 'r', encoding='utf-8') as pager_file:
pager_data = json.load(pager_file)
else:
pager_data = {'i': 0, 'p': 20}
i = pager_data['i']
l = len(misa_members)
p = pager_data['p']
while pager_data['i']<=l:
misa_page = misa_members[i:i+p]
i += p
# [{'id': '1759646691316105216', 'screen_name': 'TonioAbrazo', 'name': 'Tonio', 'profile_image_url': 'https://pbs.twimg.com/profile_images/1825654889688481792/AGw5QSoa_normal.jpg', 'is_blue_verified': True, 'community_role': 'Admin'}]
data = {
"modListId": "01JPJRMHR77EBETF7V56DX8HKE", # Replace this with the actual mod list ID if needed
"twitterUsers": [
{
"id": subnormal['id'],
"screen_name": subnormal['screen_name'],
"name": subnormal['name'],
"description": "zoi ezpesial",
"profile_image_url": 'profile_image_url',
"created_at": "2025-02-16T17:10:07.000Z",
"updated_at": "2025-03-17T19:17:51.059Z",
"followers_count": 0, # HAHAHAH
"friends_count": 0, # HAHAHAHAHA
"default_profile": True,
"default_profile_image": False,
"is_blue_verified": subnormal['is_blue_verified'],
"location": "",
"added": False
} for subnormal in misa_page
]
}
response = requests.post(url, headers=headers, json=data)
print(response.status_code)
print(response.text)
pager_data['i'] = i
pager_data['p'] = p
with open(pager_path, 'w', encoding='utf-8') as pager_file:
json.dump(pager_data, pager_file)
# Don't kill our friend's API
sleep(2.0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment