How to automatically gather or collect assignments?

(Konzy) #21

@hydrodog Using the github api I was able to grep the correct assignments based on the organization name, go through all possible pages of assignments, and clone all.

The only information needed is

  1. organization name,
  2. search term,
  3. your github username,

It clones to a folder up one level named the search term.
There is also a script for commiting and pushing all changes.

(Casiano Rodriguez-Leon) #22

Install the ghedsh gem (you need ruby in your computer):

gem install ghedsh

Once you have given an auth token to ghedsh with permits to access your repos start the shell and use the command cd to change to your class organization:

crguezl> cd ULL-ESIT-PL-1617

Find the repos in the organization of your interest. You can use the repos command with a regexp:

crguezl>ULL-ESIT-PL-1617> repos /analisis-de-ambito/i

Now issue the clone command:

crguezl>ULL-ESIT-PL-1617> clone /evaluar-analisis-de-ambito/
Cloning into 'evaluar-analisis-de-ambito-plaguera'...
remote: Counting objects: 239, done.
remote: Total 239 (delta 0), reused 0 (delta 0), pack-reused 239
Receiving objects: 100% (239/239), 28.22 KiB | 0 bytes/s, done.
Resolving deltas: 100% (134/134), done.
Checking connectivity... done.
Cloning into 'evaluar-analisis-de-ambito-alu0100887686'...
remote: Counting objects: 236, done.
remote: Total 236 (delta 0), reused 0 (delta 0), pack-reused 236
Receiving objects: 100% (236/236), 27.71 KiB | 0 bytes/s, done.
Resolving deltas: 100% (131/131), done.
Checking connectivity... done.

This will clone all the repos matching your regexp in your local machine.
Now you can go to the command line shell and work with them:

$ ls -d evaluar-analisis-de-ambito-*
evaluar-analisis-de-ambito-AiramNavas      evaluar-analisis-de-ambito-alu0100884982
evaluar-analisis-de-ambito-AntonioGarnier  evaluar-analisis-de-ambito-alu0100887686

ghedsh is still in beta state. Use it at your own risk.

(Casiano Rodriguez-Leon) #23

Use ghshell:

[~/ull-esit-1617/examenes(master)]$ ghshell

        _         _          _ _ 
   __ _| |__  ___| |__   ___| | |
  / _` | '_ \/ __| '_ \ / _ \ | |
 | (_| | | | \__ \ | | |  __/ | |
  \__, |_| |_|___/_| |_|\___|_|_|

Sucessfully authenticated!

ghshell > help
COMMAND       DESCRIPTION                                                  USAGE                  
back          return from a repository or organization to the main level   back                   
clone         clone current repository (if we're inside)                   clone                  
              clone repositories that match with string|regexp             clone string | /regexp/
exit          cause normal ghshell termination                             exit                   
help          display this message                                         help                   
login         sign in a Github's user                                      login                  
logout        sign out a Github's user                                     logout                 
orgs          select a Github user's organizations                         orgs                   
              list the Github user's organizations                         orgs -l                
pwd           show the ghshell's current working path                      pwd                    
repos         select a repository                                          repos                  
              list all the repositories                                    repos -l               
              list the repositories that match with string|regexp          repos string | /regexp/

(Avatar Lavventura) #24

Your script downloads the latest submissions for all the students. Is there any way to download the submission repository, which is right before the deadline? Thank you. @geoffryan