Markdown formatting fixes.
[arvados.git] / examples / buzz / README.md
1 # Buzz Ruby Sample
2 This is a simple starter project written in Ruby which provides a minimal
3 example of Buzz integration within a Sinatra web application.
4
5 Once you've run the starter project and played with the features it provides,
6 this starter project provides a great place to start your experimentation into
7 the API.
8
9 ## Prerequisites
10 Please make sure that all of these are installed before you try to run the
11 sample.
12
13 - Ruby 1.8.7+
14 - Ruby Gems 1.3.7+
15 - Are you on a Mac? If so, be sure you have XCode 3.2+
16 - A few gems (run 'sudo gem install <gem name>' to install)
17     - sinatra
18     - httpadapter
19     - extlib
20     - dm-sqlite-adapter
21     - google-api-ruby-client
22
23 ## Setup Authentication
24
25 This API uses OAuth 2.0. Learn more about Google APIs and OAuth 2.0 here:
26 http://code.google.com/apis/accounts/docs/OAuth2.html
27
28 Or, if you'd like to dive right in, follow these steps.
29  - Visit https://code.google.com/apis/console/ to register your application.
30  - From the "Project Home" screen, activate access to "Buzz API".
31  - Click on "API Access" in the left column
32  - Click the button labeled "Create an OAuth2 client ID"
33  - Give your application a name and click "Next"
34  - Select "Web Application" as the "Application type"
35  - Under "Your Site or Hostname" select "http://" as the protocol and enter
36    "localhost" for the domain name
37  - click "Create client ID"
38
39 Edit the buzz.rb file and enter the values for the following properties that 
40 you retrieved from the API Console:
41
42  - `oauth_client_id`
43  - `oauth_client_secret`
44
45 Or, include them in the command line as the first two arguments.
46
47 ## Running the Sample
48
49 I'm assuming you've checked out the code and are reading this from a local
50 directory. If not check out the code to a local directory.
51
52 1. Start up the embedded Sinatra web server
53
54     $ ruby buzz.rb
55
56 2. Open your web browser and see your activities! Go to `http://localhost:4567/`
57
58 3. Be inspired and start hacking an amazing new web app!