Created
January 31, 2013 00:07
-
-
Save missinglink/4678610 to your computer and use it in GitHub Desktop.
Ciao Script for the Github README API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! Requried Headers | |
headers: 'User-Agent': 'Ciao/Client 1.0' | |
#> Github API call for node.js README | |
port: 443 | |
protocol: 'https:' | |
host: 'api.github.com' | |
path: '/repos/joyent/node/readme' | |
headers: 'Accept': 'application/json' | |
#? Readme is available on Github | |
response.statusCode.should.equal 200 | |
response.should.have.header 'server', 'GitHub.com' | |
#? Should be what we are looking for... | |
json.sha.should.match /^[a-z0-9]{40}/ | |
json.should.include | |
type: 'file' | |
path: 'README.md' | |
url: 'https://api.github.com/repos/joyent/node/contents/README.md' | |
html_url: 'https://github.com/joyent/node/blob/master/README.md' | |
git_url: 'https://api.github.com/repos/joyent/node/git/blobs/' + json.sha |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment