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

Use Meetup Api to fetch upcoming meetups #4

Open
3 tasks
peterpme opened this issue Oct 6, 2018 · 17 comments
Open
3 tasks

Use Meetup Api to fetch upcoming meetups #4

peterpme opened this issue Oct 6, 2018 · 17 comments

Comments

@peterpme
Copy link
Member

peterpme commented Oct 6, 2018

  • fetch upcoming meetup info using meetupId stored in CMS
  • create upcoming react template
  • display upcoming on website

Meetup has an API we can use to fetch upcoming meetups and info.

Since we're storing the meetupId, all we have to do is parse & fetch this info

https://www.meetup.com/meetup_api/docs/

@wem5637
Copy link

wem5637 commented Oct 8, 2018

Is there a plan to create an express backend service to consume meetup information? This is a static project correct? We can create a separate repo for API

@peterpme
Copy link
Member Author

peterpme commented Oct 8, 2018

Hey @wem5637,

Good question!

I was hoping we could try Gatsby's 3rd party plugin support:
https://www.gatsbyjs.org/docs/third-party-graphql/

@basicdays
Copy link
Contributor

I'd imagine we could probably cron job that to check for anything new each day and generate new pages based on that? Even better if Meetup has an evented system that could ping us that something has changed.

@wem5637
Copy link

wem5637 commented Oct 13, 2018

You can assign this to me for now. I'll see if I can muster up something today and tomorrow.

@wem5637
Copy link

wem5637 commented Oct 14, 2018

I looked into @peterpme 's link above. There doesn't seem to be an easy way to connect to non graphql external apis like meetup.com. Curious to see if anyone else has had more success with this than I have.

Are we decided that this project will be serverless? A backend client would be a big help.

@peterpme
Copy link
Member Author

I think you're right @wem5637, if there's no easy way to do it we should just put up an express server for now 😃

@peterpme
Copy link
Member Author

@wem5637
Copy link

wem5637 commented Oct 16, 2018

Great, might already have something set up from the former project. I'll let you know when I get to this.

@wem5637
Copy link

wem5637 commented Oct 18, 2018

I started this. It's located here.
https://github.com/wem5637/chijs_meetup_api

The project makes hourly requests to meetup.com and serves that info over the following routes.

Get group info - /api/groups
Get event listings of groups - /api/events

Feel free to fork and make it your own @peterpme

@peterpme
Copy link
Member Author

Hey @wem5637

😍 thank you so much!!!

Would you be able to move the repo over to chicagojs under settings?

@wem5637
Copy link

wem5637 commented Oct 18, 2018

Ah, I don't have permission to move/create repos in chicago.js. So believe I'm unable to.

@Alek-S
Copy link
Contributor

Alek-S commented Dec 12, 2018

If we want to skip the backend for now since sounds like still a work-in-progress, a faster way to get this stood up may be to just do a simple fetch client-side on the endpoint using a stateful component inside of a componentDidMount lifecycle event. Redux would be usual way for these api calls, but thinking vanilla React component is simpler for now, easier for people to jump into as well.

Seems to work in curl without credentials since upcoming events are public for these groups. Example curl to get next upcoming react chicago event:

curl 'https://api.meetup.com/React-Chicago/events?page=1' | jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1823  100  1823    0     0   7401      0 --:--:-- --:--:-- --:--:--  7410
[
  {
    "created": 1538407398000,
    "duration": 7200000,
    "fee": {
      "accepts": "wepay",
      "amount": 3,
      "currency": "USD",
      "description": "",
      "label": "Price",
      "required": true
    },
    "id": "255167257",
    "name": "\"React Native Libraries for a Happy Life\" by Mitch Masia",
    "rsvp_limit": 125,
    "status": "upcoming",
    "time": 1548892800000,
    "local_date": "2019-01-30",
    "local_time": "18:00",
    "rsvp_open_offset": "PT672H",
    "rsvp_close_offset": "PT25H",
    "updated": 1544050950000,
    "utc_offset": -21600000,
    "waitlist_count": 0,
    "yes_rsvp_count": 1,
    "venue": {
      "id": 26009925,
      "name": "Cameo",
      "lat": 41.88926696777344,
      "lon": -87.65434265136719,
      "repinned": false,
      "address_1": "401 N Aberdeen St.",
      "city": "Chicago",
      "country": "us",
      "localized_country_name": "USA",
      "zip": "60642",
      "state": "il"
    },
    "group": {
      "created": 1416363838000,
      "name": "React Chicago",
      "id": 18199684,
      "join_mode": "open",
      "lat": 41.880001068115234,
      "lon": -87.63999938964844,
      "urlname": "React-Chicago",
      "who": "Members",
      "localized_location": "Chicago, IL",
      "state": "IL",
      "country": "us",
      "region": "en_US",
      "timezone": "US/Central"
    },
    "link": "https://www.meetup.com/React-Chicago/events/255167257/",
    "description": "<p>React Native is still the relatively new kid on the block. This talk addresses some common problems faced by newcomers to the platform, and the libraries experienced React Native devs use to navigate those problems.</p> <p>We'll discuss topics including Styling, Navigation, Animation, Push Notifications, Maps, Deployment, and more!</p> <p>This is a great opportunity for React Native newbies and intermediates to learn about what to expect from the platform and some industry-standard solutions.</p> <p>Mitch is an engineer and entrepreneur at Hexient Labs. He's a software junkie focused on React, React Native, and Node. He's launched 5 production React Native apps and is a frequent Meetup attendee and speaker.</p> ",
    "visibility": "public"
  }
]

@wem5637
Copy link

wem5637 commented Dec 12, 2018

It's all set up, we just need to merge it into the project. We can't make a client side request directly to the endpoint because of CORS restrictions.

@wem5637
Copy link

wem5637 commented Dec 12, 2018

Since I don't have permission to create repositories, someone with permission would need to fork this project to ChicagoJS.

In essence what this enables, we have an api server with which we can get meetup information. Meetup information is obtained via cron job then relayed to the front-end by any call that is made. We'd need to host this somehwere but it's totally something that a small heroku instance can do for now. I could do this myself but the instance would lack continuing support and ownership from chicagojs.

@peterpme
Copy link
Member Author

Thanks @wem5637!! Forked it over to github.com/chicagojs/chicagojs.org-api and will host this for us shortly 😄

@Alek-S
Copy link
Contributor

Alek-S commented Dec 12, 2018

Either way I'm good with. One note with regards to CORS restriction comment, that can be bypassed by using JSONP.

Example of client-side only react-chicago meetup request: https://alek-s.github.io/jsonp_test/

@wem5637
Copy link

wem5637 commented Dec 12, 2018

@Alek-S Ah great, I'm not familiar at all with jsonp. I've been wondering how people have found ways around CORS. I think there are definitely options available to whoever wants to own the meetup front end portion now.

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

No branches or pull requests

4 participants