Coder Social home page Coder Social logo

shalomscott / answer-corona-survey Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 104 KB

"You are feeling great. In fact you are SO good, never been better. You really do not need that survey. Let me take care of it." - Automatically fills out and submits a daily required health survey. For the times of Covid-19.

JavaScript 68.05% Shell 6.01% HTML 20.69% CSS 5.25%
captcha-solution survey scraper aws lambda

answer-corona-survey's Introduction

Answer Corona Survey ๐Ÿค–

How it Works

  1. User navigates to https://lambda_host/{USERS_TZ}
  2. Lambda function receives a request for /{USERS_TZ}.
    • Requests the survey page from Survey Website.
    • Saves the response cookies.
    • Requests the associated captcha.jpeg file.
    • Returns an HTML page with the embedded captcha.jpeg.
  3. User receives the HTML page.
    • User's browser cracks the captcha puzzle.
    • Browser sends POST request to /{USERS_TZ}/solution with the captcha solution as payload.
    • User is redirected to "All done" page.
  4. Lambda gets POST for /{USERS_TZ}/solution
    • Retrieves the cookies for USERS_TZ (because Lambdas are stateless)
    • Sends a survey submission to Survey Website with the appropriate cookies and captcha solution.
  5. Done โœ‹๐ŸŽค

Rationale

In the beginning, several naive approaches were attempted. Of course, initially I tried to crack the captcha inside the lambda itself, which would then allow me to run the function automatically, and on a schedule. However, it quickly became apparent that every method of OCR would need some special binaries which were not automatically supplied inside a Lambda. There exists a solution where one can create a custom Lambda Layer with any necessary binaries baked in, but I wasn't about that. In the end, the solution opted for was one where the user's browser does the heavy lifting.

Sadly this requires the human involvement of actually opening up a link. I am still convinced the result is much easier than filling out a survey by hand. Plus... it's kinda cool.

answer-corona-survey's People

Contributors

shalomscott avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.