Instantly share code, notes, and snippets.
          Created
          July 25, 2015 09:02 
        
      - 
            
      
        
      
    Star
      
          0
          (0)
      
  
You must be signed in to star a gist  - 
              
      
        
      
    Fork
      
          0
          (0)
      
  
You must be signed in to fork a gist  
- 
        
Save Szboy/62e3347b22b6baaa8736 to your computer and use it in GitHub Desktop.  
  
    
      This file contains hidden or 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
    
  
  
    
  | <main> | |
| <div class="container"> | |
| <div class="text-left"> | |
| <div id="about"> | |
| <h5 style="font-size:22px">About</h5> | |
| <hr style="height:1px;border:none;color:#626262;background-color:#626262;"> | |
| <p>Sunshine is an unoffical API for The Overcast Network's <a href="http://oc.tc">website</a>. This API is made by <a href="http://github.com/gilrosenthal/">VesterRex</a> and <a href="http://github.com/Jake0oo0">Jake_0</a>. The API uses a technique called "web scraping" to retrive information on oc.tc such as stats, fourm posts and, tournament teams. The API then posts the data in a JSON format. It also has a thread and comment posting feature. Sunshine is written in <a href="https://nodejs.org/">node.js</a>.</p><br> | |
| </div> | |
| </div> | |
| </div> | |
| <div id="contr"> | |
| <div class="text-left container"> | |
| <h5 style="font-size:22px">Contirbutors</h5> | |
| <hr style="height:1px;border:none;color:#626262;background-color:#626262;"> | |
| <div style="font-size:16px" class="row"> | |
| <div class="col-md-3"> | |
| <div class="thumbnail"> | |
| <a href="https://oc.tc/VesterRex"><img src="https://crafatar.com/avatars/0401f604541c4b288e7ee0679c454f2c?helm"> | |
| <div class="caption"> | |
| <h3>VesterRex</h3> | |
| <br> | |
| <p>Initial idea, Development</p> | |
| </div> | |
| </div></a> | |
| </div> | |
| <div class="col-md-3"> | |
| <div class="thumbnail" > | |
| <a href="https://oc.tc/Jake_0"><img src="https://crafatar.com/avatars/2d5aa9cdaeb049189930461fc9b91cc5?helm"> | |
| <div class="caption"> | |
| <h3>Jake_0</h3> | |
| <br> | |
| <p>Development, Code Cleanup</p> | |
| </div> | |
| </div></a> | |
| </div> | |
| <div class="col-md-3"> | |
| <div class="thumbnail" title="Hosting, Documentation"> | |
| <a href="https://oc.tc/Jacub"><img src="https://crafatar.com/avatars/149cf470051a49b99ab0e731a8d20f8e?helm"> | |
| <div class="caption"> | |
| <h3>Jacub</h3> | |
| <br> | |
| <p>Hosting, Documentation</p> | |
| </div> | |
| </div></a> | |
| </div> | |
| <div class="col-md-3"> | |
| <div class="thumbnail" title="Feedback, Documentation"> | |
| <a href="https://oc.tc/szboy"><img src="https://crafatar.com/avatars/94812eb711604db4b349c2eac0792218?helm"> | |
| <div class="caption"> | |
| <h3>Szboy</h3> | |
| <br> | |
| <p>Logo, Documentation</p> | |
| </div> | |
| </div></a> | |
| </div> | |
| </div> | |
| <p class="text-left" style="font-style: italic">For everyone who contributed, small or large, please check <a href="https://github.com/gilrosenthal/OvercastAPI/graphs/contributors">here</a></p> | |
| </div> | |
| <br> | |
| <div class="container"> | |
| <div id="install"> | |
| <div class="text-left"> | |
| <h5 style="font-size:22px">Installing</h5> | |
| <hr style="height:1px;border:none;color:#626262;background-color:#626262;"> | |
| <p>1. <strong>Install</strong> <a href="http://redis.io">redis</a> and <a href="http://nodejs.org">NodeJS</a>.</p> | |
| <p>2. <strong>Run</strong> <code>npm install</code>.</p> | |
| <p>3.<strong>Start</strong> redis and run <code>npm start</code>.</p><br> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <div id="docs" class="container"> | |
| <h5 style="font-size:22px">Documentation</h5> | |
| <hr style="height:1px;border:none;color:#626262;background-color:#626262;"> | |
| <h6 style="font-size:20px">Pagnation</h6> | |
| <br> | |
| <div class="docs"> | |
| <p class="note">To retrive a specific page of something use the follow parameter:</p> | |
| <div class="code">?page=<mark>page_number</mark></div> | |
| <p class="note">For example this link will get me the 2nd page of the What's New forum category.</p> | |
| <div class="code">{{domain}}/forums/new?page=2</div> | |
| <p class="notes"The following modules use pages <mark>Stats</mark>,<mark>Forum Topics</mark>,<mark>Forum Categories</mark>,<mark>Teams</mark>,<mark>Punishments</mark>.</p> | |
| </div> | |
| <br> | |
| <h6 style="font-size:20px">Id</h6> | |
| <br> | |
| <div class="docs"> | |
| <p class="note">Some modules use ids to retrive information. The id in this case is a <a href="//www.mongodb.org">MongoDB</a> hash. An id looks something like this.</p> | |
| <div class="code"><mark>557e21685f35b92506006f9e</mark></div> | |
| </div> | |
| <br> | |
| <h6 style="font-size:20px">Authorization Dependent Modules</h6> | |
| <br> | |
| <div class="docs"> | |
| <h6 class="docs-header">Friends</h6> | |
| <div class="code">{{domain}}</div> | |
| <h6 class="docs-header">Forum Post</h6> | |
| <div class="code">{{domain}}/</div> | |
| <h6 class="docs-header">Alerts</h6> | |
| <div class="code">{{domain}}/</div> | |
| </div> | |
| <br> | |
| <h6 style="font-size:20px">Non-Authorization Dependent Modules</h6> | |
| <br> | |
| <div class="docs"> | |
| <h6 class="docs-header">Stats</h6> | |
| <p class="note">By default the stats module will return top kills in the last 24 hours in all gamemodes.</p> | |
| <div class="code">{{domain}}/stats</div> | |
| <p class="note">Stats has three parameters <mark>time</mark>, <mark>game</mark>, and, <mark>sort</mark>.</p> | |
| <p class="note">This example retrives the top stats on wool captures for the past week in all gametypes.</p> | |
| <div class="code">{{domain}}/stats/?time=week&game=all&sort=wool_placed</div> | |
| <p class="note">All the properties for the three parameters are down below.</p> | |
| <table class="table"> | |
| <thead> | |
| <tr> | |
| <td>Parameter</td> | |
| <td>Properties</td> | |
| </tr> | |
| </thead> | |
| <tbody> | |
| <tr> | |
| <td>time</td> | |
| <td>day, week, eternity</td> | |
| </tr> | |
| <tr> | |
| <td>game</td> | |
| <td>all, projectares, ghostsquadron</td> | |
| </tr> | |
| <tr> | |
| <td>sort</td> | |
| <td>kills, deaths, kd, kk, cores_leaked, wool_placed, destroyed_destroyables, playing_time</td> | |
| </tr> | |
| </tbody> | |
| </table> | |
| <br> | |
| <h6 class="docs-header">Player Information</h6> | |
| <p class="note">To find a specific player's stats and information use the following format below.</p> | |
| <div class="code">{{domain}}/players/<mark>Username</mark></div> | |
| <p class="note">For example, the code below will retrive the player information for the player <ahref="//oc.tc/Cubist">Cubist</a>.</p> | |
| <div class="code">{{domain}}/players/<mark>Cubist</mark></div> | |
| <br> | |
| <h6 class="docs-header">Teams</h3> | |
| <p class="note">Specify a team's name to retrive their information.</p> | |
| <div class="code">{{domain}}/teams/<mark>name</mark></div> | |
| <p class="note">Not specifing a team will retrive a list of all the teams.</p> | |
| <div class="code">{{domain}}/teams</div> | |
| <p class="note">The following link will retrive information for the team <mark>Drifters.</mark></p> | |
| <div class="code">{{domain}}/teams/<mark>Drifters</mark></div> | |
| <br> | |
| <h6 class="docs-header">Tournaments</h6> | |
| <p class="note">To obtain a list of all tournaments do not specify a tournament.</p> | |
| <div class="code">{{domain}}/tournaments</div> | |
| <p class="note">For example, this snippet will parse the tournament <mark>Attack of the Cores.</mark></p> | |
| <div class="code">{{domain}}/tournaments/<mark>attack-of-the-cores</mark></div> | |
| <p class><strong class="text-success">Remeber</strong> to use '-' instead of spaces when dealing with tournaments.</p> | |
| <br> | |
| <h6 class="docs-header">Forum Topics</h6> | |
| <p class="note">To get a specifc forum topic you are going to need the thread's <mark>id</mark>. Please refer to the<mark>id</mark> part of this Documentation.</p> | |
| <div class="code">{{domain}}/forums/topics/<mark>id</mark></div> | |
| <p class="note">For example, this will get you the topic <ahref="https://oc.tc/forums/topics/50494e68b944ec59bc00596c">Awesome Music Thread.</a></p> | |
| <div class="code">{{domain}}/forums/topics/<mark>50494e68b944ec59bc00596c</mark></div> | |
| br> | |
| <h6 class="docs-header">Forum Categories</h6> | |
| <p class="note">Specifying nothing except for what is below will return all* the categories of the forums and their ids.</p> | |
| <div class="code">{{domain}}/forums</div> | |
| <h6>* does not return private categories</h6> | |
| <p class="note">Giving an id will give you the first page of the forum category specified.</p> | |
| <div class="code">{{domain}}/forums/<mark>id</mark></div> | |
| <p class="note">This example will return the first page of the forum category <mark>Announcements</mark>.</p> | |
| <div class="code">{{domain}}/forums/<mark>4fc17119c463751492000018</mark></div> | |
| <p class="note">Finally, using the keyword <mark>new</mark> will return the front page of the What's New category; the most recent posts.</p> | |
| <div class="code">{{domain}}/forums/<mark>new</mark></div> | |
| <br> | |
| <h6 class="docs-header">Punishments</h6> | |
| <p class="note">To retrive a list of the most recent punishments use:</p> | |
| <div class="code">{{domain}}/punishments</div> | |
| <p class="docs-note">If you want to retrive a specific punsihment use its <mark>id</mark>.</p> | |
| <div class="code">{{domain}}/punishments/<mark>id</mark></div> | |
| </div> | |
| </div> | |
| </main> | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment