Skip to content

Instantly share code, notes, and snippets.

@BinaryMuse
Forked from fafnirical/change-photo.md
Last active May 10, 2024 17:50
Show Gist options
  • Select an option

  • Save BinaryMuse/1ca54a71c780651b83bea457304cd423 to your computer and use it in GitHub Desktop.

Select an option

Save BinaryMuse/1ca54a71c780651b83bea457304cd423 to your computer and use it in GitHub Desktop.
Change your profile photo for all meetup groups

I haven't found a way to set your main profile photo on meetup.com such that it overrides any old photos you have set in individual groups. This script will do just that — set your group specific profile photo to your main photo for every group you're in.

Here's what to do:

  1. Go to your main profile page: http://www.meetup.com/profile/
  2. Ensure you've set your main profile photo to the photo you want to use in all your groups.
  3. Open your browser's developer tools (often F12 on Windows, cmd+opt+i on macOS), copy the following code, paste it in the Console tab, and press enter:
(async function() {
  var imageSrc = document.querySelector('#member-profile-photo img').getAttribute('src')
  var match = /member_(\d+)\./.exec(imageSrc)
  if (!match) {
    console.error(`Couldn't find your photo ID! Are you on https://www.meetup.com/profile ?`)
    return
  }
  var imageId = match[1]

  var groups = new Set()
  Array.from(document.querySelectorAll('[data-chapterid]'))
    .map(el => el.getAttribute('data-chapterid'))
    .forEach(groups.add.bind(groups))

  for (var groupId of [...groups]) {
    console.log(`Changing profile photo for ${groupId}`)
    try {
      await $.post('https://www.meetup.com/api/', {
        method: 'makeGroupProfilePhoto',
        arg_member: '56746842',
        arg_chapter: groupId,
        arg_memberPhotoId: imageId,
      })
    } catch (err) {
      console.error(`Failed to change profile photo for ${groupId}`)
    }
  }

  console.log(`Done!`)
})()
@jrhalasz

Copy link
Copy Markdown

This is super helpful, thank you!
It looks like arg_member: '56746842' is your member number. When I replaced it with my member number it seems to have worked for my user.
Could you retrieve that as a variable from the profile page?

@Dan-Cao

Dan-Cao commented Feb 25, 2023

Copy link
Copy Markdown

Seems like the data-chapterid attribute is no longer present in the modern main profile page.

However, if you open the to the old style profile page it will still work. You can get to this from any group by going to More > Message Boards > My Profile

@CDeLeon94

Copy link
Copy Markdown

Seems like the data-chapterid attribute is no longer present in the modern main profile page.

However, if you open the to the old style profile page it will still work. You can get to this from any group by going to More > Message Boards > My Profile

Just make sure the photo on the group profile page you navigate to is set to what you want the rest to change to.

@brucewilcoxii

Copy link
Copy Markdown

I was able to update more than 200 meetup groups in just a few seconds.
Thank you

@scottodono

scottodono commented Jun 6, 2023

Copy link
Copy Markdown

@jrhalasz or anyone else How to get meetup member id? ( I think I found out by going to group profile page)
@CDeLeon94 or anyone else - where do you access "more > Message Boards > My Profile ? I do not see "More" in the menu
@BinaryMuse

VM1235:2 Uncaught (in promise) TypeError: Cannot read properties of null (reading 'getAttribute')
    at <anonymous>:2:69
    at <anonymous>:30:3

@CDeLeon94

Copy link
Copy Markdown

Member id can by found by click your profile picture in the top right corner and going to view profile. In the address bar, the number after members/ is your member id

for the more you need to navigate to any one of your groups, just under the header you'll see about events ... more

@scottodono

Copy link
Copy Markdown

Member id can by found by click your profile picture in the top right corner and going to view profile. In the address bar, the number after members/ is your member id

for the more you need to navigate to any one of your groups, just under the header you'll see about events ... more

Thank you CDeLeon94! It was the profile page specifically for the group but it worked!

@victorface2

Copy link
Copy Markdown

^ Can confirm working as of July 6th 2023 also (following instructions from CDeLeon94)

@bruderda

bruderda commented May 10, 2024

Copy link
Copy Markdown

I didn't try this script, but I noticed that I couldn't even find a way to manually change my profile picture for a specific group anymore. But when I deleted my old profile photo, my new one started showing on all groups. Delete via View profile > Change profile photo > Choose from library > Manage photos.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment