Skip to content

Auto Wesite Visitor Python Script #364

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 3, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions Auto Website Visitor
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
##--- Auto Website Visitor by khalsalabs ---- ####
import urllib2
import random
import threading
import sys
import time
class Connect:
req = urllib2.Request('http://your-website-name.com')
con_sucess, con_failed, con_total=0,0,0
url_total, proxy_total= 0,0
url_list =[]
proxy_list= []
agent_list =[]

def __init__(self):
pF = open('proxy.txt','r')
pR = pF.read()
self.proxy_list = pR.split('n')

uF = open('url.txt','r')
uR = uF.read()
self.url_list = uR.split('n')

aF = open('agent.txt','r')
aR = aF.read()
self.agent_list = aR.split('n')

def prep_con(self):
rURL = random.randint(0,(len(self.url_list))-1)
self.req = urllib2.Request(self.url_list[rURL])
rAGENT = random.randint(0,(len(self.agent_list))-1)
self.req.add_header('User-agent',self.agent_list[rAGENT])

def make_con(self):
count, time_stamp =0,0
for proxy in self.proxy_list:
self.req.set_proxy(proxy,'http')
if count%4==0:
if self.con_total < 2*count:
time_stamp = 6
else:
time_stamp = 3
threading.Thread(target=self.visitURL).start()
time.sleep(time_stamp)
count += 1

def visit(self):
try:
f = urllib2.urlopen(self.req)
self.con_sucess += 1
except:
self.con_failed += 1
self.con_total += 1
print self.con_total,"total connections, success = ",self.con_sucess," failed= ",self.con_failed

def visitURL(self):
self.prep_con()
self.visit()

if __name__ == "__main__":
cnct = Connect()
cnct.make_con()