GithubHelp home page GithubHelp logo

social's Introduction

Social Networking API

Service exposing API that aggregates over third party Social Networking APIs such as Facebook and Twitter. Though as a demo the interactions with these third parties are stubbed.

Installation Requirements

SBT/Scala setup. Firstly you will need homebrew:

$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Install JDK (Java)
  • Install sbt (Scala)
$ brew install homebrew/cask/java
$ brew cask info java
$ brew install sbt
$ brew info sbt

To "get the code" we need git.

$ brew install git

And then clone this repository:

$ git clone https://github.com/davidainslie/social.git

Finally, for manually testing install httpie, though you can of course use curl but it's not as nice:

$ brew install httpie

Scala

Test

$ sbt test

Run

$ sbt run

However run in this case expects to interact with actual third party (backend) APIs, so instead we can run with stubs:

$ sbt test:run

API

Story:

Given a social network name Facebook
And a full Facebook graph
Return count of people with no relationships

From the command line:

$ http http://localhost:8080/relationships/facebook
HTTP/1.1 200 OK
Content-Length: 9
Content-Type: application/json
Date: Mon, 16 Dec 2019 09:59:33 GMT

[
    "Harry"
]

Story:

Given a person name Peter
And a Facebook graph for Peter
And a Twitter graph for Peter
Return count of relationships of 1 degree + count of relationships of 2 degree

From the command line:

http http://localhost:8080/relationships/Peter
HTTP/1.1 200 OK
Content-Length: 44
Content-Type: application/json
Date: Mon, 16 Dec 2019 11:48:58 GMT

{
    "firstDegreeCount": 3,
    "secondDegreeCount": 0
}

social's People

Contributors

davidainslie avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.