Commit initial : création du programme de récupération de l'emploi du temps depuis ADE (test avec la salle C10)

This commit is contained in:
Antoine Waehren 2022-02-24 09:47:54 +01:00
commit 97faa2919c
3 changed files with 87 additions and 0 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
__pycache__/
*.py[cod]
*$py.class

56
edt.txt Normal file
View File

@ -0,0 +1,56 @@
BEGIN:VCALENDAR
METHOD:PUBLISH
PRODID:-//ADE/version 6.0
VERSION:2.0
CALSCALE:GREGORIAN
BEGIN:VEVENT
DTSTAMP:20220224T084154Z
DTSTART:20220224T150000Z
DTEND:20220224T170000Z
SUMMARY:Architecture TD1
LOCATION:C10 MATH
DESCRIPTION:\n\nTP1 S3-P\nTP2 S3-P\n\n(Modifié le:24/01/2022 16:40)
UID:ADE60556e6973747261323032312d323032322d33323736342d332d30
CREATED:19700101T000000Z
LAST-MODIFIED:20220124T154000Z
SEQUENCE:-2092507296
END:VEVENT
BEGIN:VEVENT
DTSTAMP:20220224T084154Z
DTSTART:20220224T090000Z
DTEND:20220224T110000Z
SUMMARY:MPA - Algèbre jeudi S2
LOCATION:C10 MATH
DESCRIPTION:\n\nL1 MPA\nGasbarri Carlo\n\n(Modifié le:29/11/2021 12:51)
UID:ADE60556e6973747261323032312d323032322d34393538362d342d30
CREATED:19700101T000000Z
LAST-MODIFIED:20211129T115100Z
SEQUENCE:2133346260
END:VEVENT
BEGIN:VEVENT
DTSTAMP:20220224T084154Z
DTSTART:20220224T130000Z
DTEND:20220224T144500Z
SUMMARY:2- Maths pour les Sciences 2 PY-1 (Jeu 14h-15h30)
LOCATION:C10 MATH
DESCRIPTION:\n\nPY-1\nL1 Double licence PHY-STUE\nLançon Ariane\n\n(Modif
ié le:26/01/2022 21:29)
UID:ADE60556e6973747261323032312d323032322d3131353739392d332d30
CREATED:19700101T000000Z
LAST-MODIFIED:20220126T202900Z
SEQUENCE:-2092289956
END:VEVENT
BEGIN:VEVENT
DTSTAMP:20220224T084154Z
DTSTART:20220224T070000Z
DTEND:20220224T090000Z
SUMMARY:Probabilités S6 - CM
LOCATION:C10 MATH
DESCRIPTION:\n\nL3-M-S6-Maths pures\nL3-MAG S6\nZeng Xiaolin\n\n(Modifié
le:09/02/2022 13:23)
UID:ADE60556e6973747261323032312d323032322d36323034302d342d30
CREATED:19700101T000000Z
LAST-MODIFIED:20220209T122300Z
SEQUENCE:-2090919116
END:VEVENT
END:VCALENDAR

28
free_rooms_unistra.py Normal file
View File

@ -0,0 +1,28 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Feb 24 08:51:58 2022
@author: antoine
"""
import requests
import datetime
date = datetime.datetime.today().date()
day = str(date.day)
month = str(date.month)
year = str(date.year)
f = open("edt.txt", "w")
r = requests.get("https://adecons.unistra.fr/jsp/custom/modules/plannings/anonymous_cal.jsp?resources=5448&projectId=8&calType=ical&firstDate="+year+"-"+month+"-"+day+"&lastDate="+year+"-"+month+"-"+day)
#r = requests.get('https://adecons.unistra.fr/jsp/custom/modules/plannings/anonymous_cal.jsp?resources=5448&projectId=8&calType=ical&firstDate=2022-02-25&lastDate=2022-02-25')
#r = requests.get('https://adecons.unistra.fr/jsp/custom/modules/plannings/anonymous_cal.jsp?resources=5448&projectId=8&calType=ical&nbWeeks=4')
edt = str(r.text)
f.writelines(edt)
f.close()