Skip to content
This repository
Browse code

Update gitignore

  • Loading branch information...
commit 661b6d6fa201c6055820e1117aa23269db459904 1 parent 3ee007c
Kyle Conroy authored May 19, 2011
35  .gitignore
... ...
@@ -1,5 +1,30 @@
1  
-*.pyc
2  
-.DS_Store
3  
-.project
4  
-.pydevproject
5  
-*~
  1
+*.py[co]
  2
+
  3
+# Packages
  4
+*.egg
  5
+*.egg-info
  6
+dist
  7
+build
  8
+eggs
  9
+parts
  10
+bin
  11
+var
  12
+sdist
  13
+develop-eggs
  14
+.installed.cfg
  15
+
  16
+# Installer logs
  17
+pip-log.txt
  18
+
  19
+# Unit test / coverage reports
  20
+.coverage
  21
+.tox
  22
+
  23
+#Translations
  24
+*.mo
  25
+
  26
+#Mr Developer
  27
+.mr.developer.cfg
  28
+
  29
+#Sphnix
  30
+docs/_build
80  docs/examples/stashboard.php
... ...
@@ -1,80 +0,0 @@
1  
-<?php
2  
-
3  
-  require_once('OAuth.php');
4  
-  
5  
-  $consumer_key = 'anonymous';
6  
-  $consumer_secret = 'anonymous';
7  
-  $oauth_key = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
8  
-  $oauth_secret = 'YYYYYYYYYYYYYYYYYYYYYYYY'
9  
-  
10  
-  $consumer = new OAuthConsumer($consumer_key, $consumer_secret);
11  
-  $token = new OAuthToken($oauth_key, $oauth_secret);
12  
-  
13  
-  
14  
-  // Set up a request function  
15  
-  function request($consumer, $token, $url, $method = "GET", $data = null){
16  
-    
17  
-    $sign = new OAuthSignatureMethod_HMAC_SHA1();
18  
-    $request = OAuthRequest::from_consumer_and_token(
19  
-      $consumer, $token, $method, $url, $data);
20  
-    $request->sign_request($sign, $consumer, $token);
21  
-    
22  
-    $ch = curl_init($request->get_normalized_http_url());
23  
-    
24  
-    if ($method == "POST") {
25  
-      curl_setopt($ch, CURLOPT_POST ,1);
26  
-      curl_setopt($ch, CURLOPT_POSTFIELDS , $request->to_postdata());
27  
-    }
28  
-    
29  
-    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
30  
-    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
31  
-    curl_setopt($ch, CURLOPT_FOLLOWLOCATION ,1);
32  
-    curl_setopt($ch, CURLOPT_HEADER ,0);  // DO NOT RETURN HTTP HEADERS
33  
-    
34  
-    return curl_exec($ch);
35  
-  }
36  
-  
37  
-  // Fill in your website
38  
-  $base_url = "https://stashboard.appspot.com/api/v1";
39  
-  
40  
-  $data = array(
41  
-      "name" => "An Example Service",
42  
-      "description" => "An example service, created using the StashBoard API",
43  
-  );
44  
-  
45  
-  $r = request($consumer, $token, $base_url . "/services", "POST", $data);
46  
-  $service = json_decode($r);
47  
-  
48  
-  // GET the list of possible status images
49  
-  $r = request($consumer, $token, $base_url . "/status-images", "GET");
50  
-  $data = json_decode($r);
51  
-  $images = $data->images;
52  
-  
53  
-
54  
-
55  
-  // Pick a the first image
56  
-  $image = $images[0];
57  
-  
58  
-  // POST to the Statuses Resources to create a new Status
59  
-  $data = array(
60  
-     "name" => "Example Status",
61  
-     "description" => "An example status, means nothing",
62  
-     "severity" => 10000,
63  
-     "image" => $image->name,
64  
-  );
65  
-  
66  
-  $r = request($consumer, $token, $base_url . "/statuses", "POST", $data);
67  
-  $status = json_decode($r);
68  
-  
69  
-  // Create a new event with the given status and given service
70  
-  $data = array(
71  
-     "message" => "Our first event! So exciting",
72  
-     "status" => $status->id,
73  
-  );
74  
-  
75  
-  $r = request($consumer, $token, $service->url . "/events", "POST", $data);
76  
-  $event = json_decode($r);
77  
-  
78  
-  print_r($event);
79  
-   
80  
-   
142  docs/examples/stashboard.py
... ...
@@ -1,142 +0,0 @@
1  
-import oauth2 as oauth
2  
-import json
3  
-import urllib
4  
-import unittest
5  
-
6  
-oauth_key = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
7  
-oauth_secret = 'YYYYYYYYYYYYYYYYYYYYYYYY'
8  
-
9  
-# Create your consumer with the proper key/secret.
10  
-# If you register your application with google, these values won't be
11  
-# anonymous and anonymous. 
12  
-consumer = oauth.Consumer(key='anonymous', secret='anonymous')
13  
-token = oauth.Token(oauth_key, oauth_secret)
14  
-
15  
-# Fill in your website
16  
-base_url = "https://stashboard.appspot.com/api/v1"
17  
-
18  
-# Create our client.
19  
-client = oauth.Client(consumer, token=token)
20  
-
21  
-class ServicesTest(unittest.TestCase):
22  
-
23  
-    def testMissingServiceName(self):
24  
-        "should return 400 Bad Data"
25  
-        data = urllib.urlencode({
26  
-                "description": "An example service API",
27  
-                })
28  
-
29  
-        resp, content = client.request(base_url + "/services", 
30  
-                                       "POST", body=data)
31  
-
32  
-        self.assertEquals(resp.status, 400)
33  
-
34  
-    def testMissingServiceDescription(self):
35  
-        "should return 400 Bad Data"
36  
-        data = urllib.urlencode({
37  
-                "name": "Some Random Name",
38  
-                })
39  
-
40  
-        resp, content = client.request(base_url + "/services", 
41  
-                                       "POST", body=data)
42  
-
43  
-        self.assertEquals(resp.status, 400)
44  
-
45  
-    def testMissingServiceData(self):
46  
-        "should return 400 Bad Data"
47  
-        resp, content = client.request(base_url + "/services", "POST")
48  
-        self.assertEquals(resp.status, 400)
49  
-
50  
-    def testDelete(self):
51  
-        "should return 405 Method Not Allowed"
52  
-        resp, content = client.request(base_url + "/services", "DELETE")
53  
-        self.assertEquals(resp.status, 405)
54  
-
55  
-    def testPut(self):
56  
-        "should return 411 Content Length Required"
57  
-        resp, content = client.request(base_url + "/services", "PUT")
58  
-        self.assertEquals(resp.status, 411)
59  
-
60  
-    def testPutWithData(self):
61  
-        "should return 405 Method Not Allowed"
62  
-        data = urllib.urlencode({
63  
-                "name": "Some Random Name",
64  
-                })
65  
-        resp, content = client.request(base_url + "/services", 
66  
-                                       "PUT", body=data)
67  
-        self.assertEquals(resp.status, 405)
68  
-
69  
-    def testServiceLifeCycle(self):
70  
-        "should return 200 and a newly created status"
71  
-        data = urllib.urlencode({
72  
-                "name": "What a service",
73  
-                "description": "An example service API",
74  
-                })
75  
-
76  
-        resp, content = client.request(base_url + "/services", "POST", body=data)
77  
-        service = json.loads(content)
78  
-
79  
-        self.assertEquals(resp.status, 200)
80  
-        self.assertEquals(service["name"], "What a service")
81  
-        self.assertEquals(service["description"], "An example service API")
82  
-
83  
-        resp, content = client.request(base_url + "/services/" + service["id"], "GET")
84  
-        service = json.loads(content)
85  
-
86  
-        self.assertEquals(resp.status, 200)
87  
-        self.assertEquals(service["name"], "What a service")
88  
-        self.assertEquals(service["description"], "An example service API")
89  
-
90  
-        # Update service
91  
-        data = urllib.urlencode({
92  
-                "description": "An example service API woohoo",
93  
-                })
94  
-
95  
-        resp, content = client.request(base_url + "/services/" + service["id"],
96  
-                                       "POST", body=data)
97  
-        service = json.loads(content)
98  
-
99  
-        self.assertEquals(resp.status, 200)
100  
-        self.assertEquals(service["name"], "What a service")
101  
-        self.assertEquals(service["description"], "An example service API woohoo")
102  
-
103  
-        # Delete service
104  
-        resp, content = client.request(base_url + "/services/" + service["id"],
105  
-                                       "DELETE")
106  
-        service = json.loads(content)
107  
-
108  
-        self.assertEquals(resp.status, 200)
109  
-        self.assertEquals(service["name"], "What a service")
110  
-        self.assertEquals(service["description"], "An example service API woohoo")
111  
-
112  
-if __name__ == '__main__':
113  
-    unittest.main()
114  
-
115  
-# GET the list of possible status images
116  
-resp, content = client.request(base_url + "/status-images", "GET")
117  
-data = json.loads(content)
118  
-images = data["images"]
119  
-
120  
-# Pick a random image for our status
121  
-image = images[0]
122  
-
123  
-# POST to the Statuses Resources to create a new Status
124  
-data = urllib.urlencode({
125  
-    "name": "Example Status",
126  
-    "description": "An example status, means nothing",
127  
-    "severity": 10000,
128  
-    "image": image["name"],
129  
-})
130  
-
131  
-resp, content = client.request(base_url + "/statuses", "POST", body=data)
132  
-status = json.loads(content)
133  
-
134  
-# Create a new event with the given status and given service
135  
-data = urllib.urlencode({
136  
-    "message": "Our first event! So exciting",
137  
-    "status": status["id"],
138  
-})
139  
-
140  
-resp, content = client.request(service["url"] + "/events", "POST", body=data)
141  
-event = json.loads(content)
142  
-
50  docs/examples/stashboard.rb
... ...
@@ -1,50 +0,0 @@
1  
-require 'rubygems'
2  
-require 'oauth'
3  
-require 'json'
4  
-
5  
-oauth_key = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
6  
-oauth_secret = 'YYYYYYYYYYYYYYYYYYYYYYYY'
7  
-
8  
-# Fill in your website
9  
-base = "https://stashboard.appspot.com"
10  
-
11  
-@consumer=OAuth::Consumer.new "anonymous", 
12  
-                              "anonymous",
13  
-                              {:site=>base}
14  
-                              
15  
-@token = OAuth::AccessToken.new(@consumer, oauth_key, oauth_secret)
16  
-
17  
-# POST to the Services Resource to create a new service. Save the response for
18  
-# later
19  
-@response = @token.post("/api/v1/services", {
20  
-    :name => "An Example Service",
21  
-    :description => "An example service, created using the StashBoard API",
22  
-})
23  
-srvice = JSON.parse(@response.body)
24  
-
25  
-# GET the list of possible status images
26  
-@response = @token.get("/api/v1/status-images")
27  
-data = JSON.parse(@response.body)
28  
-images = data['images']
29  
-
30  
-# Pick a random image for our status
31  
-image = images[rand(images.length)]
32  
-
33  
-
34  
-# POST to the Statuses Resources to create a new Status
35  
-@response = @token.post("/api/v1/statuses", {
36  
-    :name => "Example Status",
37  
-    :description => "An example status, means nothing",
38  
-    :severity => 10000,
39  
-    :image => image["name"],
40  
-})
41  
-
42  
-status = JSON.parse(@response.body)
43  
-
44  
-@response = @token.post("/api/v1/services/" + srvice["id"] + "/events", {
45  
-    :message => "Our first event! So exciting",
46  
-    :status => status["id"],
47  
-})
48  
-event = JSON.parse(@response.body)
49  
-
50  
-puts event
11  docs/examples/widget/example.html
... ...
@@ -1,11 +0,0 @@
1  
-<!DOCTYPE html>
2  
-<html>
3  
-    
4  
-    <head>
5  
-       <title>HellO!</title>
6  
-       <script type="text/javascript" src="../static/js/stashboard.js"></script>
7  
-    </head>
8  
-    <body>
9  
-    </body>
10  
-
11  
-</html>
35  docs/examples/widget/output.html
... ...
@@ -1,35 +0,0 @@
1  
-<!DOCTYPE html>
2  
-<html>
3  
-    
4  
-    <head>
5  
-       <title>HellO!</title>
6  
-       <style>
7  
-       #outer {
8  
-         position: absolute;
9  
-         top: 0px;
10  
-         height: 45px;
11  
-         right: 20px;
12  
-         padding: 0px 105px 0 15px;
13  
-         line-height: 45px;
14  
-         -moz-box-shadow: 0px 0px 8px rgb(204, 204, 204);
15  
-         -moz-border-radius-bottomleft: 15px; 
16  
-         -moz-border-radius-bottomright: 15px;
17  
-         border-bottom: 1px solid #ccc;
18  
-         border-left: 1px solid #ccc;
19  
-         border-right: 1px solid #ccc;
20  
-         background: #eee;
21  
-         z-index: 99;
22  
-       }
23  
-       </style>
24  
-    </head>
25  
-    <body>
26  
-      <div id="outer">
27  
-        <img style="float: left; margin: 14px 15px 0 0;"src="http://localhost:8080/images/status/cross.png" />
28  
-        <strong>Service:</strong> message
29  
-        </div>
30  
-      <div style="width: 65px; height: 70px; position: absolute; top: 0px; right: 45px; background: none repeat scroll 0% 0% rgb(204, 204, 204); -moz-border-radius-bottomleft: 15px; -moz-border-radius-bottomright: 15px; border-bottom: 1px solid rgb(153, 153, 153); border-left: 1px solid rgb(153, 153, 153); border-right: 1px solid rgb(153, 153, 153); -moz-box-shadow: 0px 0px 10px rgb(204, 204, 204);z-index: 9999;">
31  
-        <img src="http://localhost:8080/images/widget/yellow.png" style="width: 64px;">
32  
-      </div>
33  
-    </body>
34  
-
35  
-</html>

0 notes on commit 661b6d6

Please sign in to comment.
Something went wrong with that request. Please try again.