Giter VIP home page Giter VIP logo

programming-contest-scraper's Introduction

Programming Contest Scraper and API

This project consists of a Python-based web scraper (ContestScraper) for programming contests from various platforms and a Flask API to serve the scraped data.

Features

  • Contest Scraper: Scrape programming contest information from multiple platforms and save it in JSON format.
  • Flask API: Serve the scraped contest data through a RESTful API.

API Schema

The Flask API provides the following endpoint:

  • GET /contests/<platform>: Retrieve contest data for a specific platform.

The response is a JSON object with the following structure:

{
  "contests": [
    {
      "name": "Contest Name",
      "url": "Contest URL",
      "start_time": "Start Time in ISO 8601 Format",
      "end_time": "End Time in ISO 8601 Format",
      "duration": "Duration in human-readable format (e.g., 3 hours, 30 minutes)",
      "type": "Type of the contest",
      "in_24_hours": "Yes or No, indicating if the contest starts within 24 hours",
      "status": "Current status (e.g., 'CODING', 'BEFORE')"
    },
    ...
  ]
}

Replace <platform> in the endpoint with the desired platform name (e.g., codeforces, hackerrank).

Getting Started

Prerequisites

  • Python 3.8 or higher
  • Flask
  • Other dependencies listed in requirements.txt

Installation

  1. Clone the repository:

    git clone https://github.com/gurtejrehal/programming-contest-scraper.git
    cd programming-contest-scraper
  2. Install the required packages:

    pip install -r requirements.txt

Usage

  1. Run the scraper to collect contest data:

    python contest_scraper.py

    This will scrape the contest data and save it in the output directory.

  2. Start the Flask server:

    flask run

    The API will be available at http://127.0.0.1:5000/.

API Endpoints

  • Get Contest Data: GET /contests/<platform>

    Replace <platform> with the platform name to retrieve its contests (e.g., codeforces, hackerrank).

Example

To get contests from Codeforces:

curl http://127.0.0.1:5000/contests/codeforces

Contributing

Contributions are welcome! Please feel free to submit a pull request.

Developer

  • Gurtej Rehal

License

This project is licensed under the MIT License - see the LICENSE file for details.

programming-contest-scraper's People

Contributors

gurtejrehal avatar

Stargazers

KALINGA ABHISEK avatar Rajib Dab avatar Ayush Singhal avatar

Watchers

 avatar

Forkers

ayushs-2k4

programming-contest-scraper's Issues

Please provide API link

Hello Developer,
Please provide the API link so that it can be used in projects, I have a built a contest Calendar Chrome Extension that was using KontestAPI but as the developer discontinued the API management my project(Extension) is not working and this is my main project, It will be very helpful if you could help me with that.

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.