Giter Site home page Giter Site logo

nerd_apis's Introduction

Unofficial Nerd APIs

In the Wild

The example application in the example_app directory hits all 3 of these API's locally and displays the link. There is a tutorial on getting the basic functionality included in the README. In order to just get it to run, do the following:

bundle

bundle exec volt s

And navigate to localhost:3000

Volt Application

Structure

lib/scraper.rb

This is intended to incapsulate the scraper for each site being API-ified

lib/apis.rb

The module containing each individual API. The goal of this module/its classes is to have a minimal LOC setup for the APIs made.

lib/stories.rb

This wraps the JSON that we hope to return in a Rubyish OO manner for maximum separation from the business logic of the scraping operations performed

server.rb

This contains the server itself, a simple sinatra/rack application

Routes

/lobsters/frontpage/:page GET

/lobsters/recent/:page GET

/proggit GET

/datatau GET

/reddit GET

Usage

$ bundle install #in route directory
$ cd example_app
$ bundle

Now that you have bundle installed both applications, start the sinatra server and the volt server:

$ bundle exec ruby server.rb
$ cd example_app
$ bundle exec volt s

Todos

  • Better response codes + routing/error handling
  • Utilize Mechanize's cookie jar to get the cookie that can filter displayed stories
  • View comments
  • Allow user login and profile updating
  • Mock tests with VCR or webmock (simpler alternative)
  • (and much more)

Contributing

  1. Fork, and make a branch
  2. Code!
  3. Test!
  4. PR!

nerd_apis's People

Contributors

nicholasjv avatar ybur-yug avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

al2o3cr

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.