Home Labs Nb 2 Html Tests 211 Web Scraper Scooter Exploration Meetup Wordclouds Apis Looking At Data Satellltes Naomi Nlp Nomi

Don't Look! I'm changing!

URL Copied

Meetup API

BinderBinderBinderOpen Source Love svg3

NPM LicenseActiveGitHub last commit

GitHub starsGitHub watchersGitHub forksGitHub followers

Content found herein may be directly quoted from the above links documentation

✖️ Quick Notes

Our Checklist

Before you can use OAuth 2 for user authorization, you need to either register a new OAuth undefined (giving you a undefined) or add (another) undefined to an existing consumer.

We need from each undefined we will need it's:

  • ✔️ Public facing undefined that can be used with the redirect url to get you to the meetups login/ sign up/ authorize api page.

  • ✔️ Hidden undefined (also refered to as a undefined).

  • ✔️ registered undefined for a given client will be used to validate future oauth2 requests.

There are 3 ways to 'flow' through the Meetup OAuth process.

  • Server Flow - The path we'd prefer to take. 2 steps. The documentation uses the phrase undefined for this section

  • Server Flow with User Credentials - requires a username, password for a pro user account holder. Not our prefered route

  • Implicit Flow - This flow is suitable for JavaScript based browser clients.

Critical_Question: What does it mean if I login and am not the pro account holder of api key?

Critical Answer: The second flow requires a Pro members account user/pass to be passed in the request. The former only requires that the 'user' making the request be registered with meetup and authorize the api access using the api key. Regardless, You will need to be a Pro member to access the pro API features.

Critical Proof: We tried this using the console (logged in using our own meetup accounts) and were denied access but Jason was able to get it working. Perhaps we are doing it wrong? Or more likely, the console doesn't work for us non pro-users full stop, I didn't see a place to put the api key or redirect uri so I don't think the console permits 'does' that part.

👉 Server Flow

1. 👉 Requesting Authorization

That sounds like us!

To begin. The directions say:

Redirect using the following url in a browser:


undefined

And

Once you visit that link:

  • "Meetup will ask the user to login if they are not already logged in."

  • "If the user has previously authorized access for the provided client_id, Meetup will immediately redirect the user back to the redirect_uri with success query parameters."

__Response Parameters__

  • code - A string that can only be used once to request an access token

  • state - An opaque string that you may provide in the initial request

Here is an example URL:

Clicking on that link will take you to an authorization page.

image.png

image.png

In the past, we had been getting: "invalid_request" errors. Meaning: "The request was malformed or missing parameters".

Naturally, the query failed when trying here for us because we didn't know the redirect_uri.

There exists more info in original documentation about all this.

2. 👉 Requesting Access Token

Now the docs say:

With all this being done...

Make a post request with the following format using the key given to you in the previous response.

As apposed to a get request, this will not be something you can do by entering a url into an address bar.

undefined

Perform POST request for an access token using this:

Lets try it

SUCCESS!!

Lets look at the content

Did it look like whats below? A successfull submisson should look like this:

undefined

We got back JSON encoded in a string. Lets get that undefined because it's what we need amongst the other credentials to perform our query.

Otherwise, you'll get an error message. More information in the docs.

Once completed, API Queries can be made using the access_token and the KEY from before.

Skip down to the 'Querying Data' section if you made it down here.

Here are a bunch of queries we could make.

3. ✖️ Making Queries Examples

API Query 1 - SELF
undefined

Docs, Template: undefined

API Query 2 - GROUPS

Docs, Docs.P2, Template: undefined

"created": 1530147506000, "members": 2307,

"next_event": { "id": "278394107", "yes_rsvp_count": 26,

"name": "Online: Introducing Datawave - Scalable Data Ingest and Query",

API Query 3a - GROUP Members

Docs, Docs.P2, Template: undefined

Docs, Template: undefined

Docs, Template: undefined

API Query 3b - GROUP Events

Docs, Template: undefined

API Query 4 - PRO

Docs.P2 -> # events attended join_time last_access_time

4. ✖️ Saving our Members List

Docs, Template: undefined

API Query 5 - MEMBER INFORMATION Through Their ID

undefined

API Query 6 - Which Cities Are The Members From?

Save Those Queries!

We can use append undefined to the end of our Terminal commands to save the output.

5. ✖️ Convert the Response's JSON Data to a Tabular excel-like Form.

Colabs has this special feature I will use that lets me store the output of a terminal command (deonted by the undefined) into a python variable.

In the following instance, I use the undefined terminal command to read the contents of each file and store them into variables as a textual 'string'.

From there, much like before, we can open the files with python to view their contents.

It's possible to perform data science with JSON.

But for now lets convert it to tabularized form: a CSV

the dataWorksCSV only has one record since we only requested data on one 'group' -> DataWorks

Colabs pre-formats the output for us.

You'll see that the undefined function flattened the hierarchical nesting of the json object.

Here are the new column names for this flattened JSON Object.

6. ✖️ Format the Columns (date-time) and do Preliminary Data Exploration. Then Save It.

Lets take a peek at some information?

[link text](https:// [link text](https:// link text))Alright.. So we have 2311[link text](https:// link text) members and the group was created mid 2018?

What can we determine about our members?

A lot of these columns don't have much information. The status column has only 1 unique value 'active', for instance.

created - The time this member joined the Group, represented as milliseconds since the epoch

updated - The last time this member edited their Group profile, represented as milliseconds since the epoch

visited - The last time this member visited the Group, represented as milliseconds since the epoch

7. 👉 Reuploading the Cleaned-Up Members List from step 6.

we have previously created a dataset 'meetup_api_member_data.csv' by running through step 3-6.

We wont have to do those parts again. Just re-upload the file now.

8. 👉 Use Member ID's from the Members-List to get every Members Full Info.

First we download data for every single record.

Then we flatten it

This is a test to see if it works

This will do the flattening for all records

9. 👉 Look into Membership data

❌ Server Flow with User Credentials

This aint us

❌ Implicit Flow

Yeah, this'll work too. But the documentation is all of 100 words or something.

And a really awkwardly worded 100 words at that:

undefined

Which really just means:

undefined

I'm sure that this will all make sense when we get to it..?

The rest of the documentation in this section just state that when a user visits your website and a request for data is sent via the useres browser, the user will be redirected to meetup and be asked to register or login and check a authorization check box or two.

Awesome. Lets get to work..?

Javascript Fetch Request

Or not.

I mean. We really tried everything. This one could still work, though!

You may need to allow cors to run it. Heres a chrome extension for that.

Btw. The code here is just a copy of the html file I used to test it (Spoiler: Invalid credentials).

undefined

❌ Python Package: Meetup-API

There are few to no resources other than the official documentation on the web to help inform us.

But this python library existed and I figured maybe it'd be the easy way out!

Here's the code I was using to test it. You can run it if you like...?

(Spoiler: This library is depricated as of 2 years ago).

(Spoiler P2: I tried manually patching the library to no avail )