Short Program using Transavia's API to notify via email an user waiting for a flight at special dates and with the best price

Overview

Flight-Notifier

Short Program using Transavia's API to notify via email an user waiting for a flight at special dates and with the best price

Algorithm returning a list which contains all the days between the day of the function call and an asked limit date:

These are Python functions which can be linked together to get a full list or separately to get different informations according to different parameters. For a fully functional program you need to work with the library datetime

# Function checking whether it is a leap year or not:
def bissextile():
    year = int(datetime.today().strftime('%Y'))
    if year%4==0:
        if year%100==0 and year%400==0 or year%100!=0:
            return 1
    return 0
# Function returning the number of days in a month according to the given month in parameter:
def lenMonth(m):
    dayArray = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
    if  m-1==1:
        return dayArray[m-1] + bissextile()
    else:
        return dayArray[m-1]
# Function checking if the program went through all the days between the day of the request and the limit date:
def checkYear(val,month,day):
    ar = val[len(val)-1].split("-")
    if int(ar[1])==month and int(ar[2])==day:
        ret = val
        return(ret)
    else:
        return checkMonth(val)
# function checking if the program went through all the days of one month :
def checkMonth(val):
    ar = val[len(val)-1].split("-")
    if int(ar[2]) == lenMonth(int(ar[1])):
        return newDay(val,True)
    else:
        return newDay(val)
# function adding a new day to the final day:
def newDay(val,bool=False):
    ar = val[len(val)-1].split("-")
    if bool:
        d = ar[0]+"-"+str(int(ar[1])+1).zfill(2)+"-01"
        val.append(d)
        return checkYear(val)
    else:
        d = ar[0]+"-"+ar[1]+"-"+str(int(ar[2])+1).zfill(2)
        val.append(d)
        return checkYear(val)
You might also like...
Telegram Bot to store Posts and Documents and it can Access by Special Links.

File-sharing-Bot Telegram Bot to store Posts and Documents and it can Access by Special Links. I Guess This Will Be Usefull For Many People..... 😇 .

File-sharing-Bot: Telegram Bot to store Posts and Documents and it can Access by Special Links.

File-sharing-Bot Telegram Bot to store Posts and Documents and it can Access by Special Links. I Guess This Will Be Usefull For Many People..... 😇 .

Telegram Bot to store Posts and Documents and it can Access by Special Links.
Telegram Bot to store Posts and Documents and it can Access by Special Links.

Telegram Bot to store Posts and Documents and it can Access by Special Links. I Guess This Will Be Usefull For Many People..... 😇 . Features Fully cu

Bot to notify when vaccine appointments are available
Bot to notify when vaccine appointments are available

Vaccine Watch Bot to notify when vaccine appointments are available. Supports checking Hy-Vee, Walgreens, CVS, Walmart, Cosentino's stores (KC), and B

Github repository started notify 💕
Github repository started notify 💕

Github repository started notify 💕

A Telegram bot that scrapes websites for available vaccination appointments to notify users. (German)
A Telegram bot that scrapes websites for available vaccination appointments to notify users. (German)

@dachau_impf_bot 🇬🇧 A Telegram bot to check the contents of https://termin.dachau-med.de for available slots and inform users of the available dates

An implementation of webhook used to notify GitHub repository events to DingTalk.

GitHub to DingTask An implementation of webhook used to notify GitHub repository events to DingTalk.

OSINT tool to get information from a Github and Gitlab profile and find user's email addresses leaked on commits.

gitrecon OSINT tool to get information from a Github or Gitlab profile and find user's email addresses leaked on commits. 📚 How does this work? GitHu

ANKIT-OS/STYLISH-TEXT is a special repository. Its Is A Telegram Bot Which Can Translate Your Text Into 100+ Language
ANKIT-OS/STYLISH-TEXT is a special repository. Its Is A Telegram Bot Which Can Translate Your Text Into 100+ Language

🔥 ᴳᴼᴼᴳᴸᴱ⁻ᵀᴿᴬᴺᔆᴸᴬᵀᴱᴿ 🔥 The owner would not be responsible for any kind of bans due to the bot. • ⚡ INSTALLING ⚡ • • 🛠️ Lᴀɴɢᴜᴀɢᴇs Aɴᴅ Tᴏᴏʟs 🔰 • If

Owner
Wassim
Wassim
Discord bot to monitor collection of mods on the Steam Workshop and notify on update to selected discord server via Nextcordbot API.

Steam-Workshop-Monitor Discord bot to monitor collection of mods on the Steam Workshop and notify on update to selected Discord channel via Nextcordbo

null 7 Nov 3, 2022
An Amazon Price Tracker app helps you to buy which product you want within sale price by sending an E-Mail.

Amazon Price Tracker An Amazon Price Tracker app helps you to buy which product you want within sale price by sending an E-Mail. Installing Download t

Aytaç Kaşoğlu 2 Feb 10, 2022
Python app to notify via slack channel the status_code change from an URL

Python app to notify, via slack channel you choose to be notified, for the status_code change from the URL list you setup to be checked every yy seconds

Pedro Nunes 1 Oct 25, 2021
This is to notify you via Discord whenever there is a new beacon.

BeaconNotifier-Discord This is to notify you via Discord whenever there is a new beacon. Make sure you have python3 installed Steps: Create a Discord

null 26 Dec 28, 2022
Telegram Bot to save Posts or Files that can be Accessed via Special Links

OKAERI-FILE Bot Telegram untuk menyimpan Posting atau File yang dapat Diakses melalui Link Khusus. Jika Anda memerlukan tambahan module lagi dalam rep

Wahyusaputra 5 Aug 4, 2022
Creating a Python API, for the MakeMyTrip Flight Schedules.

MakeMyTripAPI Creating a Python API, for the MakeMyTrip Flight Schedules. Source: MakeMyTrip is an Indian online travel company founded in 2000. Headq

Aman Priyanshu 0 Jan 12, 2022
ANKIT-OS/TG-SESSION-HACK-BOT: A Special Repository.Telegram Bot Which Can Hack The Victim By Using That Victim Session

?? ᵀᴱᴸᴱᴳᴿᴬᴹ ᴴᴬᶜᴷ ᴮᴼᵀ ?? The owner would not be responsible for any kind of bans due to the bot. • ⚡ INSTALLING ⚡ • • ??️ Lᴀɴɢᴜᴀɢᴇs Aɴᴅ Tᴏᴏʟs ?? • If

ANKIT KUMAR 2 Dec 24, 2021
Chronocalc - Calculates the dates and times when the sun or moon is in a given position in the sky

Chronocalc I wrote this script after I was busy updating my article on chronoloc

null 16 Dec 13, 2022
Notflix - Notion / Netflix and IMDb to organise your movie dates. Happy Valentine <3 from 0x1za

Welcome to notflix ?? This is a project to help organise shows to watch with my

Mwiza Ed' Simbeye 3 Feb 15, 2022