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

scrape.js: Search org for user #75

Merged
merged 1 commit into from
Dec 12, 2017
Merged

Conversation

andrewda
Copy link
Member

This searches the user's organization for their display name. If
the user is found, their username will be used.

Closes #8

lib/scrape.js Outdated
@@ -4,6 +4,7 @@ const fs = require('fs')
const json2yaml = require('json2yaml')

const GH_USER_BASE = 'https://github.com/users'
const GH_ORG_BASE = 'https://github.com/orgs' // Ignore InvalidLinkBear
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think just add github.com to the ignore list in .coafile

lib/scrape.js Outdated
@@ -155,14 +167,17 @@ async function findOrganization({
async function findGitHubUser({ display_name }, org) {
if (!org) return

display_name = display_name.replace(/ /g, '')
const shortName = display_name.replace(/ /g, '')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spaces are not valid in github usernames, so this is a very basic "convert to valid username". There was a npm package which checked legality of a name. What we want is a smarter "convert name into most similar valid github probable username". maybe a npm package already exists; if not, ... create one ;-)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh man, alright, I'm running out of package naming ideas ;)

@andrewda andrewda force-pushed the even-more-users branch 3 times, most recently from f2c3068 to 4ecec91 Compare December 12, 2017 05:01
This searches the user's organization for their display name. If
the user is found, their username will be linked.

Closes coala#8
@@ -14,6 +14,7 @@ bears = LineLengthBear

[all.links]
bears = InvalidLinkBear
link_ignore_regex = (github\.com|\{|\$)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's link_ignore_list that uses globbing instead
link_ignore_list = https://github.com/**

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^ Optional.

@jayvdb
Copy link
Member

jayvdb commented Dec 12, 2017

ack f2934af

1 similar comment
@blazeu
Copy link
Member

blazeu commented Dec 12, 2017

ack f2934af

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

Successfully merging this pull request may close these issues.

4 participants