Skip to content
Browse files

Initial commit

Still needs a bit of work but any help appreciated
  • Loading branch information...
0 parents commit 669e839442d78421d8a654238beafed771e3e55e @mattclegg committed Aug 2, 2011
Showing with 4,379 additions and 0 deletions.
  1. +4 −0 _config.php
  2. +106 −0 code/GITMember.php
  3. +49 −0 code/GITProject.php
  4. +55 −0 code/GITRestService.php
  5. +14 −0 code/SSVotes.php
  6. +2 −0 thirdparty/doc-github/.gitignore
  7. +1 −0 thirdparty/doc-github/CNAME
  8. +43 −0 thirdparty/doc-github/README.markdown
  9. +10 −0 thirdparty/doc-github/Rakefile
  10. +6 −0 thirdparty/doc-github/_config.yml
  11. +95 −0 thirdparty/doc-github/_layouts/default.html
  12. +109 −0 thirdparty/doc-github/_posts/2010-04-22-general.markdown
  13. +132 −0 thirdparty/doc-github/_posts/2010-04-23-commits.markdown
  14. +100 −0 thirdparty/doc-github/_posts/2010-04-23-gist.markdown
  15. +260 −0 thirdparty/doc-github/_posts/2010-04-23-issues.markdown
  16. +125 −0 thirdparty/doc-github/_posts/2010-04-23-libraries.markdown
  17. +120 −0 thirdparty/doc-github/_posts/2010-04-23-network.markdown
  18. +83 −0 thirdparty/doc-github/_posts/2010-04-23-oauth.markdown
  19. +225 −0 thirdparty/doc-github/_posts/2010-04-23-object.markdown
  20. +366 −0 thirdparty/doc-github/_posts/2010-04-23-orgs.markdown
  21. +191 −0 thirdparty/doc-github/_posts/2010-04-23-pulls.markdown
  22. +465 −0 thirdparty/doc-github/_posts/2010-04-23-repo.markdown
  23. +195 −0 thirdparty/doc-github/_posts/2010-04-23-users.markdown
  24. +26 −0 thirdparty/doc-github/css/ie.css
  25. +30 −0 thirdparty/doc-github/css/print.css
  26. +233 −0 thirdparty/doc-github/css/screen.css
  27. BIN thirdparty/doc-github/css/src/grid.png
  28. +163 −0 thirdparty/doc-github/css/thickbox.css
  29. BIN thirdparty/doc-github/images/background-v2.png
  30. BIN thirdparty/doc-github/images/background-white.png
  31. BIN thirdparty/doc-github/images/develop-github.png
  32. BIN thirdparty/doc-github/images/develop-github.psd
  33. BIN thirdparty/doc-github/images/git-lang.png
  34. BIN thirdparty/doc-github/images/loadingAnimation.gif
  35. BIN thirdparty/doc-github/images/logo.png
  36. BIN thirdparty/doc-github/images/macFFBgHack.png
  37. BIN thirdparty/doc-github/images/nav-rule.png
  38. BIN thirdparty/doc-github/images/rackspace_logo.png
  39. BIN thirdparty/doc-github/images/snapshots.png
  40. BIN thirdparty/doc-github/images/staging.png
  41. +12 −0 thirdparty/doc-github/index.html
  42. +10 −0 thirdparty/doc-github/js/thickbox-compressed.js
  43. +862 −0 thirdparty/doc-github/shared/css/documentation.css
  44. +60 −0 thirdparty/doc-github/shared/css/pygments.css
  45. BIN thirdparty/doc-github/shared/images/active-arrow.png
  46. BIN thirdparty/doc-github/shared/images/background-v2.png
  47. BIN thirdparty/doc-github/shared/images/background-white.png
  48. BIN thirdparty/doc-github/shared/images/crud-sprite.png
  49. BIN thirdparty/doc-github/shared/images/dropdown_sprites.jpg
  50. BIN thirdparty/doc-github/shared/images/expand-arrows.png
  51. BIN thirdparty/doc-github/shared/images/footer_logo.png
  52. BIN thirdparty/doc-github/shared/images/nav-rule.png
  53. BIN thirdparty/doc-github/shared/images/next_step_arrow.gif
  54. BIN thirdparty/doc-github/shared/images/qmark.png
  55. BIN thirdparty/doc-github/shared/images/rackspace_logo.png
  56. +73 −0 thirdparty/doc-github/shared/js/documentation.js
  57. +154 −0 thirdparty/doc-github/shared/js/jquery.js
