Skip to content

dvishal485/dtu-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dtu-api

Unofficial Scraper API for Delhi Technological University (DTU) Webpage and results page

API Link : https://dtu-api.vercel.app/

Scrapes the following information from Official DTU Webpage :

  • Page Title
  • Last Updated Date & Time
  • Top Menu Bar
  • Menu Bar
  • Sliding Image Showcase
  • Side Menu
  • Current Note
  • Imporatant Updates
  • Current Events
  • Latest News
  • First Year Notices
  • Notices
  • Jobs
  • Tenders
  • Registeration Schedule

About the results, the scraper extracts the following from results webpage :

  • Exam Name
  • Details
  • Serial Number
  • Date

This all pretty much sums up the whole webpage contents!


Usage

API output have been classified into two different types :

  1. To extract the usually required data which usually is variable over time, use api link : https://{server_url}/api

  2. To extract data for full webpage ( required for cloning the webpage ) which is usually constant over time, use the webpage link : https://{server_url}/webpage

  3. To obtain details for results' page, use the exam link, refer to https://{server_url}/exam


Deployment

API is deployed on Vercel. Check out the API Usage and Output formats

  • Deploy on vercel directly through deployment button

    Deploy with Vercel

  • To deploy to vercel on your own, follow the following steps :

    1. Fork this repository on your system
    2. Make sure you have installed Vercel CLI
    3. Open the repository in your terminal
    4. Run command vercel --prod and follow the instructions
  • To deploy on localhost or on VPS :

    1. Install python requirements

      pip install -r requirements.txt
      
    2. Execute server.py

      python server.py
      

      or

      python3 server.py
      

Output Formats

Kindly refer to sample.json for understanding using a compact prettified JSON Output of the Scraper API (Variable Data API)

The output for the api and webpage for every field is in either one of the two formats or simply a string :

{
    "name" : "Title of information",
    "link" : "link_to_information"
}
OR
{
    "name": "Title of information",
    "sub_list": [
        {
            "name": "Title of sub-information 1",
            "link": "link_to_information"
        },
        {
            "name": "Title of sub-information 2",
            "sub_list": [
                {
                    "name": "Title of sub-information 1",
                    "link": "link_to_information"
                },
            ]
        }
    ]
}

If the output is for an image sample, then output will be in format :

{
    "name": "Name of image",
    "image_link": "link_of_image"
}

For exam link, directly refer to an example.


License & Copyright

About

Unofficial API for Delhi Technological University (DTU) website

Topics

Resources

License

Stars

Watchers

Forks

Languages