diff options
| author | Franck Cuny <franck.cuny@gmail.com> | 2014-01-01 16:30:44 -0800 |
|---|---|---|
| committer | Franck Cuny <franck.cuny@gmail.com> | 2014-01-01 16:30:44 -0800 |
| commit | ab810bc59bd3d585627b388e33dc09a3ce69da12 (patch) | |
| tree | 9a3d7290dde4d2bae8850e839f8f5c5766c9a010 /set_main_lang.pl | |
| parent | wip (diff) | |
| download | github-explorer-ab810bc59bd3d585627b388e33dc09a3ce69da12.tar.gz | |
big import to not lose stuff
Diffstat (limited to 'set_main_lang.pl')
| -rw-r--r-- | set_main_lang.pl | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/set_main_lang.pl b/set_main_lang.pl new file mode 100644 index 0000000..5c3d153 --- /dev/null +++ b/set_main_lang.pl @@ -0,0 +1,25 @@ +#!/usr/bin/env perl +use strict; +use warnings; +use YAML::Syck; +use lib ('lib'); +use githubexplorer; + +my $conf = LoadFile(shift); + +my $gh = githubexplorer->new( + api_token => $ENV{'GITHUB_APIKEY'}, + api_login => $ENV{'GITHUB_LOGIN'}, + connect_info => $conf->{connect_info}, +); + +$gh->_connect unless $gh->has_schema; +#my $graph = githubexplorer::Gexf->new( schema => $gh->schema ); + +my $repositories = $gh->schema->resultset('Repositories')->search(); +while (my $repos = $repositories->next) { + my $language = $gh->schema->resultset('RepoLang') ->search( { repository => $repos->id }, { order_by => 'size' } )->first; + if ($language) { + $repos->update({main_language => $language->language->name}); + } +} |