4 _config.php
@@ -0,0 +1,4 @@
+<?php
+
+//Add Member Extenion
+DataObject::add_extension('Member', 'GITMember');
106 code/GITMember.php
@@ -0,0 +1,106 @@
+<?php
+class GITMember extends DataObjectDecorator {
+
+ public function extraStatics() {
+ return array(
+ 'db' => array(
+ 'Email' => 'Varchar(255)', // alter Email to be able to save strings up to 255 chars,
+ // according to proxied email addresses this is mandatory
+ "git_id" =>"Int",
+ "git_user" =>"Varchar(255)",
+ "gravatar_id" =>"Varchar(255)",
+ "company" =>"Varchar(255)",
+ "name" =>"Varchar(255)",
+ "location" =>"Varchar(255)",
+ "public_repo_count" =>"Int",
+ "public_gist_count" =>"Int",
+ "blog" =>"Varchar(2083)",
+ "following_count" =>"Int",
+ "followers_count" =>"Int",
+ ),
+ 'has_many' => array(
+ 'GITs' =>'GITProject',
+ 'Votes' =>'ProjectVotes'
+ )
+ );
+ }
+
+ function updateCMSFields(&$fields) {
+ $fields=new FieldSet();
+ $fields->insertBefore(new HeaderField('why_disabled','Git information must be updated on github.com'),'git_id');
+ $fields->makeFieldReadonly('git_id');
+ $fields->makeFieldReadonly('gravatar_id');
+ $fields->makeFieldReadonly('company');
+ $fields->makeFieldReadonly('name');
+ $fields->makeFieldReadonly('location');
+ $fields->makeFieldReadonly('name');
+ $fields->makeFieldReadonly('public_repo_count');
+ $fields->makeFieldReadonly('public_gist_count');
+ $fields->makeFieldReadonly('blog');
+ $fields->makeFieldReadonly('following_count');
+ $fields->makeFieldReadonly('followers_count');
+ }
+
+ function onBeforeWrite(){
+ parent::onBeforeWrite();
+
+ $x=new GITRestService();
+
+ $info=$x->get_user_info($this->owner->Email);
+
+ if($repos=$x->get_user_repos($this->owner->git_user)){
+
+ $git_urls=array();
+
+ if($gits=$this->owner->GITs()){
+
+ foreach ($gits as $git){
+ $git_urls[]=$git->url;
+ }
+
+ }
+
+ foreach ($repos as $repo){
+
+ if(!in_array($repo->url, $git_urls)){
+
+ $NewGit=new GITProject();
+ }else{
+
+ //Update fork/commit count ?
+
+ }
+
+ }
+ }
+ }
+
+
+ function getFrontEndFields(){
+ return new FieldSet(
+ new TabSet("Root",
+ new Tab('Repositories',new FieldSet(
+ //Maybe someone who's good at extending ComplexTableField could write something to go here?
+
+ new DataObjectManager($this,'GITs','GITProject',array(
+ 'isVisible' =>'is Visible?',
+ 'ProjectType' =>'Module/Theme',
+ 'Title' =>'Title',
+ 'description' =>'Description',
+ 'url' =>'Source',
+ 'watchers' =>'Number of Watchers',
+ 'forks' =>'Number of Forks',
+ 'TotalVotes' =>'Rating'
+ ))
+ )),
+ new Tab('Comments',new FieldSet(new LiteralField('text','Comments received about your repos & comments you have made about repos'))),
+ new Tab('Profile',$mainFields=$this->owner->getCMSFields()->findOrMakeTab('Root.Main')->Childnen())
+ )
+ );
+ }
+
+ function isNice(){
+ return $this->owner->Votes("VoteType='UpVote'")->Count()>$this->owner->Votes("VoteType='DownVote'")->Count();
+ }
+
+}
49 code/GITProject.php
@@ -0,0 +1,49 @@
+<?php
+
+class GITProject extends DataObject {
+
+ static $db = array(
+ "ProjectType" =>"Enum('Non-silverstripe,Module,Theme','Non-silverstripe')",
+ 'isVisible' =>'Boolean',
+
+
+ "url" =>"Varchar(2083)",
+ "has_issues" =>'Boolean',
+ "homepage" =>"Varchar(2083)",
+ "watchers" =>"Int",
+ "source" =>"Varchar(2083)",//Not sure how long this could be
+ "parent" =>"Varchar(2083)",//Not sure how long this could be
+ "has_downloads" =>'Boolean',
+ //"created_at" =>'Created'
+ "forks" =>"Int",
+ "fork" =>'Boolean',
+ "has_wiki" =>'Boolean',
+ "private" =>'Boolean',
+ //"pushed_at" =>'LastEdited'
+ //"name" =>'Title',
+ "description" =>'Text',
+ "owner" =>'Varchar(255)',//Maybe userful for managing forks
+ "open_issues" =>"Int"
+ );
+
+ static $has_one = array(
+ 'UserSource' =>'Member'
+ );
+
+ static $has_many = array(
+ 'Votes' =>'ProjectVotes'
+ );
+
+ static $defauls = array(
+ 'isVisible' =>true,
+ );
+
+ function getContent(){
+ return $this->description;
+ }
+
+ function TotalVotes(){
+ return $this->Votes("VoteType='UpVote'")->Count()-$this->Votes("VoteType='DownVote'")->Count();
+ }
+
+}
55 code/GITRestService.php
@@ -0,0 +1,55 @@
+<?php
+
+class GITRestService extends RestfulService {
+
+ protected $baseURL='http://github.com/api/v2/json';
+ // Yes, its using v2 (for now)
+
+
+ protected $authUsername=false;
+ protected $jsonUsername, $jsonPassword;
+
+ function __construct($base=null,$expiry=3600){
+ if(!$base)$base=$this->baseURL;
+ parent::__construct($base,$expiry);
+ }
+
+ function set_username_password($user,$password){
+ self::$jsonUsername=$user;
+ self::$jsonPassword=md5($password);
+ }
+
+ public function request($subURL = '', $method = "POST", $data = null, $headers = null, $curlOptions = array()) {
+
+ $parameters = array(
+ 'user_auth' => array(
+ 'user_name' => $this->jsonUsername,
+ 'password' => $this->jsonPassword,
+ ),
+ );
+ $json = json_encode($parameters);
+ $data = array(
+ 'method' => 'login',
+ 'input_type' => 'JSON',
+ 'response_type' => 'JSON',
+ 'rest_data' => $json,
+ );
+
+
+ parent::request($subURL = '', "POST", $data, $headers = null, $curlOptions = array());
+
+ }
+
+ function get_user_info($user_email){
+
+ return $this->request("user/email/{$user_email}");
+
+ }
+
+ function get_user_repos($user_git_user){
+
+ return $this->request("repos/show/{$user_git_user}");
+ }
+
+
+}
14 code/SSVotes.php
@@ -0,0 +1,14 @@
+<?php
+
+class ProjectVotes extends DataObject {
+
+ static $db = array(
+ 'VoteType'=>"Enum('UpVote,DownVote','UpVote')"
+ );
+
+ static $has_one = array(
+ 'Project' =>'GITProject',
+ 'UserSource' =>'Member'
+ );
+
+}
2 thirdparty/doc-github/.gitignore
@@ -0,0 +1,2 @@
+_site
+.DS_Store
1 thirdparty/doc-github/CNAME
@@ -0,0 +1 @@
+develop.github.com
43 thirdparty/doc-github/README.markdown
@@ -0,0 +1,43 @@
+Develop.GitHub.com
+==================
+
+This is the code and data behind <http://develop.github.com>.
+
+All content can be found in the `_posts/` directory.
+
+
+Dependencies, Getting Started
+-----------------------------
+
+Install [Jekyll][jk] an rake (both require Ruby):
+
+ gem install jekyll rake
+
+Once you've done that, run `rake` to compile the site:
+
+ rake
+
+This should start a web server at <http://localhost:3000> which is now
+serving your site, updating whenever you make changes.
+
+Contributing
+------------
+
+To contribute to the develop.github site, you can fork the repository,
+push your changes into it and create an Issue:
+<http://github.com/github/develop.github.com/issues>
+
+If you want to run the site on GitHub pages for testing you can push your
+changes into the 'gh-pages' branch, rather than the 'master' branch of
+the remote repository.
+
+ $ git push origin master:gh-pages
+
+That command will push your master branch to the 'gh-pages' branch of
+your fork. Then Pages will serve the site for you under:
+
+<http://schacon.github.com/develop.github.com>
+
+(Replace 'schacon' with your username)
+
+[jk]: https://github.com/mojombo/jekyll
10 thirdparty/doc-github/Rakefile
@@ -0,0 +1,10 @@
+desc "Generate the html files for the site"
+task :gensite do
+ if system("type jekyll > /dev/null 2>&1")
+ exec "jekyll --auto"
+ else
+ abort "Please `gem install jekyll`"
+ end
+end
+
+task :default => :gensite
6 thirdparty/doc-github/_config.yml
@@ -0,0 +1,6 @@
+markdown: rdiscount
+pygments: true
+server: true
+server_port: 3000
+auto: true
+permalink: /p/:title.html
95 thirdparty/doc-github/_layouts/default.html
@@ -0,0 +1,95 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+ <title>Develop.GitHub - {{ page.title }}</title>
+ <script src="/shared/js/jquery.js" type="text/javascript"></script>
+ <script src="/shared/js/documentation.js" type="text/javascript"></script>
+ <script type="text/javascript" src="../js/thickbox-compressed.js"></script>
+
+ <link href="/shared/css/documentation.css" media="screen" rel="stylesheet" type="text/css">
+ <link href="/shared/css/pygments.css" media="screen" rel="stylesheet" type="text/css">
+ <link rel="stylesheet" href="../css/print.css" type="text/css" media="print">
+ <!--[if IE]>
+ <link rel="stylesheet" href="../css/ie.css" type="text/css" media="screen, projection">
+ <![endif]-->
+
+ <link rel="stylesheet" href="../css/thickbox.css" type="text/css" media="screen"/>
+</head>
+
+<body>
+
+ <div id="not-footer">
+ <div id="header-wrapper">
+ <div id="header">
+ <div>
+ <a class="logo" href="/"><img src="/images/logo.png" width="230" height="45" /></a>
+ <ul class="nav">
+ <li><a href="http://developer.github.com/v3/">API v3</a></li>
+ <li><a href="http://develop.github.com">API v2</a></li>
+ <li><a
+ href="http://support.github.com/discussions/api">Support</a></li>
+ </ul>
+ </div>
+ </div><!-- #header -->
+ </div><!-- #header-wrapper -->
+
+ <div id="wrapper">
+ <div class="content">
+ {{ content }}
+ </div>
+
+ <div class="sidebar-shell">
+ <div class="sidebar-module">
+ <ul>
+ {% for post in site.posts reversed %}
+ <li>
+ {% if page.title == post.title %}
+ <h3 class="disable"><span>{{ page.title }}</span></h3>
+ {% else %}
+ <h3><a href="{{ post.url }}">{{ post.title }}</a></h3>
+ {% endif %}
+ <span class="spacer"></span>
+ </li>
+ {% endfor %}
+ </div> <!-- /sidebar-module -->
+ <div class="sidebar-module">
+ <p>This website is <a href="http://github.com/github/develop.github.com" target="_blank">open source</a>. Please help us by forking the project and adding to it.</p>
+ </div>
+ </div><!-- /sidebar-shell -->
+
+ </div><!-- #wrapper -->
+ </div><!-- /not-footer -->
+
+ <div id="footer-wrapper">
+ <div id="footer">
+ <div class="left-col">
+ <h2 class="logo"><a href="http://github.com">Brought to you by GitHub</a></h2>
+ <ul class="github-nav">
+ <li><a href="http://github.com/blog" class="blog">The GitHub Blog</a></li>
+ <li><a href="http://support.github.com">Support</a></li>
+ <li><a href="http://github.com/contact">Contact</a></li>
+ <li><a href="http://developer.github.com">API</a></li>
+ </ul>
+ <p class="copyline">© 2011 GitHub Inc. All rights reserved</p>
+ </div>
+ <div class="right-col">
+ <p class="rackspace">Powered by the <a href="http://rackspace.com" target="_blank">Dedicated Servers</a> and <a href="http://rackspacecloud.com" target="_blank">Cloud Computing</a> of Rackspace Hosting®</p>
+ </div>
+ </div><!-- #footer -->
+ </div><!-- #footer-wrapper -->
+
+ <script type="text/javascript">
+ var _gaq = _gaq || [];
+ _gaq.push(['_setAccount', 'UA-3769691-2']);
+ _gaq.push(['_trackPageview']);
+ (function() {
+ var ga = document.createElement('script');
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+ ga.setAttribute('async', 'true');
+ document.documentElement.firstChild.appendChild(ga);
+ })();
+ </script>
+</body>
+</html>
109 thirdparty/doc-github/_posts/2010-04-22-general.markdown
@@ -0,0 +1,109 @@
+---
+layout: default
+title: General API Information
+---
+
+# General API Information #
+
+## Schema ##
+
+All API access is over HTTP and starts with
+
+ http://github.com/api/v2/:format
+
+where `:format` is one of 'json', 'xml' or 'yaml', specifying what the
+response data should be formatted in. For all of the rest of this
+documentation, we will be leaving off that part, since it is the same
+for every API call.
+
+**Note:** XML and YAML support is currently deprecated. Existing API calls
+will continue to support it, but new API features will only support JSON.
+
+## Authentication ##
+
+[OAuth](/p/oauth.html) is the preferred authentication method because tokens can be
+limited to specific types of data, and can be revoked by users at any
+time.
+
+You can use HTTP Basic Auth to authenticate as a GitHub user. If you want to pass your API token instead, add "/token" to the Basic Auth username. Note that all requests that need authentication should include the Authentication header. Unauthenticated requests will return 404 to prevent any sort of private information leakage.
+
+You may also pass `login` and `token` to any URL. Note that this method
+of authentication is deprecated.
+
+Several of the calls will return extra data if you are authenticated
+as a user that owns the repository or has access to it as a
+collaborator. For example, a call to get information on one of your
+private repositories would be:
+
+<pre class="terminal">
+$ curl -u "schacon:PASSWORD" \
+ http://github.com/api/v2/json/user/show/schacon | jsonpretty
+{
+ "user": {
+ "company": "GitHub",
+ "name": "Scott Chacon",
+ "following_count": 11,
+ "blog": "http:\/\/scottchacon.com",
+ "public_repo_count": 52,
+ "public_gist_count": 45,
+ "disk_usage": 294392,
+ "collaborators": 3,
+ "plan": {
+ "name": "small",
+ "collaborators": 5,
+ "space": 1228800,
+ "private_repos": 10
+ },
+ "id": 70,
+ "owned_private_repo_count": 10,
+ "total_private_repo_count": 14,
+ "private_gist_count": 11,
+ "login": "schacon",
+ "followers_count": 182,
+ "created_at": "2008\/01\/27 09:19:28 -0800",
+ "email": "schacon@gmail.com",
+ "location": "Redwood City, CA"
+ }
+}
+</pre>
+
+Here's a Basic Auth example using the API Token:
+
+<pre class="terminal">
+$ curl -u "schacon/token:6ef8395fecf207165f1a82178ae1b984" \
+ http://github.com/api/v2/json/user/show/schacon | jsonpretty
+{
+ "user": {...
+</pre>
+
+## Secure Access ##
+
+You can access any API call over HTTPS, though public data can also be
+accessed over HTTP.
+
+## JSON callbacks ##
+
+If you send a 'callback' variable to any call, it will wrap the result
+JSON in that function, so you can automatically execute it.
+
+<pre class="terminal">
+$ curl http://github.com/api/v2/json/issues/list/schacon/simplegit/open?callback=myJsFunction
+myJsFunction({"issues": [
+{"user": "schacon",
+"updated_at": "2009/04/17 16:19:02 -0700",
+"body": "something",
+"title": "new",
+"number": 2,
+"votes": 0,
+"position": 1.0,
+"created_at": "2009/04/17 16:18:50 -0700",
+"state": "open"}
+]});
+</pre>
+
+## Limitations ##
+
+Currently we are limiting API calls to 60 per minute. This may change
+in the future, or possibly per user at some point, but if you try to
+access the API more than 60 times in a minute, it will start giving
+you "access denied" errors.
132 thirdparty/doc-github/_posts/2010-04-23-commits.markdown
@@ -0,0 +1,132 @@
+---
+layout: default
+title: Commits API
+---
+
+# Commits API #
+
+## Listing Commits on a Branch ##
+
+ commits/list/:user_id/:repository/:branch
+
+An example of getting a listing of commits for a branch, we will get the latest commits on the 'master' branch of the Grit project.
+
+<pre class="terminal">
+$ curl http://github.com/api/v2/json/commits/list/mojombo/grit/master
+{
+ "commits": [
+ {
+ "parents": [
+ {
+ "id": "e3be659a93ce0de359dd3e5c3b3b42ab53029065"
+ }
+ ],
+ "author": {
+ "name": "Ryan Tomayko",
+ "login": "rtomayko",
+ "email": "rtomayko@gmail.com"
+ },
+ "url": "/mojombo/grit/commit/6b7dff52aad33df4bfc0c0eaa88922fe1d1cd43b",
+ "id": "6b7dff52aad33df4bfc0c0eaa88922fe1d1cd43b",
+ "committed_date": "2010-12-09T13:50:17-08:00",
+ "authored_date": "2010-12-09T13:50:17-08:00",
+ "message": "update History.txt with bug fix merges",
+ "tree": "a6a09ebb4ca4b1461a0ce9ee1a5b2aefe0045d5f",
+ "committer": {
+ "name": "Ryan Tomayko",
+ "login": "rtomayko",
+ "email": "rtomayko@gmail.com"
+ }
+ }
+ ]
+}
+</pre>
+
+Usually commits are a lot. That's why the API call doesn't return them all at once, but rather page by page. If you are after the whole list and not just the latest commits, you should add a ?page=N at the end of the API call incrementing the page number until you get no results. For example:
+
+ $ curl http://github.com/api/v2/json/commits/list/mojombo/grit/master?page=1
+ $ curl http://github.com/api/v2/json/commits/list/mojombo/grit/master?page=2
+ ...
+ $ curl http://github.com/api/v2/json/commits/list/mojombo/grit/master?page=N
+
+## Listing Commits for a File ##
+
+ commits/list/:user_id/:repository/:branch/*path
+
+An example of using this to get all the commits that modified the gemspec file for the Grit project would be:
+
+<pre class="terminal">
+$ curl http://github.com/api/v2/json/commits/list/mojombo/grit/master/grit.gemspec
+{
+"commits": [
+ {
+ "parents": [
+ {
+ "id": "9f2d86b941c4aeccc1125fe2864e3aba126fd997"
+ }
+ ],
+ "author": {
+ "name": "Tom Preston-Werner",
+ "login": "mojombo",
+ "email": "tom@mojombo.com"
+ },
+ "url": "/mojombo/grit/commit/b8a3d3b374630ba94cd1efab13a2eceadf8d2bf4",
+ "id": "b8a3d3b374630ba94cd1efab13a2eceadf8d2bf4",
+ "committed_date": "2010-09-29T13:46:45-07:00",
+ "authored_date": "2010-09-29T13:46:45-07:00",
+ "message": "Release 2.3.0",
+ "tree": "bd73ef982d782d06f5ae19b5276eaa535e18c1a3",
+ "committer": {
+ "name": "Tom Preston-Werner",
+ "login": "mojombo",
+ "email": "tom@mojombo.com"
+ }
+ }
+]
+}
+</pre>
+
+## Showing a Specific Commit ##
+
+ commits/show/:user_id/:repository/:sha
+
+An example of using this to get a the changes introduced on a specific commit in the Grit project would be
+
+<pre class="terminal">
+$ curl http://github.com/api/v2/json/commits/show/mojombo/grit/5071bf9fbfb81778c456d62e111440fdc776f76c | jsonpretty
+{
+ "commit": {
+ "message": "Version bump to 1.1.1",
+ "added": [
+
+ ],
+ "removed": [
+
+ ],
+ "parents": [
+ {
+ "id": "05372bffe2b60b0d1802f338551856221e0a89d2"
+ }
+ ],
+ "modified": [
+ {
+ "diff": "@@ -1,4 +1,4 @@\n --- \n :major: 1\n :minor: 1\n-:patch: 0\n+:patch: 1",
+ "filename": "VERSION.yml"
+ }
+ ],
+ "author": {
+ "name": "Tom Preston-Werner",
+ "email": "tom@mojombo.com"
+ },
+ "url": "http:\/\/github.com\/mojombo\/grit\/commit\/5071bf9fbfb81778c456d62e111440fdc776f76c",
+ "id": "5071bf9fbfb81778c456d62e111440fdc776f76c",
+ "committed_date": "2009-03-31T09:54:40-07:00",
+ "authored_date": "2009-03-31T09:54:40-07:00",
+ "tree": "e5b860cb18c5c334e480993ca4549d13e0f8b1a8",
+ "committer": {
+ "name": "Tom Preston-Werner",
+ "email": "tom@mojombo.com"
+ }
+ }
+}
+</pre>
100 thirdparty/doc-github/_posts/2010-04-23-gist.markdown
@@ -0,0 +1,100 @@
+---
+layout: default
+title: Gist API
+---
+
+# Gist API #
+
+API for the [Gist](http://gist.github.com) code paste
+service. Gist's API is a bit different from GitHub proper's - the
+domain is always **gist.github.com** and we're still on **v1**.
+
+## Get a Gist's Metadata ##
+
+ GET http://gist.github.com/api/v1/:format/:gist_id
+
+Example:
+
+<pre class="terminal">
+$ curl http://gist.github.com/api/v1/json/823475
+{
+ "gists": [
+ {
+ "comments": [
+ {
+ "body": "Great stuff.",
+ "created_at": "2011/03/31 00:19:46 -0700",
+ "gravatar_id": "b8dbb1987e8e5318584865f880036796",
+ "id": 25573,
+ "updated_at": "2011/03/31 00:19:46 -0700",
+ "user": "defunkt"
+ }
+ ],
+ "created_at": "2011/02/11 19:39:21 -0800",
+ "description": "I can't be bothered with all of these fancy…",
+ "files": [
+ "deploy.rake"
+ ],
+ "owner": "peterc",
+ "public": true,
+ "repo": "823475"
+ }
+ ]
+}
+</pre>
+
+## Get a Gist's Content ##
+
+ GET http://gist.github.com/raw/:gist_id/:filename
+
+Example:
+
+<pre class="terminal">
+$ curl http://gist.github.com/raw/374130/ports.sh
+# List what ports are in use on OS X
+sudo lsof -iTCP -sTCP:LISTEN -P
+</pre>
+
+## Another User's Public Gists ##
+
+ GET http://gist.github.com/api/v1/:format/gists/:login
+
+Example:
+
+<pre class="terminal">
+$ curl http://gist.github.com/api/v1/json/gists/defunkt
+{
+ "gists": [
+ {
+ "created_at": "2010/11/19 03:39:35 -0800",
+ "public": true,
+ "repo": "706406",
+ "files": [
+ "after-spec-merge",
+ "before-spec-merge"
+ ],
+ "owner": "defunkt",
+ "description": ""
+ }
+ ]
+}
+</pre>
+## My Public & Private Gists ##
+
+Coming soon
+
+## Create a New Gist ##
+
+Coming soon.
+
+## Fork a Gist ##
+
+Coming soon.
+
+## Delete a Gist ##
+
+Coming soon.
+
+## Edit a Gist ##
+
+Coming soon.
260 thirdparty/doc-github/_posts/2010-04-23-issues.markdown
@@ -0,0 +1,260 @@
+---
+layout: default
+title: Issues API
+---
+
+# Issues API #
+
+The API for GitHub Issues.
+
+## Search Issues ##
+
+ /issues/search/:user/:repo/:state/:search_term
+
+Where 'state' is either 'open' or 'closed'.
+
+For example, to search for 'test' in the open issues for defunkt/github-issues repo, you can do this:
+
+<pre class="terminal">
+$ curl http://github.com/api/v2/json/issues/search/defunkt/github-issues/open/test
+{
+ "issues": [
+ {
+ "user": "kfl",
+ "gravatar_id": "ad670e0aee0491aaa0a2d201486064b2",
+ "updated_at": "2009\/04\/20 03:34:48 -0700",
+ "votes": 3,
+ "number": 102,
+ "position": 1.0,
+ "title": "Pressing question-mark does not show help",
+ "body": "Pressing the '?'-key does not open the help lightbox.\r\n\r\nHowever, at least the 'j', 'k', and 'c' works (the only ones I've tested).\r\n\r\n* **OS:** Linux, ubuntu 8.04.1\r\n* **Browser:** Firefox 3.08",
+ "state": "open",
+ "created_at": "2009\/04\/17 12:57:52 -0700"
+ }
+ ]
+}
+</pre>
+
+## List a Project's Issues ##
+
+To see a list of issues for a project,
+
+ issues/list/:user/:repo/:state
+
+where :state is either 'open' or 'closed'. You can also search with a label:
+
+ issues/list/:user/:repo/label/:label
+
+For example, to see all the open issues I have on the schacon/simplegit project, we can run
+
+<pre class="terminal">
+$ curl http://github.com/api/v2/json/issues/list/schacon/showoff/open
+{
+ "issues": [
+ {
+ "gravatar_id": "b8dbb1987e8e5318584865f880036796",
+ "position": 1.0,
+ "number": 8,
+ "votes": 3,
+ "created_at": "2010/01/22 17:56:29 -0800",
+ "comments": 10,
+ "body": "Maybe this? \r\n\r\n<http://www.htmldoc.org>",
+ "title": "PDF",
+ "updated_at": "2010/12/10 21:48:53 -0800",
+ "closed_at": null,
+ "user": "defunkt",
+ "labels": [
+ "feature"
+ ],
+ "state": "open"
+ }
+ ]
+}
+</pre>
+
+Here's a sample query of all issues labeled "2.0" in defunkt/resque:
+
+<pre class="terminal">
+$ curl http://github.com/api/v2/json/issues/list/defunkt/resque/label/2.0
+{
+ "issues": [
+ {
+ "gravatar_id": "b8dbb1987e8e5318584865f880036796",
+ "position": 4.0,
+ "number": 5,
+ "votes": 1,
+ "created_at": "2009/11/03 11:58:19 -0800",
+ "comments": 2,
+ "body": "You know you want it.",
+ "title": "ERB => Mustache",
+ "updated_at": "2010/05/13 13:57:53 -0700",
+ "closed_at": null,
+ "user": "defunkt",
+ "labels": [
+ "2.0",
+ "feature"
+ ],
+ "state": "open"
+ }
+ ]
+}
+</pre>
+
+## View an Issue ##
+
+To get data on an individual issue by number, run
+
+ issues/show/:user/:repo/:number
+
+So to get all the data for a issue #1 in our repo, we can run something like this:
+
+<pre class="terminal">
+$ curl http://github.com/api/v2/json/issues/show/schacon/showoff/1
+{
+ "issue": {
+ "gravatar_id": "b8dbb1987e8e5318584865f880036796",
+ "position": 1.0,
+ "number": 1,
+ "votes": 0,
+ "created_at": "2010/01/21 13:45:59 -0800",
+ "comments": 0,
+ "body": "http://github.com/defunkt/showoff/commit/jquery14",
+ "title": "Upgrade to jQuery 1.4",
+ "updated_at": "2010/01/21 14:41:55 -0800",
+ "closed_at": "2010/01/21 14:41:55 -0800",
+ "user": "defunkt",
+ "labels": [
+
+ ],
+ "state": "closed"
+ }
+}
+</pre>
+
+## List an Issue's Comments ##
+
+To get a list of comments made on an issue, run
+
+ issues/comments/:user/:repo/:number
+
+So to get all the comments for a issue #1 in our repo, we can run something like this:
+
+<pre class="terminal">
+$ curl http://github.com/api/v2/json/issues/comments/schacon/showoff/3
+{
+ "comments": [
+ {
+ "gravatar_id": "8194993afda83d34c94928134b729276",
+ "created_at": "2010/05/05 15:15:53 -0700",
+ "body": "Showing off the issues app.",
+ "updated_at": "2010/05/05 15:15:53 -0700",
+ "id": 230935,
+ "user": "280north"
+ }
+ ]
+}
+</pre>
+
+## Open and Close Issues ##
+
+To open a new issue on a project, make a authorized POST to
+
+ issues/open/:user/:repo
+
+Where you can provide POST variables:
+
+ title
+ body
+
+It will return the data for the newly created ticket if it is successful. You need to provide your username and token so the system knows who you are and can assign you as the opener of the issue.
+
+For example, I could open a new issue on my simplegit project like this:
+
+<pre class="terminal">
+$ curl -F 'login=schacon' -F 'token=XXX' -F 'title=new' -F 'body=my ticket' \
+ http://github.com/api/v2/json/issues/open/schacon/showoff
+</pre>
+To close or reopen an issue, you just need to supply the issue number
+
+ issues/close/:user/:repo/:number
+
+ issues/reopen/:user/:repo/:number
+
+You need to be logged in via token as well. Here is how I would close the ticket I opened earlier:
+
+<pre class="terminal">
+$ curl -F 'login=schacon' -F 'token=XXX' \
+ http://github.com/api/v2/json/issues/close/schacon/showoff/1
+</pre>
+
+## Edit Existing Issues ##
+
+For the final three calls (edit, label add and label delete) you have to be authorized a collaborator on the project.
+
+To edit an existing issue, you can POST to
+
+ issues/edit/:user/:repo/:number
+
+Where you can provide POST variables:
+
+ title
+ body
+
+This will overwrite the title or body of the issue, if you are authorized member of the project.
+
+## Listing Labels ##
+
+You can list available labels for a projects issues with
+
+ issues/labels/:user/:repo
+
+For example,
+
+<pre class="terminal">
+$ curl https://github.com/api/v2/json/issues/labels/schacon/showoff
+{
+ "labels": [
+ "bug",
+ "feature"
+ ]
+}
+</pre>
+
+## Add and Remove Labels ##
+
+To add a label, run
+
+ issues/label/add/:user/:repo/:label/:number
+
+This will return a list of the labels currently on that issue, your new one included. If the label is not yet in the system, it will be created.
+
+Here is how I would add the label 'testing' to my first ticket in my simplegit project:
+
+<pre class="terminal">
+$ curl -F 'login=schacon' -F 'token=XXX' https://github.com/api/v2/json/issues/label/add/schacon/simplegit/testing/1
+</pre>
+To remove a label, run:
+
+ issues/label/remove/:user/:repo/:label/:number
+
+Again, it will return a list of the labels currently on the issue.
+
+You can also add and remove labels generally by leaving off the Issue number.
+That will add a label to the system but not attach it to an issue, or remove
+a label from all issues.
+
+## Comment on Issues ##
+
+You can comment on issues at
+
+ /issues/comment/:user/:repo/:id
+
+Simply send it a 'comment' POST variable with the comment you'd like to make. It will attribute the comment to the user that is authenticated. Here is an example:
+
+<pre class="terminal">
+$ curl -F 'login=schacon' -F 'token=XXX' -F 'comment=this is amazing' \
+https://github.com/api/v2/json/issues/comment/defunkt/dunder-mifflin/1
+{"comment": {"gravatar_id": "9375a9529679f1b42b567a640d775e7d",
+"user": "schacon", "body": "this is amazing", id: 17,
+created_at: TIMESTAMP, updated_at: TIMESTAMP}
+</pre>
125 thirdparty/doc-github/_posts/2010-04-23-libraries.markdown
@@ -0,0 +1,125 @@
+---
+layout: default
+title: API Libraries
+---
+
+# API Libraries #
+
+Libraries for accessing the GitHub API from your favorite language.
+
+## C Sharp ##
+
+[GitHubSharp][gs] looks pretty slick - hot off the press.
+
+[gs]: http://github.com/erikzaadi/GithubSharp
+
+## Java ##
+
+[ghapi][ghj] is a Java library implementing much of v2 API and is
+constantly being developed.
+
+[ghj]: http://github.com/eddieringle/ghapi
+
+[github-java-sdk][ghjsdk] is a type-safe Java implementation of the whole v2 API and has
+some additional support for OAuth authentication and reading ATOM feeds. Its actively under development.
+
+[ghjsdk]: http://github.com/nabeelmukhtar/github-java-sdk
+
+## Javascript ##
+
+[github-api][ghjs] is a Javascript library with no dependencies for interop
+with the github API. Currently supports a large portion of V2, with more to
+come. Tries to map directly to the HTTP API, but in a JS style.
+
+[ghjs]: http://github.com/fitzgen/github-api
+
+The [node-github][ng] library is a port of [php-github-api][pga] to JavaScript for [node.js][node]. It provides an asynchronous object oriented API and is fully tested.
+
+[ng]: http://github.com/ajaxorg/node-github
+[node]: http://nodejs.org/
+
+## Perl ##
+
+The [Net::GitHub][net-perl-github] library for Perl encapsulates much
+of the functionality of the GitHub v2 API. You can also download it
+from [CPAN][net-perl-cpan].
+
+[net-perl-cpan]: http://search.cpan.org/dist/Net-GitHub/
+[net-perl-github]: http://github.com/fayland/perl-net-github/tree/master
+
+
+## PHP5 ##
+
+The [php-github-api][pga] is fully tested and documented.
+
+[pga]: http://github.com/ornicar/php-github-api
+
+## Python ##
+
+[Dustin Sallings'][dustin] [py-github][py-github] project was the
+first third-party implementation of the v1 API and is tracking the v2
+API in a branch as new API endpoints are published. [Fork
+it][py-github] it and help keep it awesome.
+
+There is alo a new Python library for the GitHub v2 API called
+[python-github2][python-github2]. It has nearly the full API feature
+list.
+
+[Kenneth Reitz's][kennethreitz] [GistAPI.py][gistapi] is a Python wrapper for the Gist API. New Gist API features will be introduced as the API endpoints are published.
+
+[dustin]: http://github.com/dustin
+[kennethreitz]: http://github.com/kennethreitz
+[py-github]: http://github.com/dustin/py-github
+[python-github2]: http://github.com/ask/python-github2
+[gistapi]: http://github.com/kennethreitz/gistapi.py
+
+## Ruby ##
+
+## API Version 1 ##
+
+The [github-control][github-control] library is currently doing work
+using the v1 API. The aim is to build a library which others can build
+on top of.
+
+It currently has features which need to be enabled on the v2 API as
+they were in pre-release when developed.
+
+The [github-party][gh-party] library is also using the v1 API.
+
+[github-control]: http://github.com/halorgium/github-control
+[gh-party]: http://github.com/technicalpickles/github-party
+
+## API Version 2 ##
+
+There are several active GitHub API v2 wrappers for Ruby: [octokit][ok],
+[octopi][octopi], and [hubruby][hubruby].
+
+However, if you want to save GitHub's bandwith and cache things locally, there is (under development) [github-api-client].
+
+[octopi]: http://github.com/fcoury/octopi/
+[ok]: http://github.com/pengwynn/octokit
+[hubruby]: http://github.com/diogenes/hubruby
+[github-api-client]: http://github.com/okonski/github-api-client
+
+## Web scraping ##
+
+[halorgium][halorgium] built a wrapper around the current post-receive hooks UI.
+It is called [github-post-receive-hooks][github-post-receive-hooks]
+Based on a gist by [tekkub][tekkub].
+
+[halorgium]: http://github.com/halorgium
+[tekkub]: http://github.com/tekkub
+[github-post-receive-hooks]: http://github.com/halorgium/github-post-receive-hooks
+
+
+## Cocoa/Objective-C ##
+
+[Clint Shryock's fork of CocoaREST][CocoaREST] extended the base CocoaREST library, a set of Cocoa classes to interact with RESTful services, to support Github's v1 API.
+
+[GitHubObjC][GitHubObjC] is an Objective-C library implementing most of the GET requests of v2 API.
+
+[UAGithubEngine][UAGithubEngine] is a Cocoa wrapper around version 2 of the Github API, written in Objective-C. It includes all functionality except the Network Graph and Gist APIs.
+
+[CocoaREST]: http://github.com/ctshryock/CocoaREST
+[GitHubObjC]: http://github.com/ernstsson/GitHubObjC
+[UAGithubEngine]: http://github.com/owainhunt/UAGithubEngine
120 thirdparty/doc-github/_posts/2010-04-23-network.markdown
@@ -0,0 +1,120 @@
+---
+layout: default
+title: Network API
+---
+
+# Secret Network API #
+
+This API is sort of an outlier. It is only available in JSON and does not follow the rest of the routing rules. It is the API used by our Network Graph and provides a lot of useful information that may be useful.
+
+## Network Meta ##
+
+<pre class="terminal">
+$ curl http://github.com/schacon/simplegit/network_meta | jsonpretty
+{
+ "focus": 78,
+ "nethash": "fa8fe264b926cdebaab36420b6501bd74402a6ff",
+ "dates": [
+ "2008-03-15",
+ "2008-03-15",
+ "2008-03-17",
+ "2008-03-17",
+ ...
+ "2009-02-15",
+ "2009-02-15",
+ "2009-03-19"
+ ],
+ "users": [
+ {
+ "name": "schacon",
+ "repo": "simplegit",
+ "heads": [ { "name": "master",
+ "id": "96476742093b8a53947564b16a691349dad846e5" } ]
+ },
+ {
+ "name": "tamtam",
+ "repo": "tam_repo",
+ "heads": [ { "name": "master",
+ "id": "8bf4aeae935422e7bdbb30660b4f3642728a1397" } ]
+ }
+ ],
+ "blocks": [
+ { "name": "schacon", "start": 0, "count": 3 },
+ { "name": "tamtam", "start": 3, "count": 1 },
+ ]
+}
+</pre>
+
+**Note:** all dates and times are in Pacific Time (GMT - 8:00).
+
+## Network Data ##
+
+To get network data, you'll need to provide the 'nethash' parameter that you get from the network\_meta call so the data is always consistent. To get network data, call the network\_data\_chunk URI with the given nethash to get the first 100 commits by branch.
+
+<pre class="terminal">
+$ curl http://github.com/schacon/simplegit/network_data_chunk?nethash=fa8fe264b926cdebaab36420b6501bd74402a6ff
+{"commits"=>
+ [{"message"=>"first commit",
+ "time"=>0,
+ "parents"=>[],
+ "date"=>"2008-03-15 10:31:28",
+ "author"=>"Scott Chacon",
+ "id"=>"a11bef06a3f659402fe7563abf99ad00de2209e6",
+ "space"=>1,
+ "gravatar"=>"9375a9529679f1b42b567a640d775e7d",
+ "login"=>"schacon"},
+ {"message"=>"my second commit, which is better than the first",
+ "time"=>1,
+ "parents"=>[["a11bef06a3f659402fe7563abf99ad00de2209e6", 0, 1]],
+ "date"=>"2008-03-15 16:40:33",
+ "author"=>"Scott Chacon",
+ "id"=>"0576fac355dd17e39fd2671b010e36299f713b4d",
+ "space"=>1,
+ "gravatar"=>"9375a9529679f1b42b567a640d775e7d",
+ "login"=>"schacon"},
+ .. (bunch more) ..
+</pre>
+You can also give it a start and end range, based on the position of the dates in the network\_meta output. This is how the network graph operates, requesting the chunks that you want to view at a time rather than all the data. If you need more than the last 100, you'll need to request ranges of more data.
+
+<pre class="terminal">
+$ curl 'http://github.com/schacon/simplegit/network_data_chunk?
+ nethash=fa8fe264b926cdebaab36420b6501bd74402a6ff&start=1&end=2'
+{
+ "commits": [
+ {
+ "message": "my second commit, which is better than the first",
+ "time": 1,
+ "parents": [
+ [
+ "a11bef06a3f659402fe7563abf99ad00de2209e6",
+ 0,
+ 1
+ ]
+ ],
+ "date": "2008-03-15 16:40:33",
+ "author": "Scott Chacon",
+ "id": "0576fac355dd17e39fd2671b010e36299f713b4d",
+ "space": 1,
+ "gravatar": "9375a9529679f1b42b567a640d775e7d",
+ "login": "schacon"
+ },
+ {
+ "message": "changed the verison number",
+ "time": 2,
+ "parents": [
+ [
+ "0576fac355dd17e39fd2671b010e36299f713b4d",
+ 1,
+ 1
+ ]
+ ],
+ "date": "2008-03-17 21:52:11",
+ "author": "Scott Chacon",
+ "id": "0c8a9ec46029a4e92a428cb98c9693f09f69a3ff",
+ "space": 1,
+ "gravatar": "9375a9529679f1b42b567a640d775e7d",
+ "login": "schacon"
+ }
+ ]
+}
+</pre>
83 thirdparty/doc-github/_posts/2010-04-23-oauth.markdown
@@ -0,0 +1,83 @@
+---
+layout: default
+title: OAuth
+---
+
+# OAuth
+
+OAuth2 is a protocol that lets external apps request authorization to private details in a user's GitHub account without getting their password. This is preferred over Basic Authentication because tokens can be limited to specific types of data, and can be revoked by users at any time.
+
+All developers need to [register their application](http://github.com/account/applications/new) before getting started. A registered OAuth application is assigned a unique Client ID and Client Secret. The Client Secret should not be shared.
+
+## Web Application Flow
+
+This is a description of the OAuth flow from 3rd party web sites.
+
+1. Redirect users to a this link to request GitHub access.
+
+ GET https://github.com/login/oauth/authorize?
+ client_id=...&
+ redirect_uri=http://www.example.com/oauth_redirect
+
+2. If the user accepts your request, GitHub redirects back to your site with a temporary code in a code parameter. Exchange this for an access token:
+
+ POST https://github.com/login/oauth/access_token?
+ client_id=...&
+ redirect_uri=http://www.example.com/oauth_redirect&
+ client_secret=...&
+ code=...
+
+ RESPONSE:
+ access_token=...
+
+3. You have the access token, so now you can make requests on the user's behalf:
+
+ GET https://github.com/api/v2/json/user/show?
+ access_token=...
+
+## Javascript/Desktop Flow
+
+These flows are disabled for now...
+
+# Redirect URLs
+
+The `redirect_uri` parameter is optional. If left out, GitHub will
+redirect users to the callback URL configured in the OAuth
+Application settings. If provided, the redirect URL must match the
+callback URL's host.
+
+ CALLBACK: http://foo.com
+ GOOD: https://foo.com
+ GOOD: http://foo.com/bar
+ BAD: http://foo:com:8080
+ BAD: http://bar.com
+
+## Scopes
+
+Scopes let you specify exactly what type of access you need. This will
+be displayed to the user on the authorize form.
+
+* (no scope) - public read-only access (includes user profile info, public repo info, and gists).
+* `user` - DB read/write access to profile info only.
+* `public_repo` - DB read/write access, and Git read access to public repos.
+* `repo` - DB read/write access, and Git read access to public and private repos.
+* `gist` - write access to gists.
+
+Your application can request the scopes in the initial redirection. You
+can specify multiple scopes by separating them by a comma.
+
+ https://github.com/login/oauth/authorize?
+ client_id=...&
+ scope=user,public_repo
+
+## References
+
+* [OAuth 2 spec](http://tools.ietf.org/html/draft-ietf-oauth-v2-07)
+* [Facebook API](http://developers.facebook.com/docs/authentication/)
+* [Ruby OAuth2 lib](https://github.com/intridea/oauth2)
+* [simple ruby/sinatra example](https://gist.github.com/9fd1a6199da0465ec87c)
+* [simple python example](https://gist.github.com/e3fbd47fbb7ee3c626bb) using [python-oauth2](http://github.com/dgouldin/python-oauth2)
+* [Ruby OmniAuth example](http://github.com/intridea/omniauth)
+* [Ruby Sinatra extension](http://github.com/atmos/sinatra_auth_github)
+* [Ruby Warden strategy](http://github.com/atmos/warden-github)
+* [Node.js demo using Nozzle](http://github.com/fictorial/nozzle/blob/master/demo/08-github-oauth2.js)
225 thirdparty/doc-github/_posts/2010-04-23-object.markdown
@@ -0,0 +1,225 @@
+---
+layout: default
+title: Object API
+---
+
+# Git Object API #
+
+## Trees ##
+
+Can get the contents of a tree by tree SHA
+
+ tree/show/:user/:repo/:tree_sha
+
+To get a listing of the root tree for the facebox project from our commit listing, we can call this:
+
+<pre class="terminal">
+$ curl http://github.com/api/v2/json/tree/show/defunkt/facebox/a47803c9ba26213ff194f042ab686a7749b17476
+{
+ "tree": [
+ {
+ "name": ".gitignore",
+ "size": 10,
+ "sha": "e43b0f988953ae3a84b00331d0ccf5f7d51cb3cf",
+ "mode": "100644",
+ "mime_type": "text/plain",
+ "type": "blob"
+ },
+ {
+ "name": "screenshots",
+ "size": 0,
+ "sha": "bbf747873075ac28667d246491ffdefbd314fe4f",
+ "mode": "040000",
+ "mime_type": "text/plain",
+ "type": "tree"
+ }
+ ]
+}
+</pre>
+
+(Output truncated for display purposes).
+
+## Blobs ##
+
+Can get the data about a blob by tree SHA and path
+
+ blob/show/:user/:repo/:tree_sha/:path
+
+For example, to get the README.txt metadata from a specific tree in Facebox:
+
+<pre class="terminal">
+$ curl http://github.com/api/v2/json/blob/show/defunkt/facebox/365b84e0fd92c47ecdada91da47f2d67500b8e31/README.txt
+{
+ "blob": {
+ "name": "README.txt",
+ "data": "Please visit http://famspam.com/facebox/ or open index.html in your favorite browser.\n\nNeed help? Join our Google Groups mailing list:\n http://groups.google.com/group/facebox/\n",
+ "size": 178,
+ "sha": "d4fc2d5e810d9b4bc1ce67702603080e3086a4ed",
+ "mode": "100644",
+ "mime_type": "text/plain"
+ }
+}
+</pre>
+
+If you want just the meta data and not the blob data, pass a `?meta` parameter:
+
+<pre class="terminal">
+$ curl http://github.com/api/v2/json/blob/show/defunkt/facebox/365b84e0fd92c47ecdada91da47f2d67500b8e31/README.txt?meta=1
+{
+ "blob": {
+ "name": "README.txt",
+ "size": 178,
+ "sha": "d4fc2d5e810d9b4bc1ce67702603080e3086a4ed",
+ "mode": "100644",
+ "mime_type": "text/plain"
+ }
+}
+</pre>
+
+You can also make a HEAD request and get this information from the headers:
+
+<pre class="terminal">
+$ curl http://github.com/api/v2/json/blob/show/defunkt/facebox/365b84e0fd92c47ecdada91da47f2d67500b8e31/README.txt -I
+HTTP/1.1 200 OK
+Status: 200 OK
+X-GitHub-Blob-Type: text/plain
+X-GitHub-Blob-Size: 178
+X-GitHub-Blob-Sha: d4fc2d5e810d9b4bc1ce67702603080e3086a4ed
+X-GitHub-Blob-Mode: 100644
+</pre>
+
+You can also get a list of all blobs (their names and shas) for a
+specific SHA:
+
+ blob/all/:user/:repo/:tree_sha
+
+For example, to get all blobs for Facebox:
+
+<pre class="terminal">
+$ curl http://github.com/api/v2/json/blob/all/defunkt/facebox/master
+{
+ "blobs": {
+ "src/loading.gif": "f864d5fd38b7466c76b5a36dc0e3e9455c0126e2",
+ "src/facebox.js": "459278b408566142b6e89560cec000996ad31d6b",
+ ".gitignore": "e43b0f988953ae3a84b00331d0ccf5f7d51cb3cf",
+ "examples/images/logo.png": "e41cfe5c654e8e05ad46f15af1c462a1360e9764",
+ "LICENSE": "539b867ebec178676e954d10857114472fd07973",
+ "src/closelabel.png": "c339e59333e4c3b5bc5fd910796fda5469a2515f",
+ "examples/remote.html": "98d3e92373d1bc541e7f516e5e73b645a991ddc2",
+ "examples/index.html": "c8c243c6078ee02514224c7b7c316d690c74c1df",
+ "examples/test.html": "0a279c66167d358e40682186864935d0f856c4c4",
+ "examples/images/stairs.jpg": "63459bb418f5f6d896a8eb925c01f45024933ed6",
+ "README.md": "f3f5e9720d2a8c1ffbcae4a2bdea42bfb5ea113e",
+ "src/facebox.css": "3f33b9f470389f6f2a3a62e9eb1c4187f0d2b3de",
+ "examples/css/example.css": "172b5a8e3e1fe3ce9a5ed2f1de2899fd2ffc9fff",
+ "lib/jquery.js": "7c243080233761859937d52195b670602731a379",
+ "examples/test_programmatic.html": "0249382efbdc7412a67976d19154ef07ac51437f"
+ }
+}
+</pre>
+If you want to get the metadata of each blob (including sha, name, and mime type), use:
+
+ blob/full/:user/:repo/:tree_sha
+
+<pre class="terminal">
+$ curl http://github.com/api/v2/json/blob/full/defunkt/facebox/365b84e0fd92c47ecdada91da47f2d67500b8e31
+{
+ "blobs": [
+ {
+ "name": ".gitignore",
+ "size": 10,
+ "sha": "e43b0f988953ae3a84b00331d0ccf5f7d51cb3cf",
+ "mode": "100644",
+ "mime_type": "text/plain",
+ "type": "blob"
+ }
+ ]
+}
+</pre>
+
+You can also get the metadata of each tree and blob object:
+
+ tree/full/:user/:repo/:tree_sha
+
+<pre class="terminal">
+$ curl http://github.com/api/v2/json/tree/full/defunkt/facebox/365b84e0fd92c47ecdada91da47f2d67500b8e31
+{
+ "tree": [
+ {
+ "name": ".gitignore",
+ "size": 10,
+ "sha": "e43b0f988953ae3a84b00331d0ccf5f7d51cb3cf",
+ "mode": "100644",
+ "mime_type": "text/plain",
+ "type": "blob"
+ },
+ {
+ "name": "releases",
+ "size": 0,
+ "sha": "82e3a754b6a0fcb238b03c0e47d05219fbf9cf89",
+ "mode": "040000",
+ "mime_type": "text/plain",
+ "type": "tree"
+ }
+ ]
+}
+</pre>
+
+## Raw Git Data ##
+
+You can get the contents of a blob with the blob's SHA via:
+
+ blob/show/:user/:repo/:sha
+
+It is important to note that it doesn't matter which type you specify (yaml, xml, json), the output will simply be the raw output.
+
+Here is an example of getting a README file from Facebox:
+
+<pre class="terminal">
+$ curl http://github.com/api/v2/json/blob/show/defunkt/facebox/d4fc2d5e810d9b4bc1ce67702603080e3086a4ed
+Please visit http://famspam.com/facebox/ or open index.html in your favorite browser.
+
+Need help? Join our Google Groups mailing list:
+ http://groups.google.com/group/facebox/
+</pre>
+You can actually get raw trees and commits this way, too. If you give it a tree SHA instead, you'll get this:
+
+<pre class="terminal">
+$ curl http://github.com/api/v2/json/blob/show/defunkt/facebox/73afb1ed4d16d084eee5696fcf25cd4b03b9201e
+100644 blob e43b0f988953ae3a84b00331d0ccf5f7d51cb3cf .gitignore
+100644 blob d4fc2d5e810d9b4bc1ce67702603080e3086a4ed README.txt
+100644 blob f184e6269b343014f58694093b55558dd5dde193 b.png
+100644 blob f6271859d51654b6fb2719df5fe192c8398ecefc bl.png
+100644 blob 31f204fc451cd9dd5cfdadfad2d86ed0e1104882 br.png
+100755 blob 08f6f1fce2f6a02dcb15b6c66244470794587bb0 build_tar.sh
+100755 blob 87b4f8bd699386e3a6fcc2e50d7c61bfc4aabb8d closelabel.gif
+100644 blob 97ebe3cab3eab76253f9cc5fc894b339456da86e facebox.css
+100644 blob 932664fafa412478a06b86de0fe8eefe00441289 facebox.js
+100644 blob dc61a86c3f342b930f0a0447cae33fee812e27d3 faceplant.css
+100644 blob a9d1c235d08ae383e4d9dedf5e2cc0236defdaa6 index.html
+100644 blob ebe02bdd357c337e0e817fcbce2a034a54a13287 jquery.js
+100755 blob f864d5fd38b7466c76b5a36dc0e3e9455c0126e2 loading.gif
+100644 blob e41cfe5c654e8e05ad46f15af1c462a1360e9764 logo.png
+040000 tree 82e3a754b6a0fcb238b03c0e47d05219fbf9cf89 releases
+100644 blob 98d3e92373d1bc541e7f516e5e73b645a991ddc2 remote.html
+040000 tree bbf747873075ac28667d246491ffdefbd314fe4f screenshots
+100644 blob e58b35b362ce5347bb5064e91a3bf8e4fed4f6ef shadow.gif
+100644 blob 63459bb418f5f6d896a8eb925c01f45024933ed6 stairs.jpg
+100644 blob 0a279c66167d358e40682186864935d0f856c4c4 test.html
+100644 blob 0249382efbdc7412a67976d19154ef07ac51437f test_programmatic.html
+100644 blob d99c8f6c6eaa12d7b49a20f41f08a5006f3ea8b7 tl.png
+100644 blob e99b6ec8310e859fd27519694f04e1babf2ab2c4 tr.png
+</pre>
+
+Here is an example of a commit:
+
+<pre class="terminal">
+$ curl http://github.com/api/v2/json/blob/show/defunkt/facebox/4bf7a39e8c4ec54f8b4cd594a3616d69004aba69
+tree f7a5de2e224ec94182a3c2c081f4e7f35f70da4d
+parent cd13d9a61288dceb0a7aa73b55ed2fd019f4f1f7
+parent 3211367cab73233af66dac2710c94682f3f3b9b2
+author Chris Wanstrath <chris@ozmm.org> 1213837237 -0700
+committer Chris Wanstrath <chris@ozmm.org> 1213837237 -0700
+
+Merge branch 'master' of git://github.com/webweaver/facebox into webweaver/master
+</pre>
366 thirdparty/doc-github/_posts/2010-04-23-orgs.markdown
@@ -0,0 +1,366 @@
+---
+layout: default
+title: Organizations API
+---
+
+# Organizations API
+
+API for accessing and modifying organizations.
+
+## Getting Organization Information
+
+You can get the full information on organizations by the screen name:
+
+ /organizations/:org [GET]
+
+<pre class="terminal">
+$ curl https://github.com/api/v2/json/organizations/github
+{
+ "organization": {
+ "name": "GitHub",
+ "company": null,
+ "gravatar_id": "61024896f291303615bcd4f7a0dcfb74",
+ "location": "San Francisco, CA",
+ "created_at": "2008-05-10T21:37:31-07:00",
+ "blog": "http://github.com/blog",
+ "public_gist_count": 0,
+ "public_repo_count": 20,
+ "following_count": 0,
+ "id": 9919,
+ "permission": null,
+ "type": "Organization",
+ "followers_count": 532,
+ "login": "github",
+ "email": "support@github.com"
+ }
+}
+</pre>
+
+Owners can update the organization with these fields:
+
+* `name`
+* `email`
+* `blog`
+* `company`
+* `location`
+* `billing_email`
+
+<pre>
+ /organizations/:org [PUT]
+</pre>
+
+You can send POST params:
+
+<pre class="terminal">
+$ curl -d "organization[name]=New%20Name" \
+ https://github.com/api/v2/json/organizations/github
+</pre>
+
+You can also send JSON:
+
+<pre class="terminal">
+$ curl -H "Content-Type: application/json" \
+ -d '{"organization": {"name": "New Name"}}' \
+ https://github.com/api/v2/json/organizations/github
+</pre>
+
+## Checking Organization Membership
+
+You can get all the public organizations that a user is part of:
+
+ /user/show/:user/organizations [GET]
+
+<pre class="terminal">
+$ curl https://github.com/api/v2/json/user/show/technoweenie/organizations
+{
+ "organizations": [
+ {
+ "name": "GitHub",
+ "company": null,
+ "gravatar_id": "61024896f291303615bcd4f7a0dcfb74",
+ "location": "San Francisco, CA",
+ "created_at": "2008-05-10T21:37:31-07:00",
+ "blog": "http://github.com/blog",
+ "public_gist_count": 0,
+ "public_repo_count": 20,
+ "following_count": 0,
+ "id": 9919,
+ "permission": null,
+ "type": "Organization",
+ "followers_count": 532,
+ "login": "github",
+ "email": "support@github.com"
+ }
+ ]
+}
+</pre>
+
+You can get a list of all of your organizations:
+
+ /organizations [GET]
+
+## Listing Organization Memberships
+
+List all repositories across all the organizations that you can access:
+
+ /organizations/repositories [GET]
+
+<pre class="terminal">
+$ curl https://github.com/api/v2/json/organizations/repositories
+{
+ "repositories": [
+ {
+ "name": "gollum",
+ "has_wiki": true,
+ "created_at": "2010/03/29 11:30:53 -0700",
+ "watchers": 607,
+ "private": false,
+ "fork": false,
+ "url": "https://github.com/github/gollum",
+ "pushed_at": "2010/12/02 19:28:28 -0800",
+ "open_issues": 34,
+ "has_downloads": true,
+ "permission": "admin",
+ "homepage": "",
+ "has_issues": true,
+ "organization": "github",
+ "forks": 54,
+ "description": "A simple, Git-powered wiki with a sweet API and local frontend.",
+ "owner": "github"
+ }
+ ]
+}
+</pre>
+
+By default, this only shows repos that you have explicit access to
+through a non Owner's Team. You can include all repos from
+Organizations that you own:
+
+<pre class="terminal">
+$ curl https://github.com/api/v2/json/organizations/repositories?owned=1
+</pre>
+
+You can also add public repos from Organizations that you don't have
+explicit access to.
+
+<pre class="terminal">
+$ curl https://github.com/api/v2/json/organizations/repositories?public=1
+</pre>
+
+List all members of the organization's Owners team:
+
+ /organizations/:org/owners [GET]
+
+<pre class="terminal">
+$ curl https://github.com/api/v2/json/organizations/github/owners
+{
+ "users": [
+ {
+ "name": "Corey Donohoe",
+ "company": "GitHub",
+ ...
+ }
+ ]
+}
+</pre>
+
+List all public repositories of any other organization:
+
+ /organizations/:org/public_repositories [GET]
+
+List all public members of any organization:
+
+ /organizations/:org/public_members [GET]
+
+<pre class="terminal">
+$ curl https://github.com/api/v2/json/organizations/github/public_members
+{
+ "users": [
+ {
+ "name": "Corey Donohoe",
+ "company": "GitHub",
+ ...
+ }
+ ]
+}
+</pre>
+
+# Teams API
+
+API for accessing and modifying teams. These actions all require you to have
+admin access for the Organization and/or the Team. If using OAuth, make sure
+you are armed with the 'repo' scope.
+
+## Listing Organization Teams
+
+ /organizations/:org/teams [GET]
+
+<pre class="terminal">
+$ curl https://github.com/api/v2/json/organizations/github/teams [GET]
+{
+ "teams": [
+ {
+ "name": "Open Source",
+ "id": 10,
+ "permission": "admin"
+ }
+ ]
+}
+</pre>
+
+## Creating a Team
+
+ /organizations/:org/teams [POST]
+
+The applicable fields for Teams are:
+
+* name
+* permission (admin/push/pull)
+* repo_names (array)
+
+You can send this data as POST params:
+
+<pre class="terminal">
+$ curl -d "team[name]=my-team" -d "team[permission]=admin" \
+ -d "team[repo_names][]=:user/:repo" -d "team[repo_names][]=:user/:repo" \
+ https://github.com/api/v2/json/organizations/github/teams
+{
+ "team": {
+ "name": "test",
+ "id": 123,
+ "permission": "pull"
+ }
+}
+</pre>
+
+You can also send it as JSON:
+
+<pre class="terminal">
+$ curl -d '{"team":{"name":"my-team", "repo_names":[":user/:repo"]}}' \
+ -H "Content-Type: application/json" \
+ https://github.com/api/v2/json/organizations/github/teams
+</pre>
+
+## Fetching and Updating Team Information
+
+ /teams/:team_id [GET]
+
+<pre class="terminal">
+$ curl https://github.com/api/v2/json/teams/10 [GET]
+{
+ "team": {
+ "name": "Open Source",
+ "id": 10,
+ "permission": "admin"
+ }
+}
+</pre>
+
+You can update a Team by sending the following attributes (with the correct
+Content-Type):
+
+ /teams/:team_id [PUT]
+
+<pre class="terminal">
+$ curl -X PUT -d '{"team": {"name": "OSS"}}' \
+ -H "Content-Type: application/json" \
+ https://github.com/api/v2/json/teams/10
+{
+ "team": {
+ "name": "OSS",
+ "id": 10,
+ "permission": "admin"
+ }
+}
+</pre>
+
+You can also DELETE a Team:
+
+ /teams/:team_id [DELETE]
+
+<pre class="terminal">
+$ curl -X DELETE \
+ https://github.com/api/v2/json/teams/10
+</pre>
+
+## Team Members
+
+To list users:
+
+ /teams/:team_id/members [GET]
+
+<pre class="terminal">
+$ curl https://github.com/api/v2/json/teams/10/members
+
+{
+ "users": [
+ {
+ "gravatar_id": "b8dbb1987e8e5318584865f880036796",
+ "company": "GitHub",
+ "name": "Chris Wanstrath",
+ "location": "San Francisco, CA",
+ "blog": "http://chriswanstrath.com/",
+ "type": "User",
+ "login": "defunkt",
+ "email": "chris@wanstrath.com"
+ }
+ ]
+}
+</pre>
+
+To add a user to the team:
+
+ /teams/:team_id/members?name=:user [POST]
+
+<pre class="terminal">
+$ curl -d "name=technoweenie" https://github.com/api/v2/json/teams/10/members
+</pre>
+
+To remove a user from the team:
+
+ /teams/:team_id/members?name=:user [DELETE]
+
+## Team Repositories
+
+To list repositories:
+
+ /teams/:team_id/repositories [GET]
+
+<pre class="terminal">
+$ curl https://github.com/api/v2/json/teams/10/repositories
+
+{
+ "repositories": [
+ {
+ "name": "albino",
+ "created_at": "2008-05-10T21:45:03-07:00",
+ "has_wiki": false,
+ "watchers": 59,
+ "private": false,
+ "fork": false,
+ "url": "https://github.com/github/albino",
+ "pushed_at": "2010-10-11T11:09:50-07:00",
+ "has_downloads": false,
+ "open_issues": 2,
+ "homepage": "",
+ "has_issues": true,
+ "organization": "github",
+ "forks": 6,
+ "description": "Ruby wrapper for the Pygments syntax highlighter.",
+ "owner": "github"
+ }
+ ]
+}
+</pre>
+
+To add a repo to the team:
+
+ /teams/:team_id/repositories?name=:user/:repo [POST]
+
+<pre class="terminal">
+$ curl -d "name=github/gollum" https://github.com/api/v2/json/teams/10/repositories
+</pre>
+
+To remove a repo from the team:
+
+ /teams/:team_id/repositories?name=:user/:repo [DELETE]
191 thirdparty/doc-github/_posts/2010-04-23-pulls.markdown
@@ -0,0 +1,191 @@
+---
+layout: default
+title: Pull Request API
+---
+
+# Pull Request API
+
+API for accessing Pull Requests. This API is considered **BETA**, file any
+feedback in the [API forum](http://support.github.com/discussions/api).
+
+## Creating a Pull Request
+
+ /pulls/:user/:repo [POST]
+
+You can create a Pull Request by posting these attributes:
+
+* `pull[base]` - A String of the branch or commit SHA that you want your changes to be pulled to.
+* `pull[head]` - A String of the branch or commit SHA of your changes. Typically this will be a branch. If the branch is in a fork of the original repository, specify the username first: "my-user:some-branch".
+* `pull[title]` - The String title of the Pull Request (and the related Issue).
+* `pull[body]` - The String body of the Pull Request.
+
+Example: The user "smparkes" forks "technoweenie/faraday", and adds a new
+feature to the "synchrony" branch. This is how he could create the Pull
+Request through the API:
+
+<pre class="terminal">
+$ curl -d "pull[base]=master" -d "pull[head]=smparkes:synchrony" \
+ -d "pull[title]=..." -d "pull[body]=..." \
+ https://github.com/api/v2/json/pulls/technoweenie/faraday
+</pre>
+
+You can replace `pull[title]` and `pull[body]` with `pull[issue]` to specify an existing Issue number on the source repository:
+
+<pre class="terminal">
+$ curl -d "pull[base]=master" -d "pull[head]=smparkes:synchrony" \
+ -d "pull[issue]=15" \
+ https://github.com/api/v2/json/pulls/technoweenie/faraday
+</pre>
+
+## Listing Pull Requests
+
+You can list pull requests for any Repository that you can access. If the
+repository is private, supply your login credentials.
+
+ /pulls/:user/:repo/:state
+
+<pre class="terminal">
+$ curl http://github.com/api/v2/json/pulls/technoweenie/faraday
+{
+ "pulls": [
+ {
+ "state": "open",
+ "base": {
+ "label": "technoweenie:master",
+ "ref": "master",
+ "sha": "53397635da83a2f4b5e862b5e59cc66f6c39f9c6",
+ "user": {...},
+ "repository": {...}
+ },
+ "head": {
+ "label": "smparkes:synchrony",
+ "ref": "synchrony",
+ "sha": "83306eef49667549efebb880096cb539bd436560",
+ "user": {...},
+ "repository": {...}
+ },
+ "issue_user": {...},
+ "user": {...},
+ "title": "Synchrony",
+ "body": "Here's the pull request.\r\n\r\nThis isn't generic EM: require's Ilya's synchrony and needs to be run on its own fiber, e.g., via synchrony or rack-fiberpool.\r\n\r\nI thought about a \"first class\" em adapter, but I think the faraday api is sync right now, right? Interesting idea to add something like rack's async support to faraday, but that's an itch I don't have right now.",
+ "position": 4.0,
+ "number": 15,
+ "votes": 0,
+ "comments": 4,
+ "diff_url": "https://github.com/technoweenie/faraday/pull/15.diff",
+ "patch_url": "https://github.com/technoweenie/faraday/pull/15.patch",
+ "labels": [],
+ "html_url": "https://github.com/technoweenie/faraday/pull/15",
+ "issue_created_at": "2010-10-04T12:39:18-07:00",
+ "issue_updated_at": "2010-11-04T16:35:04-07:00",
+ "created_at": "2010-10-04T12:39:18-07:00",
+ "updated_at": "2010-11-04T16:30:14-07:00"
+ }
+ ]
+}
+</pre>
+
+You can query for closed Pull Requests:
+
+ $ curl http://github.com/api/v2/json/pulls/technoweenie/faraday/closed
+
+## Showing Pull Request Discussions
+
+You can list a single Pull Request by supplying the number:
+
+ /pulls/:user/:repo/:number
+
+<pre class="terminal">
+$ curl http://github.com/api/v2/json/pulls/technoweenie/faraday/15
+{
+ "pulls": [
+ {
+ "state": "open",
+ "base": {
+ "label": "technoweenie:master",
+ "ref": "master",
+ "sha": "53397635da83a2f4b5e862b5e59cc66f6c39f9c6",
+ "user": {...},
+ "repository": {...}
+ },
+ "head": {
+ "label": "smparkes:synchrony",
+ "ref": "synchrony",
+ "sha": "83306eef49667549efebb880096cb539bd436560",
+ "user": {...},
+ "repository": {...}
+ },
+ "discussion": [
+ {
+ "type": "IssueComment",
+ "gravatar_id": "821395fe70906c8290df7f18ac4ac6cf",
+ "created_at": "2010/10/07 07:38:35 -0700",
+ "body": "Did you intend to remove net/http? Otherwise, this looks good. Have you tried running the LIVE tests with it?\r\n\r\n ruby test/live_server.rb # start the demo server\r\n LIVE=1 rake",
+ "updated_at": "2010/10/07 07:38:35 -0700",
+ "id": 453980,
+ "user": {...}
+ },
+ {
+ "type": "Commit",
+ "committed_date": "2010-11-04T16:27:45-07:00",
+ "authored_date": "2010-11-04T16:27:45-07:00",
+ "id": "83306eef49667549efebb880096cb539bd436560",
+ "author": {
+ "name": "Steven Parkes",
+ "email": "smparkes@smparkes.net",
+ "login": "smparks" // filled if user is on GitHub
+ },
+ "committer": { ... }, // same as author
+ "message": "add em_synchrony support",
+ "user": {...}, // GitHub user info with gravatar_id
+ "tree": "101492b4af83d1298225e573bbe7478952ba9f0a",
+ "parents": [{"id": "0a0b888d8eabded106a30e8a9cddc47e6cacbf37"}]
+ },
+ {
+ "type": "PullRequestReviewComment",
+ "diff_hunk": "@@ -1,12 +1,12 @@\n Aquaman is a comic book superhero who appears in DC Comics....",
+ "body": "some comment about the change",
+ "path": "aquaman.txt",
+ "position": 19,
+ "commit_id": "54bb654c9e6025347f57900a4a5c2313a96b8035",
+ "original_commit_id": "54bb654c9e6025347f57900a4a5c2313a96b8035",
+ "user": {...},
+ "created_at": "2011-02-07T14:39:03-05:00",
+ "updated_at": "2011-02-07T14:39:03-05:00"
+ }
+ ],
+ "issue_user": {...},
+ "user": {...},
+ "title": "Synchrony",
+ "body": "Here's the pull request.\r\n\r\nThis isn't generic EM: require's Ilya's synchrony and needs to be run on its own fiber, e.g., via synchrony or rack-fiberpool.\r\n\r\nI thought about a \"first class\" em adapter, but I think the faraday api is sync right now, right? Interesting idea to add something like rack's async support to faraday, but that's an itch I don't have right now.",
+ "position": 4.0,
+ "number": 15,
+ "votes": 0,
+ "comments": 4,
+ "diff_url": "https://github.com/technoweenie/faraday/pull/15.diff",
+ "patch_url": "https://github.com/technoweenie/faraday/pull/15.patch",
+ "labels": [],
+ "html_url": "https://github.com/technoweenie/faraday/pull/15",
+ "issue_created_at": "2010-10-04T12:39:18-07:00",
+ "issue_updated_at": "2010-11-04T16:35:04-07:00",
+ "created_at": "2010-10-04T12:39:18-07:00",
+ "updated_at": "2010-11-04T16:30:14-07:00"
+ }
+ ]
+}
+</pre>
+
+The Pull Request API uses a lot of fields from the Issue. Fields like `title`, `body`, `number`, `labels`, etc, will match a similar Issues API call:
+
+<pre class="terminal">
+$ curl http://github.com/api/v2/json/issues/show/technoweenie/faraday/15
+</pre>
+Some Issue fields names that clash with Pull Request field names are prefixed
+with `issue_`. The `discussion` key lists all of the Commits, Issue Comments, and Commit Comments for this Pull Request. The `discussion` key is only available when fetching a single Pull Request.
+
+## Updating Pull Requests
+
+Pull Requests themselves don't update, they merely track changes to Issues and
+Commits. See the [Issues API](/p/issues.html) for info on commenting on or
+closing Pull Requests. Issues and Pull Requests use the same identification
+numbers.
465 thirdparty/doc-github/_posts/2010-04-23-repo.markdown
@@ -0,0 +1,465 @@
+---
+layout: default
+title: Repositories API
+---
+
+# Repositories API #
+
+## Searching Repositories ##
+
+ repos/search/:q
+
+To search for repositories that have to do with testing ruby, you could do this:
+
+<pre class="terminal">
+$ curl http://github.com/api/v2/json/repos/search/ruby+testing
+{
+ "repositories": [
+ {
+ "type": "repo",
+ "language": "Ruby",
+ "has_downloads": true,
+ "url": "https://github.com/geemus/fog",
+ "homepage": "",
+ "pushed_at": "2011/01/05 11:24:06 -0800",
+ "created_at": "2009/05/18 00:14:04 -0700",
+ "fork": false,
+ "has_wiki": true,
+ "score": 0.45233846,
+ "size": 5732,
+ "private": false,
+ "name": "fog",
+ "watchers": 807,
+ "owner": "geemus",
+ "open_issues": 13,
+ "description": "The Ruby cloud computing library.",
+ "forks": 95,
+ "has_issues": true,
+ "followers": 807, // deprecated
+ "pushed": "2011/01/05 11:24:06 -0800", // deprecated
+ "created": "2009/05/18 00:14:04 -0700", // deprecated
+ "username": "geemus" // deprecated
+ }
+ ]
+}
+</pre>
+
+Note: The API has been updated to return the values with the same key names as the regular Repository API. As a result, some keys may have similarly named keys to keep compatibility with older scripts. If you're writing a new app, favor the new keys over the old ones:
+
+* <del>`followers`</del> `=>` `watchers`
+* <del>`username`</del> `=>` `owner`
+* <del>`pushed`</del> `=>` `pushed_at`
+* <del>`created`</del> `=>` `created_at`
+
+You can pass a custom page number and/or a language to narrow the search:
+
+<pre class="terminal">
+ $ curl http://github.com/api/v2/json/repos/search/ruby+testing?start_page=2
+ $ curl http://github.com/api/v2/json/repos/search/ruby+testing?language=Ruby
+</pre>
+
+Language searching is done with the capitalized format of the name: "Ruby", not "ruby".
+It takes the same values as the language drop down on [http://github.com/search](http://github.com/search).
+
+## Show Repo Info ##
+
+To look at more in-depth information for a repository, GET this
+
+ repos/show/:user/:repo
+
+For example, to see the information for Grit
+
+<pre class="terminal">
+$ curl http://github.com/api/v2/json/repos/show/schacon/grit
+{
+ "repository": {
+ "url": "https://github.com/schacon/grit",
+ "has_issues": true,
+ "homepage": "http://grit.rubyforge.org/",
+ "watchers": 106,
+ "source": "mojombo/grit",
+ "parent": "mojombo/grit",
+ "has_downloads": true,
+ "created_at": "2008/04/18 16:14:24 -0700",
+ "forks": 11,
+ "fork": true,
+ "has_wiki": true,
+ "private": false,
+ "pushed_at": "2010/05/05 15:28:38 -0700",
+ "name": "grit",
+ "description": "Grit is a Ruby library for extracting information from a git repository in an object oriented manner - this fork tries to intergrate as much pure-ruby functionality as possible",
+ "owner": "schacon",
+ "open_issues": 0
+ }
+}
+</pre>
+
+Some keys, such as `source` and `parent` are only available on the show repo
+action. They won't show up on repo lists or searches.
+
+## Set Repo Info ##
+
+If you are authenticated, you can update your repo's information by
+POSTing to it.
+
+ /repos/show/:user/:repo [POST]
+
+ :values[key] = value
+
+Where the POST values are of:
+
+ description
+ homepage
+ has_wiki
+ has_issues
+ has_downloads
+
+So, you could do this to update your repo's homepage:
+
+<pre class="terminal">
+$ curl -F 'login=schacon' -F 'token=XXX' https://github.com/api/v2/json/repos/show/schacon/grit -F 'values[homepage]=http://schacon.github.com/grit'
+</pre>
+
+## List All Repositories ##
+
+You can list out all the repositories for a user with
+
+ repos/show/:user
+
+For example, to see all of schacons public repos, we can GET
+
+<pre class="terminal">
+$ curl http://github.com/api/v2/json/repos/show/schacon
+{
+ "repositories": [
+ {
+ "url": "https://github.com/schacon/ruby-git",
+ "homepage": "",
+ "watchers": 290,
+ "open_issues": 14,
+ "created_at": "2008/01/27 09:23:23 -0800",
+ "pushed_at": "2009/10/17 08:00:28 -0700",
+ "has_issues": true,
+ "fork": false,
+ "has_downloads": true,
+ "private": false,
+ "name": "ruby-git",
+ "description": "Ruby/Git is a Ruby library that can be used to create, read and manipulate Git repositories by wrapping system calls to the git binary.",
+ "forks": 64,
+ "owner": "schacon",
+ "has_wiki": true
+ }
+ ]
+}
+</pre>
+
+If you are authenticated as that user, you can see all the private repositories as well. This API call will return 30 results per page. You can specify pages with the `?page` parameter:
+
+<pre class="terminal">
+$ curl http://github.com/api/v2/json/repos/show/schacon?page=2
+</pre>
+
+You can check for `X-Next` and `X-Last` headers to determine if there
+are more pages to fetch.
+
+<pre class="terminal">
+$ curl -i http://github.com/api/v2/yaml/repos/show/schacon
+HTTP/1.1 200 OK
+X-Next: http://github.com/api/v2/yaml/repos/show/schacon?page=2
+X-Last: http://github.com/api/v2/yaml/repos/show/schacon?page=3
+</pre>
+
+## Watching Repositories ##
+
+You have to be authenticated for this, but you can watch and unwatch repositories with calls to
+
+ repos/unwatch/:user/:repo
+ repos/watch/:user/:repo
+
+## Forking Repositories ##
+
+You can also fork a repository with
+
+ repos/fork/:user/:repo
+
+Which will return data about your newly forked repository.
+
+<pre class="terminal">
+curl -F 'login=schacon' -F 'token=XXX' http://github.com/api/v2/json/repos/fork/dim/retrospectiva
+</pre>
+
+## Creating and Deleting Repositories ##
+
+To create a new repository, hit this url
+
+ repos/create
+
+with at least 'name' but it will take any of these as POST args
+
+ name => name of the repository. ex: "my-repo" or "other-user/my-repo"
+ description => repo description
+ homepage => homepage url
+ public => 1 for public, 0 for private
+
+You can also delete a repository with a POST to
+
+ repos/delete/:user/:repo
+ repos/delete/:repo (DEPRECATED)
+
+which will give you back a token in the 'delete\_token' field of the response, which you then have to post back to the same url again (in the 'delete\_token' POST var) to complete the deletion.
+
+## Repository Visibility ##
+
+To set a public repository private, you can POST while authenticated to
+
+ repos/set/private/:user/:repo
+ repos/set/private/:repo (DEPRECATED)
+
+To make a private repo public, POST while authenticated to
+
+ repos/set/public/:user/:repo
+ repos/set/public/:repo (DEPRECATED)
+
+## Deploy Keys ##
+
+You can use the API to list, add and remove your deploy keys. To see which deploy keys you have setup for a specific repository, GET this URL
+
+ repos/keys/:user/:repo
+ repos/keys/:repo (DEPRECATED)
+
+It will give you a listing of your public keys, like so
+
+<pre class="terminal">
+$ curl -F 'login=schacon' -F 'token=XXX' http://github.com/api/v2/json/repos/keys/bob/retrospectiva
+{
+ "public_keys": [
+ {
+ "title": "my deploy key",
+ "id": 553719,
+ "key": "ssh-rsa ....."
+ }
+ ]
+}
+</pre>
+
+You can also add new keys by POSTing to
+
+ repos/key/:user/:repo/add
+ repos/key/:repo/add (DEPRECATED)
+
+which takes the following POST variables
+
+ title => title of the key
+ key => public key data
+
+You can also POST to this removal URL to remove a key
+
+ repos/key/:user/:repo/remove
+ repos/key/:repo/remove (DEPRECATED)
+
+You will need to POST an 'id' variable with the key ID returned from the public listing or key creation.
+
+## Collaborators ##
+
+To get a list of the collaborators on your project:
+
+ repos/show/:user/:repo/collaborators [GET]
+
+Organization repositories will return the unique users across the repository's
+teams.
+
+To add or remove collaborators, POST to one of these URLs
+
+ repos/collaborators/:user/:repo/add/:collaborator
+ repos/collaborators/:user/:repo/remove/:collaborator
+ repos/collaborators/:repo/add/:collaborator (DEPRECATED)
+ repos/collaborators/:repo/remove/:collaborator (DEPRECATED)
+
+To get a list of repos you can push to that are not your own:
+
+ repos/pushable [GET]
+