Skip to content

Instantly share code, notes, and snippets.

@pathcl
Created July 24, 2015 15:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pathcl/3f71ae09457f01f3ad2b to your computer and use it in GitHub Desktop.
Save pathcl/3f71ae09457f01f3ad2b to your computer and use it in GitHub Desktop.
session-counter.py
#!/usr/bin/env python
import requests
import warnings
import fixssl
import time
warnings.filterwarnings("ignore")
urls = [
'domain.tld'
]
while True:
for url in urls:
s = requests.Session()
s.mount('https://', fixssl.FixSSL())
req = s.get(url)
count = req.text
stats = []
stats.append(count)
payload = { 'id' : url[21], 'value': stats}
data = requests.get('domain.tld/api', data=payload)
time.sleep(0.5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment