You won't be able to run GitHub locally, as it's a closed-source commercial application*.
There are a number of open-source web-based Git interfaces, as you have already discovered. One that you didn't mention but that might be worth considering is GitLab, which has a more GitHub-like interface than Gitweb.
If you want to interface with GitHub's repository data, your best bet will be to use their API. Without knowing what language you're working in it's hard to give more information than that.
If you're working in Ruby, Objective-C, .NET or Go, you should also have a look at Octokit, a set of official libraries for interacting with GitHub.
*Actually, you can run the Enterprise version locally, but it's fairly expensive and I get the sense that you're looking for something open and / or free.