Skip to content

jalada/cloudify

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

82 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 77.3%
  • HTML 14.5%
  • SCSS 5.6%
  • JavaScript 2.2%
  • CoffeeScript 0.4%