Cumulus / Syndic

RSS and Atom feed parsing
MIT License
34 stars 13 forks source link

Conversion functions #17

Closed Chris00 closed 10 years ago

Chris00 commented 10 years ago

Functions (doing their best) to convert RSS1 and RSS2 to Atom would be useful.

dinosaure commented 10 years ago

It will be difficult in this direction. RSS 1.0 is poorer in information than Atom. However, we can imagine a function prennant a RSS 1.0 and missing information (as labeled argument) to produce an Atom feed.

Chris00 commented 10 years ago

It will be difficult in this direction. RSS 1.0 is poorer in information than Atom.

Sorry, I do not follow you. What I'd like is RSS2 → Atom and (for completeness) RSS1 → Atom.

dinosaure commented 10 years ago

It is this direction. RSS 1.0 contains less information that are required at Atom. I am not against this feature and we could imagine this code:

val to_atom : Syndic_rss1.rdf ->
  ?categorie:Syndic_atom.categorie ->
  ?contributors:Syndic_atom.contributor ->
  ...
  Syndic_atom.feed

What I mean is that such conversion will not happen by magic.

Chris00 commented 10 years ago

OK, got you. Many fields in the Atom feed are optional however so it won't be a big problem (and optional arguments to supply them are good).

Chris00 commented 10 years ago

I created a branch with a conversion function from RSS2 → Atom: to_atom

Chris00 commented 10 years ago

I'll be glad if you have some time to check it — and suggest any improvement! I'll then submit a PR.

Chris00 commented 10 years ago

Since you merged my previous PR, I did one for this so it is easy to see the diff.

dinosaure commented 10 years ago

Close by #39.