Documentation

Jasdev Singh edited this page Jun 6, 2013 · 10 revisions

Welcome to the Snapgraph repository!

This 36-hour hack is brought to you by David Hu, Nishant Shukla and Jasdev Singh from Pennapps Spring 2013. In this wiki, you can find an overview of our stack, local install instructions, and documentation on our public endpoints.


Overview of the stack

Snapgraph is built on Node.js running on Heroku. We used MongoDB, a NoSQL schema-less database, as our backend. For our template engine, we used EJS with a custom front-end backed by Twitter's Bootstrap. Lastly, to scrape SnapChat's site, we used node.io, which in turn is used to populate our DB by periodically refreshing it as the data becomes stale.

Local install

To run locally, the required dependencies are listed in package.json but the major components include MongoDB, foreman, and node.js. Clone the repo and run npm install. To launch a local instance of the platform, set up a local mongodb database by running mkdir ~/db; mongod --dbpath ~/db. Finally do foreman start to launch the site.

API Endpoint Documentation

You can also make calls to our publicly-available API to get relevant Snapchat information about a particular user.

Base URL: http://www.snapgraph.me

/getuser

  • Parameters (required) ?u=[username]
  • Output: Sample out
  • Notes: Pulls directly from DB unless data is over 20 hours old or currently not in our datastore. In the latter cases, the data is directly scraped.

/leaderboard

  • Parameters, none
  • Output: Sample out
  • Notes: Top 10 users and associated scores currently in our DB

/link

  • Parameters (required) ?u1=[username1]&u2=[username2]
  • Output: Sample out
  • Notes: Provides an ordered list that transverses from user1 -> user2

Notes

Please fork! We built this within 36 hours over the course of a weekend, so we would love for you all to help improve the repo, make it more robust, or help fix the many issues that went unattended to as we hacked away this past few days!

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.