Last Updated: January 24, 2019
·
2.793K
· mattheath

Publicize your Coderwall Badges

If you enable Coderwall Orgs in your Coderwall settings, Coderwall will add you to a Github organisation for each badge you receive which shows up on your profile. Seriously, it's like I'm back in the scouts...

Unfortunately you're not a public member of the organisation by default, so your delightful merit badges don't show on your profile straight away! Also if you ever disable and re-enable the coderwall orgs, you'll be reset to concealed membership again on each one.

But all is not lost! If you're too lazy to click all those buttons (like me), you can fix this by installing the githubapi gem (`gem install githubapi`) then running the following code with a user and OAuth token:

https://gist.github.com/mattheath/5368857


require "github_api"

user = ''
token = ''

github = Github.new oauth_token: token

coderwall_orgs = []
github.orgs.list.each do |org|
  coderwall_orgs << org.login if org.login =~ /^coderwall/
end

coderwall_orgs.each do |org|
  if !github.orgs.members.member? org, user, :public => true
    puts "Publicizing membership of #{org}"
    github.orgs.members.publicize org, user
  else
    puts "Already public member of #{org}"
  end
end

Then bask in your glorious merit badges, like this guy:

Picture

2 Responses
Add your response

gem install github_api

over 1 year ago ·

Never

over 1 year ago ·