Giter Site home page Giter Site logo

cloudify's Introduction

Cloudify

Cloudify is a web based application that creates word clouds from Twitter timelines. Just enter a user's Twitter handle and watch as a hella-fly Tweet cloud materialises.

Visit the deployed version and cloudify to your heart's content.

(Please scroll down for instructions on running the app locally and notes on my approach to the project.)

Imgur

Imgur

Development setup

Running the app

Clone the repository from GitHub:

$ git clone https://github.com/AbigailMcP/cloudify.git

Enter your new project folder:

$ cd cloudify

Create a .env file and update with your own Twitter keys. You will need to set up a Twitter app to get your own credentials.

CONSUMER_KEY=your_consumer_key
CONSUMER_SECRET=your_consumer_secret
ACCESS_TOKEN=your_access_token
ACCESS_TOKEN_SECRET=your_access_token_secret

Install all the dependencies from the Gemfile using Bundler:

$ bundle install

Run the Rails server:

$ rails s

Running tests

Run tests using RSpec:

$ rspec

Notes on approach

Back-end

I used Rails to build this app in order to get it set up quickly and easily. To begin with, I had a WordCloud model, and used the Rails provided 'resources' to arrange my routes. However, I soon came to realise that my database was redundant - I didn't need to store any of the information from the Twitter API, it only needed to persist between the POST route (/cloud) and the GET route (/show_cloud).

Taking this into account, I decided to migrate my model across to a /lib class. This contains all the logic needed to provide my front end with a hash of words and their corresponding frequencies.

This gave me a couple of issues when deploying to Heroku - namely that my file in /lib was not being loaded. I got around this by requiring the file in wordclouds_controller.rb, however wonder whether there is a better way to achieve the same outcome.

Front-end

I created wordcloud_helper.rb to store the logic relating to the css classes. This helper method effectively chooses the right css class for each word depending on their 'weight', ie their frequency compared to the most frequent.

As this is presentational logic only, I decided it was not the responsibility of the WordCloud class.

To do

  • Error handling for invalid username - done
  • Button on cloud page linking back to homepage - done
  • Snazzy Favicon! - done
  • Option to change colour of word cloud - OUTSTANDING
  • Remove double @@ in cloud page if user enters @username - OUTSTANDING

cloudify's People

Contributors

abigailmcp avatar jalada 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.