Skip to content

🌟 πŸŽ‰ Holidays Viewer: MediaWiki API App πŸ—“οΈβœ¨ A Flask-based app to fetch and display holidays from Wikipedia using the MediaWiki Action API. πŸ” Search by date, view holidays, or add new ones to a test page with authentication. Built with Bootstrap, it’s clean, responsive, and perfect for interactive holiday exploration! 🎨🌟

License

Notifications You must be signed in to change notification settings

sundog358/daily_holiday_viewer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

12 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌞🌧️🌳🌸 Daily Holiday Viewer: MediaWiki Action API Application

The Daily Holiday Viewer is a Flask-based application that fetches and displays holiday observances for specific dates using Wikipedia's MediaWiki Action API. It allows users to explore cultural and historical holidays, search for specific dates, and contribute new holiday entries to a test Wikipedia page.


πŸ“‹ Table of Contents

  1. App Overview
  2. Architecture Overview
  3. Dependencies
  4. How It Works
  5. Step-by-Step Guide
  6. MediaWiki API Endpoints
  7. Next Steps

🌍 App Overview

The Daily Holiday Viewer enables users to:

  • πŸ“… View holidays and observances for today or any specific date.
  • πŸ” Search for holidays by month and day.
  • ✍️ Log in to add new holidays to a test Wikipedia page.
  • 🎨 Experience a clean and responsive UI built with Bootstrap and Materialize icons.

πŸ”§ Architecture Overview

The application uses a Python Flask backend to handle routes and API requests. It integrates with the MediaWiki API to fetch holiday data and dynamically renders templates using Jinja2. The frontend leverages Bootstrap for responsive design and jQuery for interactive elements like link management.


πŸ“¦ Dependencies

  • Flask: Web framework for handling routes and rendering templates.
  • Requests: Python library for making HTTP requests to the MediaWiki API.
  • Bootstrap: Provides a modern and responsive UI.
  • jQuery: Enables dynamic interactions and link updates.
  • Material Icons: Adds intuitive navigation and action icons.

πŸ’‘ How It Works

  1. Homepage: Displays holidays for today’s date by default.
  2. Search: Users can select a date to retrieve holidays for that day.
  3. Add Holidays: Authenticated users can add new holidays to a test page.
  4. Dynamic Rendering: Backend fetches data and renders it into the templates using Jinja2.

πŸ› οΈ Step-by-Step Guide

1️⃣ Set Up the Flask Application

  • File: app.py
    Initialize the Flask app with routes for:
    • πŸ“… Displaying holidays.
    • πŸ” Searching for holidays.
    • πŸ”‘ Logging in to Wikipedia.
    • ✍️ Adding new holidays.

2️⃣ Define Base Layout

  • File: templates/layout.html
    Create a base HTML layout with:
    • 🎨 Bootstrap for responsive design.
    • πŸ–ΌοΈ Materialize icons for navigation and actions.

3️⃣ List Holidays

  • File: templates/index.html
    Fetch holidays from Wikipedia using the MediaWiki Action API.
    Display the holidays for:
    • πŸ“… Today’s date.
    • πŸ“… User-selected date (optional).

4️⃣ Add Search Functionality

  • File: templates/search.html
    Add a search form allowing users to:
    • πŸ“† Select a month.
    • πŸ“† Select a day.
      Fetch and display holidays for the specified date.

5️⃣ Add New Holidays

  • File: templates/add.html
    Allow authenticated users to:
    • ✍️ Add holidays to a test page on Wikipedia using the API:Edit endpoint.
    • ✨ Highlight added holidays in bold.

6️⃣ Login to Wikipedia

  • File: templates/login.html
    Authenticate users with the API:ClientLogin endpoint.

7️⃣ Styling

  • File: static/style.css
    Apply custom CSS for:
    • 🎨 A visually appealing UI.
    • πŸ“± Mobile-friendly responsiveness.

🌐 MediaWiki API Endpoints

1️⃣ API:Parse

  • Retrieve section data and content for holidays.

2️⃣ API:ClientLogin

  • Authenticate users for adding holidays.

3️⃣ API:Edit

  • Add new holidays to a test Wikipedia page.

πŸš€ Next Steps

Expand Features
🌟 Add user accounts and permissions for better user management.
πŸ“Š Integrate analytics to track popular holidays and user activity.

Enhance Visualization
πŸ“ˆ Use charts or timelines to visualize holidays by:
πŸ“… Date.
πŸ—‚οΈ Category.

Improve API Integration
πŸ”„ Implement caching to reduce API calls for frequently accessed holidays.

About

🌟 πŸŽ‰ Holidays Viewer: MediaWiki API App πŸ—“οΈβœ¨ A Flask-based app to fetch and display holidays from Wikipedia using the MediaWiki Action API. πŸ” Search by date, view holidays, or add new ones to a test page with authentication. Built with Bootstrap, it’s clean, responsive, and perfect for interactive holiday exploration! 🎨🌟

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published