Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: extract ics speakers #28

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

mmuman
Copy link
Contributor

@mmuman mmuman commented Sep 21, 2017

Some attempts at extracting speaker name(s) (currently only one) from various ICS.

Totally UNTESTED as I still can't build the app with gradle here, it doesn't even attempt to actually compile the java code so I have no way of making sure it's valid syntax.

Please test.

@mmuman
Copy link
Contributor Author

mmuman commented Sep 22, 2017

pattern would be something like (?<name>.*) — (?<speaker>.*) for Paris Web, modulo proper escaping.

@mmuman
Copy link
Contributor Author

mmuman commented Sep 22, 2017

Hmm I think role=req-participant is the default, according to spec, so maybe we should only avoid other values.

@mmuman
Copy link
Contributor Author

mmuman commented Sep 22, 2017

Ohhh, I think I finally found out how to build on Debian Sid with the packages. Had to install some google-android-* stuff, including google-android-m2repository-installer.
Now I need to fix the java syntax!

@mmuman
Copy link
Contributor Author

mmuman commented Sep 22, 2017

"added in API level 26" for Matches::group(String) :^)

@mmuman
Copy link
Contributor Author

mmuman commented Sep 23, 2017

I still can't link the app but at least the java syntax should be ok now. I reworked the last commit to use an unnamed group in the regex. Still untested.

as used in the LibrePlanet ICS

UNTESTED
The speakermatch JSON property allows passing a pattern to match
speaker name in the summary.

The Paris Web 2017 ICS does it:
http://www.paris-web.fr/2017/conferences-parisweb-2017.ics

UNTESTED
@Wilm0r
Copy link
Owner

Wilm0r commented Oct 4, 2017

OK, interesting. So just to clarify for myself (sorry, bit late for me to try to parse this all from the Github code review UI :-/ ) :

One would add a "speakermatch" attribute to the metadata for the conf (so that will only work for things in menu.json, or actually also if a (gzipped) JSON blob QR is put somewhere online for example!), which will instruct the parser to split talk descriptions cleverly into name of speaker and actual name of talk?

But I separately see mentions of the (req-)Participants fields? Which would be the preferable way, but "speakermatch" is the fallback when speaker name isn't properly separated in metadata?

@mmuman
Copy link
Contributor Author

mmuman commented Oct 4, 2017

Yes, that's two ways of doing it, either by adding a contact as participant, or by munging the summary field.
It'd just miss things like "Foo and Bar" as multiple speakers, and the current code only handles one participant, but it's a best effort, and it's hard to code when you can't actually run the thing.

I tried to add the author as participant for an event I work on, but Thunderbird keeps adding myself as organizer for some reason, and NextCloud on the other hand accepts it but the whole field is just missing in the ICS export, so I'll have to use the summary as well for the Alchimie.

@Wilm0r
Copy link
Owner

Wilm0r commented Oct 8, 2017

:-(

Yeah really xcal is just not a suitable format for this. In a way I kinda want to discourage its use, instead of jumping through lots of hoops of heuristics. Guess we can at least take this one, though? But have you been able to build/test this?

@mmuman
Copy link
Contributor Author

mmuman commented Oct 8, 2017

The code compiles but I can't get the build finished, so I can't test it.

if (localName.equals("attendee")) {
if (atts.getValue("role") == "REQ-PARTICIPANT")
eventData.put("speaker", new String(atts.getValue("cn")));
// TODO: handle more than one?
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that is for example how multiple speakers are provided in FOSDEM'S iCal file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants