aboutsummaryrefslogtreecommitdiff
path: root/ignis/views.py
diff options
context:
space:
mode:
authorBobby <[email protected]>2023-05-15 09:50:00 -0400
committerBobby <[email protected]>2023-05-15 09:50:00 -0400
commitfde8d006a070064feefb2d1a6f543b1dd99c1943 (patch)
tree868234a784eecc0568768e6c64b4e482e6fdd5c7 /ignis/views.py
parent4ee68386dfb9f529bd2e5accce9ad313e8c64409 (diff)
downloadthatcomputerscientist-fde8d006a070064feefb2d1a6f543b1dd99c1943.tar.xz
thatcomputerscientist-fde8d006a070064feefb2d1a6f543b1dd99c1943.zip
Update Screenshot Chat time delays
Diffstat (limited to 'ignis/views.py')
-rw-r--r--ignis/views.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/ignis/views.py b/ignis/views.py
index 89657814..54475699 100644
--- a/ignis/views.py
+++ b/ignis/views.py
@@ -176,29 +176,35 @@ def captcha_image(request, captcha_string):
@never_cache
def get_screenshot(request):
# check if screenshot exists
- if not os.path.exists('siteshot.png'):
+ if not os.path.exists('siteshots.png'):
options = webdriver.FirefoxOptions()
options.headless = True
driver = webdriver.Firefox(options=options)
driver.set_window_size(1280, 1440)
- url = 'https://www.thatcomputerscientist.com' if not settings.DEBUG else 'https://preview.thatcomputerscientist.com'
+ url = 'http://localhost:8000'
print(settings.DEBUG)
# Wait until the page is loaded
driver.get(url)
- time.sleep(10)
+ time.sleep(5)
# write 3 chat messages in #chatbox-input
chatbox = driver.find_element('id', 'chatbox-input')
chatbox.send_keys('Hello!')
+ time.sleep(0.1)
chatbox.send_keys(u'\ue007')
+ time.sleep(0.5)
chatbox.send_keys('Welcome to my website!')
+ time.sleep(0.1)
chatbox.send_keys(u'\ue007')
+ time.sleep(0.5)
chatbox.send_keys('You are currently viewing a dynamically generated screenshot of my website!')
+ time.sleep(0.1)
chatbox.send_keys(u'\ue007')
+ time.sleep(0.5)
screenshot = driver.get_screenshot_as_png()
screenshot = Image.open(BytesIO(screenshot))