A RESTful API to test if the resource at a URL uses jQuery
-
Clone the repository
-
Install 'virtualenv' to create a virtual environment for our API
pip install virtualenv
-
Setup the virtual environment
virtualenv sample_name_for_virtual_env
-
Activate the virtual environment
sample_name_for_virtual_env\Scripts\activate
-
Install the dependencies
pip install -r requirements.txt
-
Set up the database (first change to the UrlCrawler directory)
python manage.py makemigrations
python manage.py migrate
-
Run the server (on localhost:8000)
python manage.py runserver
The HTTP GET request contains a query parameter 'url'(with appropriate schema). The API consumes this request and uses the requests library, Beautiful Soup and re (Regular expressions module) to parse the HTML source of the resource to figure out if jQuery is being used.
End point - /api/checkjquery?url=https://somerandomurl.com
Methods allowed - GET
Optional Query params
&verbose=yes - Queries the API for the first line in HTML source where jQuery reference was found
&getversion=yes - Queries the API for the version of jQuery being used in the HTML source