From 97faa2919c33c764c8b5f514cc25c38caa8529c4 Mon Sep 17 00:00:00 2001 From: Antoine Waehren Date: Thu, 24 Feb 2022 09:47:54 +0100 Subject: [PATCH] =?UTF-8?q?Commit=20initial=20:=20cr=C3=A9ation=20du=20pro?= =?UTF-8?q?gramme=20de=20r=C3=A9cup=C3=A9ration=20de=20l'emploi=20du=20tem?= =?UTF-8?q?ps=20depuis=20ADE=20(test=20avec=20la=20salle=20C10)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 +++ edt.txt | 56 +++++++++++++++++++++++++++++++++++++++++++ free_rooms_unistra.py | 28 ++++++++++++++++++++++ 3 files changed, 87 insertions(+) create mode 100644 .gitignore create mode 100644 edt.txt create mode 100644 free_rooms_unistra.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6e4266f --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +__pycache__/ +*.py[cod] +*$py.class diff --git a/edt.txt b/edt.txt new file mode 100644 index 0000000..c02fae0 --- /dev/null +++ b/edt.txt @@ -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 diff --git a/free_rooms_unistra.py b/free_rooms_unistra.py new file mode 100644 index 0000000..b06e5e1 --- /dev/null +++ b/free_rooms_unistra.py @@ -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() \ No newline at end of file