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

Standard format for planet_feeds.txt #1528

Open
patricoferris opened this issue Apr 15, 2021 · 9 comments
Open

Standard format for planet_feeds.txt #1528

patricoferris opened this issue Apr 15, 2021 · 9 comments
Labels
medium More Complex Issues for Outreachy

Comments

@patricoferris
Copy link
Contributor

Currently when generating https://ocaml.org/community/planet/ the planet_feeds.txt is read in order to get the name and the RSS feed URL, the format of that file seems a little arbitrary (or perhaps was made before all of the nice JSON/Yaml/S-expression tools we now have were created!).

For ease of sharing this information, extending the information (e.g. adding descriptions), porting it elsewhere and maintainability I think we should convert planet_feeds.txt to JSON.

As far as I can tell, we already transitively depend on ezjsonm because we depend on COW so this would be a good library to use for the parsing (we will still add it to the .opam file but it won't change the amount of things we pull in which is a nice bonus).

@patricoferris patricoferris added the medium More Complex Issues for Outreachy label Apr 15, 2021
@mahakbansal2019
Copy link

@patricoferris I would like to work on this :)

@mercybassey
Copy link

mercybassey commented Apr 18, 2021

This is an opportunity to get familiar with ocaml indept. @patricoferris If it's not assigned to anyone I'd like to give it a try

@patricoferris
Copy link
Contributor Author

@mahakbansal2019 is currently assigned, are you still working on this @mahakbansal2019?

@mahakbansal2019
Copy link

No @patricoferris!
@mercybassey you can go ahead :)

@mercybassey
Copy link

Okay thanks

@gs0510
Copy link

gs0510 commented Apr 23, 2021

@mercybassey Are you still working on it? Do you need any help? :)

@mercybassey
Copy link

@gs0510 I tried requiring the package as shown in the ezjsonm readme but it didn't work , so I'm still not sure how to get it to work

@mercybassey
Copy link

Hello @patricoferris @gs0510. Since I am not yet familiar with the ezjsonm package I tried a different approach in converting the text file to JSON. All i did was to setup a node project, and used a library called text-to-json for the parsing. I installed the package via npm and required it. I'd like to know your take on this and also like to know if using the ezjsonm package follow the same approach. If not i will like to have a guide.

Screenshot from 2021-04-26 04-21-29

Screenshot from 2021-04-26 04-29-17

@patricoferris
Copy link
Contributor Author

patricoferris commented Apr 26, 2021

Hi @mercybassey,

Nice work so far, unfortunately I don't think we're going to add all of Node as another dependency. However, this is actually a really useful stepping stone that you can use.

I think the goals have been a little mixed up. This issue seeks to (a) convert the text document to JSON like you did with the Node project and save it to a file (plant_feeds.json) and then (b) convert the logic in the OCaml scripts which used to read the bespoke text format to read JSON. Does that make sense? So Ezjsonm would be used to read the file that is already JSON.

A small example:

utop -require ezjsonm

Then (ignore the escaping of double-quotes):

utop # let json = "[ { \"url\": \"https://ocaml.org\" } ]";;
val json : string = "[ { \"url\": \"https://ocaml.org\" } ]"
utop # let ez = Ezjsonm.value_from_string json;;
Ezjsonm.value = `A [`O [("url", `String "https://ocaml.org")]]

@patricoferris patricoferris mentioned this issue Apr 28, 2021
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
medium More Complex Issues for Outreachy
Projects
None yet
Development

No branches or pull requests

4 participants