-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
James Herdman
committed
Apr 3, 2012
0 parents
commit 4d71392
Showing
9 changed files
with
627 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
|
||
<head> | ||
<meta charset='utf-8' /> | ||
<meta http-equiv="X-UA-Compatible" content="chrome=1" /> | ||
<meta name="description" content="Airship : A Node.js Wrapper for the UrbanAirship Push API" /> | ||
|
||
<link rel="stylesheet" type="text/css" media="screen" href="stylesheets/stylesheet.css"> | ||
|
||
<title>Airship</title> | ||
</head> | ||
|
||
<body> | ||
|
||
<!-- HEADER --> | ||
<div id="header_wrap" class="outer"> | ||
<header class="inner"> | ||
<a id="forkme_banner" href="https://github.com/jherdman/airship">Fork Me on GitHub</a> | ||
|
||
<h1 id="project_title">Airship</h1> | ||
<h2 id="project_tagline">A Node.js Wrapper for the UrbanAirship Push API</h2> | ||
|
||
<section id="downloads"> | ||
<a class="zip_download_link" href="https://github.com/jherdman/airship/zipball/master">Download this project as a .zip file</a> | ||
<a class="tar_download_link" href="https://github.com/jherdman/airship/tarball/master">Download this project as a tar.gz file</a> | ||
</section> | ||
</header> | ||
</div> | ||
|
||
<!-- MAIN CONTENT --> | ||
<div id="main_content_wrap" class="outer"> | ||
<section id="main_content" class="inner"> | ||
<h3>Use It!</h3> | ||
|
||
<div class="highlight"> | ||
<pre><span class="c1">// Taken directly from integration specs</span> | ||
|
||
<span class="kd">var</span> <span class="nx">key</span> <span class="o">=</span> <span class="s1">'myApplicationKey'</span> | ||
<span class="p">,</span> <span class="nx">secret</span> <span class="o">=</span> <span class="s1">'myApplicationSecret'</span> | ||
<span class="p">,</span> <span class="nx">airship</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">'airship'</span><span class="p">).</span><span class="nx">createAirship</span><span class="p">(</span><span class="nx">key</span><span class="p">,</span> <span class="nx">secret</span><span class="p">)</span> | ||
<span class="p">,</span> <span class="nx">deviceToken</span> <span class="o">=</span> <span class="s1">'myDeviceToken'</span> | ||
<span class="p">,</span> <span class="nx">assert</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">'assert'</span><span class="p">);</span> | ||
|
||
<span class="cm">/**</span> | ||
<span class="cm"> * Simple integration scenario:</span> | ||
<span class="cm"> *</span> | ||
<span class="cm"> * 1. Register a device with tokens</span> | ||
<span class="cm"> * 2. Remove a token</span> | ||
<span class="cm"> * 3. Add another token</span> | ||
<span class="cm"> */</span> | ||
|
||
<span class="kd">var</span> <span class="nx">regReq</span> <span class="o">=</span> <span class="nx">airship</span><span class="p">.</span><span class="nx">register</span><span class="p">(</span><span class="nx">deviceToken</span><span class="p">,</span> <span class="p">{</span> <span class="nx">tags</span><span class="o">:</span> <span class="p">[</span><span class="s1">'bacon'</span><span class="p">]</span> <span class="p">});</span> | ||
|
||
<span class="c1">// Step 1</span> | ||
<span class="nx">regReq</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s1">'success'</span><span class="p">,</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">data</span><span class="p">)</span> <span class="p">{</span> | ||
<span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">'Successfully registered device'</span><span class="p">);</span> | ||
|
||
<span class="c1">// Step 2</span> | ||
<span class="kd">var</span> <span class="nx">remTokReq</span> <span class="o">=</span> <span class="nx">airship</span><span class="p">.</span><span class="nx">removeTag</span><span class="p">(</span><span class="s1">'bacon'</span><span class="p">);</span> | ||
|
||
<span class="nx">remTokReq</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s1">'success'</span><span class="p">,</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">data</span><span class="p">)</span> <span class="p">{</span> | ||
<span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">'Successfully removed tag from device'</span><span class="p">);</span> | ||
|
||
<span class="c1">// Step 3</span> | ||
<span class="kd">var</span> <span class="nx">addTokReq</span> <span class="o">=</span> <span class="nx">airship</span><span class="p">.</span><span class="nx">addTag</span><span class="p">(</span><span class="s1">'waffles'</span><span class="p">);</span> | ||
|
||
<span class="nx">addTokReq</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s1">'success'</span><span class="p">,</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">data</span><span class="p">)</span> <span class="p">{</span> | ||
<span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">'Successfully added another token'</span><span class="p">);</span> | ||
<span class="p">});</span> | ||
|
||
<span class="nx">addTokReq</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s1">'fail'</span><span class="p">,</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">err</span><span class="p">)</span> <span class="p">{</span> | ||
<span class="nx">console</span><span class="p">.</span><span class="nx">error</span><span class="p">(</span><span class="s1">'Failed to add another token'</span><span class="p">);</span> | ||
<span class="nx">assert</span><span class="p">.</span><span class="nx">ifError</span><span class="p">(</span><span class="nx">err</span><span class="p">);</span> | ||
<span class="p">});</span> | ||
<span class="p">});</span> | ||
|
||
<span class="nx">remTokReq</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s1">'fail'</span><span class="p">,</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">err</span><span class="p">)</span> <span class="p">{</span> | ||
<span class="nx">console</span><span class="p">.</span><span class="nx">error</span><span class="p">(</span><span class="s1">'Failed to remove tag'</span><span class="p">);</span> | ||
<span class="nx">assert</span><span class="p">.</span><span class="nx">ifError</span><span class="p">(</span><span class="nx">err</span><span class="p">);</span> | ||
<span class="p">});</span> | ||
<span class="p">});</span> | ||
|
||
<span class="nx">regReq</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s1">'fail'</span><span class="p">,</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">err</span><span class="p">)</span> <span class="p">{</span> | ||
<span class="nx">console</span><span class="p">.</span><span class="nx">error</span><span class="p">(</span><span class="s1">'Failed to register device'</span><span class="p">);</span> | ||
<span class="nx">assert</span><span class="p">.</span><span class="nx">ifError</span><span class="p">(</span><span class="nx">err</span><span class="p">);</span> | ||
<span class="p">});</span> | ||
</pre> | ||
</div> | ||
|
||
|
||
<h3>Authors and Contributors</h3> | ||
|
||
<ul> | ||
<li><a href="/jherdman" class="user-mention">@jherdman</a></li> | ||
<li><a href="/samyakbhuta" class="user-mention">@samyakbhuta</a></li> | ||
</ul><h3>Support or Contact</h3> | ||
|
||
<p>File a <a href="https://github.com/jherdman/airship/issues">bug ticket</a> or submit a <a href="https://github.com/jherdman/airship/pulls">pull request</a>.</p> | ||
</section> | ||
</div> | ||
|
||
<!-- FOOTER --> | ||
<div id="footer_wrap" class="outer"> | ||
<footer class="inner"> | ||
<p class="copyright">Airship maintained by <a href="https://github.com/jherdman">jherdman</a></p> | ||
<p>Published with <a href="http://pages.github.com">GitHub Pages</a></p> | ||
</footer> | ||
</div> | ||
|
||
<script type="text/javascript"> | ||
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); | ||
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); | ||
</script> | ||
<script type="text/javascript"> | ||
try { | ||
var pageTracker = _gat._getTracker("<script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-15700208-3']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script>"); | ||
pageTracker._trackPageview(); | ||
} catch(err) {} | ||
</script> | ||
|
||
|
||
</body> | ||
</html> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
console.log('This would be the main JS file.'); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"name":"Airship","body":"### Use It!\r\n\r\n```javascript\r\n// Taken directly from integration specs\r\n\r\nvar key = 'myApplicationKey'\r\n , secret = 'myApplicationSecret'\r\n , airship = require('airship').createAirship(key, secret)\r\n , deviceToken = 'myDeviceToken'\r\n , assert = require('assert');\r\n\r\n/**\r\n * Simple integration scenario:\r\n *\r\n * 1. Register a device with tokens\r\n * 2. Remove a token\r\n * 3. Add another token\r\n */\r\n\r\nvar regReq = airship.register(deviceToken, { tags: ['bacon'] });\r\n\r\n// Step 1\r\nregReq.on('success', function (data) {\r\n console.log('Successfully registered device');\r\n\r\n // Step 2\r\n var remTokReq = airship.removeTag('bacon');\r\n\r\n remTokReq.on('success', function (data) {\r\n console.log('Successfully removed tag from device');\r\n\r\n // Step 3\r\n var addTokReq = airship.addTag('waffles');\r\n\r\n addTokReq.on('success', function (data) {\r\n console.log('Successfully added another token');\r\n });\r\n\r\n addTokReq.on('fail', function (err) {\r\n console.error('Failed to add another token');\r\n assert.ifError(err);\r\n });\r\n });\r\n\r\n remTokReq.on('fail', function (err) {\r\n console.error('Failed to remove tag');\r\n assert.ifError(err);\r\n });\r\n});\r\n\r\nregReq.on('fail', function (err) {\r\n console.error('Failed to register device');\r\n assert.ifError(err);\r\n});\r\n```\r\n\r\n### Authors and Contributors\r\n\r\n* @jherdman\r\n* @samyakbhuta\r\n\r\n### Support or Contact\r\n\r\nFile a [bug ticket](https://github.com/jherdman/airship/issues) or submit a [pull request](https://github.com/jherdman/airship/pulls).","tagline":"A Node.js Wrapper for the UrbanAirship Push API","google":"<script type=\"text/javascript\"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-15700208-3']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script>","note":"Don't delete this file! It's used internally to help with page regeneration."} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
.highlight .hll { background-color: #ffffcc } | ||
.highlight { background: #f0f3f3; } | ||
.highlight .c { color: #0099FF; font-style: italic } /* Comment */ | ||
.highlight .err { color: #AA0000; background-color: #FFAAAA } /* Error */ | ||
.highlight .k { color: #006699; font-weight: bold } /* Keyword */ | ||
.highlight .o { color: #555555 } /* Operator */ | ||
.highlight .cm { color: #0099FF; font-style: italic } /* Comment.Multiline */ | ||
.highlight .cp { color: #009999 } /* Comment.Preproc */ | ||
.highlight .c1 { color: #0099FF; font-style: italic } /* Comment.Single */ | ||
.highlight .cs { color: #0099FF; font-weight: bold; font-style: italic } /* Comment.Special */ | ||
.highlight .gd { background-color: #FFCCCC; border: 1px solid #CC0000 } /* Generic.Deleted */ | ||
.highlight .ge { font-style: italic } /* Generic.Emph */ | ||
.highlight .gr { color: #FF0000 } /* Generic.Error */ | ||
.highlight .gh { color: #003300; font-weight: bold } /* Generic.Heading */ | ||
.highlight .gi { background-color: #CCFFCC; border: 1px solid #00CC00 } /* Generic.Inserted */ | ||
.highlight .go { color: #AAAAAA } /* Generic.Output */ | ||
.highlight .gp { color: #000099; font-weight: bold } /* Generic.Prompt */ | ||
.highlight .gs { font-weight: bold } /* Generic.Strong */ | ||
.highlight .gu { color: #003300; font-weight: bold } /* Generic.Subheading */ | ||
.highlight .gt { color: #99CC66 } /* Generic.Traceback */ | ||
.highlight .kc { color: #006699; font-weight: bold } /* Keyword.Constant */ | ||
.highlight .kd { color: #006699; font-weight: bold } /* Keyword.Declaration */ | ||
.highlight .kn { color: #006699; font-weight: bold } /* Keyword.Namespace */ | ||
.highlight .kp { color: #006699 } /* Keyword.Pseudo */ | ||
.highlight .kr { color: #006699; font-weight: bold } /* Keyword.Reserved */ | ||
.highlight .kt { color: #007788; font-weight: bold } /* Keyword.Type */ | ||
.highlight .m { color: #FF6600 } /* Literal.Number */ | ||
.highlight .s { color: #CC3300 } /* Literal.String */ | ||
.highlight .na { color: #330099 } /* Name.Attribute */ | ||
.highlight .nb { color: #336666 } /* Name.Builtin */ | ||
.highlight .nc { color: #00AA88; font-weight: bold } /* Name.Class */ | ||
.highlight .no { color: #336600 } /* Name.Constant */ | ||
.highlight .nd { color: #9999FF } /* Name.Decorator */ | ||
.highlight .ni { color: #999999; font-weight: bold } /* Name.Entity */ | ||
.highlight .ne { color: #CC0000; font-weight: bold } /* Name.Exception */ | ||
.highlight .nf { color: #CC00FF } /* Name.Function */ | ||
.highlight .nl { color: #9999FF } /* Name.Label */ | ||
.highlight .nn { color: #00CCFF; font-weight: bold } /* Name.Namespace */ | ||
.highlight .nt { color: #330099; font-weight: bold } /* Name.Tag */ | ||
.highlight .nv { color: #003333 } /* Name.Variable */ | ||
.highlight .ow { color: #000000; font-weight: bold } /* Operator.Word */ | ||
.highlight .w { color: #bbbbbb } /* Text.Whitespace */ | ||
.highlight .mf { color: #FF6600 } /* Literal.Number.Float */ | ||
.highlight .mh { color: #FF6600 } /* Literal.Number.Hex */ | ||
.highlight .mi { color: #FF6600 } /* Literal.Number.Integer */ | ||
.highlight .mo { color: #FF6600 } /* Literal.Number.Oct */ | ||
.highlight .sb { color: #CC3300 } /* Literal.String.Backtick */ | ||
.highlight .sc { color: #CC3300 } /* Literal.String.Char */ | ||
.highlight .sd { color: #CC3300; font-style: italic } /* Literal.String.Doc */ | ||
.highlight .s2 { color: #CC3300 } /* Literal.String.Double */ | ||
.highlight .se { color: #CC3300; font-weight: bold } /* Literal.String.Escape */ | ||
.highlight .sh { color: #CC3300 } /* Literal.String.Heredoc */ | ||
.highlight .si { color: #AA0000 } /* Literal.String.Interpol */ | ||
.highlight .sx { color: #CC3300 } /* Literal.String.Other */ | ||
.highlight .sr { color: #33AAAA } /* Literal.String.Regex */ | ||
.highlight .s1 { color: #CC3300 } /* Literal.String.Single */ | ||
.highlight .ss { color: #FFCC33 } /* Literal.String.Symbol */ | ||
.highlight .bp { color: #336666 } /* Name.Builtin.Pseudo */ | ||
.highlight .vc { color: #003333 } /* Name.Variable.Class */ | ||
.highlight .vg { color: #003333 } /* Name.Variable.Global */ | ||
.highlight .vi { color: #003333 } /* Name.Variable.Instance */ | ||
.highlight .il { color: #FF6600 } /* Literal.Number.Integer.Long */ | ||
|
||
.type-csharp .highlight .k { color: #0000FF } | ||
.type-csharp .highlight .kt { color: #0000FF } | ||
.type-csharp .highlight .nf { color: #000000; font-weight: normal } | ||
.type-csharp .highlight .nc { color: #2B91AF } | ||
.type-csharp .highlight .nn { color: #000000 } | ||
.type-csharp .highlight .s { color: #A31515 } | ||
.type-csharp .highlight .sc { color: #A31515 } |
Oops, something went wrong.