Skip to content

Instantly share code, notes, and snippets.

@missinglink
Created January 31, 2013 00:07
Show Gist options
  • Save missinglink/4678610 to your computer and use it in GitHub Desktop.
Save missinglink/4678610 to your computer and use it in GitHub Desktop.
Ciao Script for the Github README API
#! 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