Skip to content

Instantly share code, notes, and snippets.

@salehi
Created December 21, 2021 11:59
Show Gist options
  • Save salehi/1485fd65bd488bfaf37c06b764bb862d to your computer and use it in GitHub Desktop.
Save salehi/1485fd65bd488bfaf37c06b764bb862d to your computer and use it in GitHub Desktop.
from time import sleep
import requests
import json
def vote():
req = requests.post('https://www.menti.com/core/identifiers',
headers={'authority': 'www.menti.com',
'content-length': '0',
'pragma': 'no-cache',
'cache-control': 'no-cache',
'sec-ch-ua': '"Google Chrome";v="95", "Chromium";v="95", ";Not A Brand";v="99"',
'sec-ch-ua-mobile': '?0',
'user-agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36',
'sec-ch-ua-platform': '"Linux"',
'accept': '*/*',
'origin': 'https://www.menti.com',
'sec-fetch-site': 'same-origin',
'sec-fetch-mode': 'cors',
'sec-fetch-dest': 'empty',
'referer': 'https://www.menti.com/pkx5j1bs2n',
'accept-language': 'en-US,en;q=0.9',
'cookie': '__cf_bm=Lfz4mRc3mGmi37pEP9RYaIbYeL_vUKc0SJuK16Mmvlc-1640086852-0-AVR4nNPTXHfPaMmFSs5QJZ0eME3H3BVbOuBJib56wekhf/sx1S3X1MuTP3uH7u72Nz+Y91cwodFkO+YQ8t2ZrSM=; _dd_s=logs=1&id=11f4c59f-f8ef-45e0-977a-99172f051250&created=1640086853902&expire=1640087753904&rum=0', }
)
identifier = json.loads(req.text)['identifier']
req = requests.post('https://www.menti.com/core/votes/1b0993292d90',
headers={
'authority': 'www.menti.com',
'pragma': 'no-cache',
'cache-control': 'no-cache',
'sec-ch-ua': '"Google Chrome";v="95", "Chromium";v="95", ";Not A Brand";v="99"',
'accept': 'application/json',
'content-type': 'application/json; charset=UTF-8',
'x-identifier': identifier,
'sec-ch-ua-mobile': '?0',
'user-agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36',
'sec-ch-ua-platform': '"Linux"',
'origin': 'https://www.menti.com',
'sec-fetch-site': 'same-origin',
'sec-fetch-mode': 'cors',
'sec-fetch-dest': 'empty',
'referer': 'https://www.menti.com/pkx5j1bs2n',
'accept-language': 'en-US,en;q=0.9',
# 'cookie': '__cf_bm=Lfz4mRc3mGmi37pEP9RYaIbYeL_vUKc0SJuK16Mmvlc-1640086852-0-AVR4nNPTXHfPaMmFSs5QJZ0eME3H3BVbOuBJib56wekhf/sx1S3X1MuTP3uH7u72Nz+Y91cwodFkO+YQ8t2ZrSM=; _gid=GA1.2.82698830.1640086854; _gcl_au=1.1.2044821535.1640086854; identifier1=8fbc44a657f15cbf8a9ff7e6f68974f8df13d791574c14d739383d84f836c6e4; identifierjwt=eyJhbGciOiJIUzI1NiJ9.eyJ2b3RlcklkIjoiOGZiYzQ0YTY1N2YxNWNiZjhhOWZmN2U2ZjY4OTc0ZjhkZjEzZDc5MTU3NGMxNGQ3MzkzODNkODRmODM2YzZlNCJ9.H9iKeDscnqSHSl14tQxcy9iJkTqu4S3KQrypxLuNu1E; _gat=1; _gat_UA-23693781-9=1; _ga_2DG0V7XFEB=GS1.1.1640086854.1.1.1640087262.0; _ga=GA1.1.1647730132.1640086854; _ga_TCT6BBBKGN=GS1.1.1640086854.1.1.1640087262.0; _dd_s=logs=1&id=11f4c59f-f8ef-45e0-977a-99172f051250&created=1640086853902&expire=1640088165965&rum=0',
},
data=json.dumps({"question_type": "choices", "vote": "4"}))
if __name__ == '__main__':
for i in range(0, 10000):
sleep(0.1)
print(i)
vote()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment