norfolkjs / norfolkjs.github.io

Website code for Norfolk.js
http://www.norfolkjs.org
11 stars 19 forks source link

Display upcoming events #101

Open pchinjr opened 1 year ago

pchinjr commented 1 year ago

As a user, who navigates to the home page, I should see a list of upcoming events. There exists an RSS feed at https://www.meetup.com/NorfolkJS/events/rss/. The current implementation is no longer maintained. The meetup API has changed significantly.

qwo commented 1 year ago

Hey 👋,

I wrote the original implementation and I took a look if I could fix this and the gap. I wanted to add some documentation and I dug into this and saw this was very shitty. I hope this saves someone some time.

Meetup did not deprecated their RSS feed but put a rule that it requires to have OAUTH Flow / needed a registered developer API identity to read it.

context. There are two files that are relevant.

1.https://github.com/norfolkjs/norfolkjs.github.io/blob/main/proxy/index.js

  1. https://github.com/norfolkjs/norfolkjs.github.io/blob/main/javascripts/events.js

1) The server proxy was to solve for CORS. since the frontend of Norfolkjs.org could not query meetup.com/norfolkjs/events/rss directly. this was just to get the XML

2) the file here uses vanilla JS to modify and update the frontend and deserialized and formatted the data. Theoretically, if the data and feed events are the same, you can just drop and play. Otherwise you might have to modify the payload to match to make this work again

I looked through the docs, and you dont have to upgrade to the GraphQL API; Meetup disallowed any public access via the internet without OAUTH JWT Bearer token to read their stupid RSS feed.

This leads you that you have to create a OAUTH API KEY request. I made a request and they denied it. Which is balls [1] https://www.meetup.com/api/oauth/list/

image
  1. I tried alternatively putting up a new proxy function to just scrape the rss feed directly and forget them but this is how I discovered they require OAUTH2 to read the public RSS feed.. (which seems like defeats the purpose of RSS, which is an open feed spec)

  2. I tried looking at scraping the HTML at https://www.meetup.com/norfolkjs/events or mocking the requests in the backend with a fake user agent and wrote some code to do so. It also failed and at that point it was just over engineering.

TLDR: I think if someone was to work on this;

I would recommend just manually encoding a JSON file and adding the event with the correct details instead of calling the proxy file [1]

[2] Make sure it matches the format for events.js and call it done.

The frequency of events doesn't seem wild that it could be managed by humans. Also the CI is setup automatically to do this, similar to how the blog works.

qwo commented 1 year ago

also PS. Meetup + Post WeWork sucks. Have y'all looked at moving to a different less extortionist event platform? 😂