forked from lambdaJasonYang/Automated-GoogleForms-Submitter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PySubmitGForms.py
69 lines (48 loc) · 1.92 KB
/
PySubmitGForms.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#jy1486 github
import http.client
import urllib.parse
import urllib.request
import random
import string
import re
#Let targetsite be https://docs.google.com/forms/d/e/EEEEEEEEEEEEEGGGGGGGGGGGGGGGGGGG/
#change urlin to your target site
urlin = 'https://docs.google.com/forms/d/e/1FAIpQLSeO5XXQMMg0nfPP7-jHpwB69TjVpy59mWkxhc2_dKYhlXy08A/'
#set mmsg to your content
mmsg = 'Thor: Ragnarok'
urlt = "".join(re.findall('https:\/\/docs.google.com(\/forms\/d\/e\/[0-9a-zA-Z-]*\/)',urlin))
url = urlt + 'viewform'
urlr = urlt + 'formResponse'
# the number of times you submit the form, note at numbers like 9999 you will have to wait a long time
numOfsubmit = 400
for i in range(0,(numOfsubmit + 1)):
h2 = http.client.HTTPSConnection('docs.google.com:443')
h4 = h2.connect()
h2.request("GET",url)
h5 = h2.getresponse()
src = h5.read().decode("utf-8)")
stringg = re.findall('name="fbzx" value="(..[0-9]*)', src)
stringy = "".join(stringg)
urlh = urlt + 'viewform?fbzx='+ stringy
data = urllib.parse.urlencode({
#look at source code of google form to get name of entry
#should look like '<input type="text" name="entry.5926704" '
#if radio,dropdown,etc are used content must be limited to those options
#Edit the entry.__________ : ______ ,
'entry.1547587782': mmsg,
'entry.1643359058': mmsg,
'fvv':'1',
'draftResponse':'[,,"'+ stringy +'"]',
'pageHistory':'0',
'fbzx':stringy
})
header = {'referer' : urlh,
'origin' :"https://docs.google.com",
"content-type":"application/x-www-form-urlencoded",
'Upgrade-Insecure-Requests': '1',
'accept':'text/html'
}
h2.request("POST",urlr,data,header)
h2.getresponse()
#print(h2.getresponse().read())
print(stringy)