GithubHelp home page GithubHelp logo

bandyg / robinhoops Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sirivatd/robinhoops

0.0 0.0 0.0 456 KB

A web-based game that appeals to both fantasy sport junkies and Wall Street traders who want to bet on professional athletes

JavaScript 53.66% Ruby 27.21% CSS 16.31% HTML 2.82%

robinhoops's Introduction

Robinhoops

Live Site

Robinhoops is a Robinhood.com clone built with Rails and React/Redux that allows users to invest in the top NBA athletes.

Alt text

Athletes' prices are updated every few seconds based on their stats and recent overall Twitter sentiment.

Twitter Sentiment

Credit to sentimental gem Robinhoops scrapes Twitter for recent tweets and then maps each word and assigns an overall score based on each tweet.

Using Nokogiri and HTTParty

    def self.scrape_tweeter(athlete_name)
        names = athlete_name.split(" ")
        firstName = names[0]
        lastName = names[1]
       url = "https://twitter.com/search?q=" + lastName + "%20" + firstName + "&src=typd"

       unparsed_page = HTTParty.get(url)
       parsed_page = Nokogiri::HTML(unparsed_page)

       tweetDivs = parsed_page.css('div.tweet')

       scrappedTweets = []
       tweetDivs.each do |div|
        tweetBody = div.css('p.TweetTextSize.js-tweet-text.tweet-text').text
        tweetUsername = div.css("span.username").text
        tweetTimestamp = div.css("span._timestamp").text
        scrappedTweets.push({tweetBody: tweetBody, tweetUsername: tweetUsername, time_created: tweetTimestamp})
    end

       return $analyzer.score scrappedTweets
    end

How it Works

All new users receive $2000.00 and a free stock/athlete.

To be really specific, Robinhoops creates a new user and then store snapshots of portfolio value and twitter sentiment every 20 seconds. These data points are then used to graph stock and user portfolio value volatility. An athlete's price will only fluctuate if users on trading that specific stock.

Alt text

Usage

First, install bundles

$ bundle install

Install node dependencies

$ npm install

Start local rails server

$ rails server

Credits

The following packages/libraries were used in the development of Robinhoops.io

robinhoops's People

Contributors

sirivatd 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.