The folks at Github have a public repo where they share with the public the Takedown notices they receive, like Google does with Chilling Effects.
Usually, the notices want a public repository to be closed by Github. The guilty repo owner has just 24 hours to make the necessary or the repo is closed, which is very short: I saw very few repos updated that much.
So, why not make a backup of the repo during this gap?
In just full php? (NB: Oros has already created a script explained here, but it needs git and bash which could not be available on every webhosting plan)
Using Github API? https://developer.github.com/v3/repos/commits/
Here are some trails to begin with:
https://api.github.com/repos/github/dmca
https://api.github.com/repos/github/dmca/commits
https://api.github.com/repos/github/dmca/git/trees/bbddacc1cb3d1fdfa64aa72b64270c0df2af38f3
Looks like markdown blobs are base64 encoded, use php’s base64_decode function.