Find The Hype API

Matthew Faltys 1bdde59a82 Add error recovery on twitter API throttle 3 years ago
deps 082b5c1fff Rework readme 3 years ago
fthbitnuke 1d56baedaa Add documentation to bitnuke package 3 years ago
fthimgur 6ccc8a9166 Add fthimgur package documentation 3 years ago
fthlogger fcadcba766 Add fthlogger package documentation 3 years ago
fthtwitter 1bdde59a82 Add error recovery on twitter API throttle 3 years ago
.drone.yml 2aa17b6bff Add symlink package task to makefile 3 years ago
.gitignore a87d591d12 integration testing and bug fixes 3 years ago
Makefile 2aa17b6bff Add symlink package task to makefile 3 years ago
fth.go 2aa17b6bff Add symlink package task to makefile 3 years ago
readme.md c6e910376a Fix image layer badge 3 years ago

readme.md

Find the Hype

fth.io is an API designed to be consumable. This API will return the top list of trends from twitter and cross reference with an image from imgur. Our developers are not front-end guys so the API is the main focus of this process. Below is usage of the service and how to build it yourself. This project is the backend only, with a simple webpage to invoke the application. The html file is found at deps/fth.html

Usage

  • fth.io is a consumable webservice. It can be consumed from the endpoint fth.io. The REST service takes the following requests:

    • GET fth.io/hype this will return a top list of hype with their respective image links.
    • GET fth.io/trend this will return a top list of trends only.
    • GET fth.io/image this will return a top list of image links to top trends.
    • GET fth.io/help this will return a help message of usage.
  • fth.io will also return a special header X-hype that is set to the number of hype returned. This is usefull if the invoking application is dynamic and needs to know the amount of hype to format correctly. The number of hype returned by default is 10, but can be set to any number <= 50

Building from source

  • dependencies:
    To build from source you will have to have a couple of go packages on your box. To pull these run:
    go get github.com/gorilla/mux
    go get github.com/UNO-ISQA-4380/group-5-project
    go get github.com/ChimeraCoder/anaconda
    go get bitbucket.org/liamstask/go-imgur/imgur
    In addition to these packages, you will need the credentials in the root of the project, the directory name will be auth. Details on this can be found below

Running FTH server

  • We use the very portable unix make to build
  • Supported commands:
    • make will build a dynamically compiled go binary
    • make stat will build a statically compiled go binary
    • make run will run the go app for testing/debugging
    • make install will install the app to /usr/bin
    • make clean will clean any binaries

API Credentials

  • Credentials go in creds/twitter, creds/imgur respectively

  • Twitter: to use the twitter api you must provide credentials in the following format:

    • line 1) OAuth consumer key
    • line 2) OAuth consumer secret
    • line 3) OAuth access token
    • line 4) OAuth access token secret
  • Imgur

    • line 1) OAuth consumer key
    • line 2) OAuth consumer secret