Skip to content

Instantly share code, notes, and snippets.

@aduth
Created April 15, 2019 14:50
Show Gist options
  • Save aduth/65edee20b936a21e086dcc6f60bbb3e8 to your computer and use it in GitHub Desktop.
Save aduth/65edee20b936a21e086dcc6f60bbb3e8 to your computer and use it in GitHub Desktop.
const { get } = require( 'https' );
const { parse } = require( 'url' );
const pulls = [
'https://github.com/WordPress/gutenberg/pull/14003',
'https://github.com/WordPress/gutenberg/pull/14469',
'https://github.com/WordPress/gutenberg/pull/14475',
'https://github.com/WordPress/gutenberg/pull/14681',
'https://github.com/WordPress/gutenberg/pull/14693',
'https://github.com/WordPress/gutenberg/pull/14711',
'https://github.com/WordPress/gutenberg/pull/14771',
'https://github.com/WordPress/gutenberg/pull/14772',
'https://github.com/WordPress/gutenberg/pull/14785',
'https://github.com/WordPress/gutenberg/pull/14804',
'https://github.com/WordPress/gutenberg/pull/14813',
'https://github.com/WordPress/gutenberg/pull/14822',
'https://github.com/WordPress/gutenberg/pull/14854',
'https://github.com/WordPress/gutenberg/pull/14876',
'https://github.com/WordPress/gutenberg/pull/14877',
'https://github.com/WordPress/gutenberg/pull/14894',
'https://github.com/WordPress/gutenberg/pull/14916',
'https://github.com/WordPress/gutenberg/pull/14925',
'https://github.com/WordPress/gutenberg/pull/14936',
'https://github.com/WordPress/gutenberg/pull/14938',
'https://github.com/WordPress/gutenberg/pull/14944',
'https://github.com/WordPress/gutenberg/pull/14955',
];
( async () => {
const commits = [];
await Promise.all( pulls.map( ( pull ) => new Promise( ( resolve ) => {
const url = pull
.replace( '//github.com/', '//api.github.com/repos/' )
.replace( '/pull/', '/pulls/' );
get( {
...parse( url ),
headers: {
'User-Agent': 'Gutenberg'
},
agent: false,
}, async ( response ) => {
let data = '';
for await ( const chunk of response ) {
data += chunk;
}
data = JSON.parse( data );
commits.push( [ pull, data.user.login, data.merged_at ] );
resolve();
} );
} ) ) );
commits
.sort( ( a, b ) => a[ 2 ].localeCompare( b[ 2 ] ) )
.forEach( ( [ url, user ] ) => console.log( `${ url } (@${ user })` ) );
} )();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment