Comments (6)
from giggity.
At least it's valid UTF-8…
Ohhh, got it : it doesn't have DTEND but instead events have a DURATION. First time I see this.
from giggity.
So, managed to write a python script to massage it until Giggity gets a fix:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import re
import time
content = ''
with open("conferences-parisweb-2017.ics", 'rb') as f:
dtstart = ''
for line in f:
dline = line.decode()
# cleanup bad escaping
dline = dline.replace('\\\\\\,', ',')
dline = dline.replace('\\\\,', ',')
dline = dline.replace('\\,', ',')
# convert DURATION to DTEND
if dline.find('DTSTART:') == 0:
dtstart = dline
if dline.find('DURATION:') == 0:
m = re.match('^DURATION:PT(.*)M.*$', dline)
duration = int(m.group(1))
tm = time.strptime(dtstart, 'DTSTART:%Y%m%dT%H%M%SZ\r')
tm = time.mktime(tm)
tm = tm + duration * 60
tm = time.localtime(tm)
tm = time.strftime('DTEND:%Y%m%dT%H%M%SZ\r', tm)
print(dtstart)
dline = tm
print(m.groups())
print(dline)
content = content + dline
with open("conferences-parisweb-2017.fixed.ics", 'w') as f:
f.write(content)
from giggity.
Of course they changed their ICS the day before the event, but without adding a DTEND. The fixed python (and I missed a \n previously anyway):
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import re
import time
content = ''
with open("conferences-parisweb-2017.ics", 'rb') as f:
dtstart = ''
for line in f:
dline = line.decode()
# cleanup bad escaping
dline = dline.replace('\\\\,', ',')
#dline = dline.replace('\\,', ',')
# convert DURATION to DTEND
if dline.find('DTSTART;VALUE=DATE-TIME:') == 0:
dtstart = dline
if dline.find('DURATION:') == 0:
m = re.match('^DURATION:PT(.*)M.*$', dline)
duration = int(m.group(1))
tm = time.strptime(dtstart, 'DTSTART;VALUE=DATE-TIME:%Y%m%dT%H%M%SZ\r')
tm = time.mktime(tm)
tm = tm + duration * 60
tm = time.localtime(tm)
tm = time.strftime('DTEND:%Y%m%dT%H%M%SZ\r\n', tm)
print(dtstart)
dline = tm
print(m.groups())
print(dline)
content = content + dline
with open("conferences-parisweb-2017.fixed.ics", 'w') as f:
f.write(content)
from giggity.
It shouldn't be too hard to support this, but I still can't fully build here on Debian, so can't really help yet.
from giggity.
Yeah, I've never really tried to build this with anything other than Android Studio (or Eclipse back when that was the official choice).
So hmmm... Let me see whether I can add this.
from giggity.
Related Issues (20)
- URL of website does not resolve anymore HOT 1
- Support Sched conferences better HOT 4
- MalformedURLException on Google-managed calendar for RIOT summit HOT 3
- java.lang.NullPointerException on JRES 2022 HOT 10
- Feature request: Add personal meetings HOT 1
- Feature request: Remove imported .ics-files HOT 1
- Bug: updating an ics does not change event name
- events seems to have different starttime in the gui HOT 2
- Pretalx files can contain events with non-unique id= values, consider switching to guid= HOT 8
- add notification when a new event is added HOT 2
- How to activate dark mode? HOT 4
- title and day dates not displayed HOT 2
- Collaborate with other apps? HOT 4
- Instant crash when trying to open any conference program HOT 15
- Remove urllib3 dependency from ggt/
- Add logo to F-droid
- RFC: Discover schedule.xml URL/location HOT 8
- The icons at https://ggt.gaa.st/#url=foo are broken
- Confusing loading state in Battery Saver
- Export/Import saved items of a conference
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from giggity.