I dunno if I'm misunderstanding your question but can't you just `wget http://github.com/activescaffold/active_scaffold/raw/master/lib/active_scaffold/locale/en.rb` ? Simply change blob to raw in a url to get its content.
On Oct 16, 12:17 am, Jxtps <[email protected]> wrote: > What is the recommended method for fetching the source contents of a > file given a URL like: > > http://github.com/activescaffold/active_scaffold/blob/master/lib/acti... > > ? > > From what I can read in the API, I have to: > > 1. Fetch the list of commits for that user/repo/branch/path to get the > tree_sha > 2. Iteratively call tree/show to get the blob_sha (since the tree_sha > returned is likely to be for the root - is this guaranteed? - and the > file I want may be in a subdirectory) > 3. Call blob/show/blob_sha > > I'd like to avoid the iterative calls, and ideally also avoid fetching > the (potentially long) list of commits. > > - Would it be possible to add > e.g.http://github.com/activescaffold/active_scaffold/blob/master/lib/acti...json|yml|whatever > (which would do sensible things for directories as well) > > OR > > - Would it be possible to add a "fetch/:user/:repo/:branch/:path" API > call, that would return the latest version of the file, or the listing > in the case of a directory? > > As it stands right now I'll have to "git clone" the whole thing just > to get a couple of files out - not ideal from a bandwidth > perspective... --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "GitHub" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/github?hl=en -~----------~----~----~----~------~----~------~--~---
