About

Sunshine is an unoffical API for The Overcast Network's website. This API is made by VesterRex and Jake_0. 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 node.js.



Installing

1. Install redis and NodeJS.

2. Run npm install.

3.Start redis and run npm start.


Documentation

Pagnation

To retrive a specific page of something use the follow parameter:

?page=page_number

For example this link will get me the 2nd page of the What's New forum category.

{{domain}}/forums/new?page=2

Stats,Forum Topics,Forum Categories,Teams,Punishments.


Id

Some modules use ids to retrive information. The id in this case is a MongoDB hash. An id looks something like this.

557e21685f35b92506006f9e

Authorization Dependent Modules

Friends
{{domain}}
Forum Post
{{domain}}/
Alerts
{{domain}}/

Non-Authorization Dependent Modules

Stats

By default the stats module will return top kills in the last 24 hours in all gamemodes.

{{domain}}/stats

Stats has three parameters time, game, and, sort.

This example retrives the top stats on wool captures for the past week in all gametypes.

{{domain}}/stats/?time=week&game=all&sort=wool_placed

All the properties for the three parameters are down below.

Parameter Properties
time day, week, eternity
game all, projectares, ghostsquadron
sort kills, deaths, kd, kk, cores_leaked, wool_placed, destroyed_destroyables, playing_time

Player Information

To find a specific player's stats and information use the following format below.

{{domain}}/players/Username

For example, the code below will retrive the player information for the player Cubist.

{{domain}}/players/Cubist

Teams

Specify a team's name to retrive their information.

{{domain}}/teams/name

Not specifing a team will retrive a list of all the teams.

{{domain}}/teams

The following link will retrive information for the team Drifters.

{{domain}}/teams/Drifters

Tournaments

To obtain a list of all tournaments do not specify a tournament.

{{domain}}/tournaments

For example, this snippet will parse the tournament Attack of the Cores.

{{domain}}/tournaments/attack-of-the-cores

Remeber to use '-' instead of spaces when dealing with tournaments.


Forum Topics

To get a specifc forum topic you are going to need the thread's id. Please refer to theid part of this Documentation.

{{domain}}/forums/topics/id

For example, this will get you the topic Awesome Music Thread.

{{domain}}/forums/topics/50494e68b944ec59bc00596c
br>
Forum Categories

Specifying nothing except for what is below will return all* the categories of the forums and their ids.

{{domain}}/forums
* does not return private categories

Giving an id will give you the first page of the forum category specified.

{{domain}}/forums/id

This example will return the first page of the forum category Announcements.

{{domain}}/forums/4fc17119c463751492000018

Finally, using the keyword new will return the front page of the What's New category; the most recent posts.

{{domain}}/forums/new

Punishments

To retrive a list of the most recent punishments use:

{{domain}}/punishments

If you want to retrive a specific punsihment use its id.

{{domain}}/punishments/id