GithubHelp home page GithubHelp logo

soapbox's Introduction

SoapBox

A command-line based social media platform to share short thoughts via synced file systems.

In this project we are going to use object oriented ruby to read and write files, each file will be a post in our social media platform. We will use Dropbox to automatically sync these files across our computers. The files will contain three pieces of information:

  1. Post body: This is the file name (with spaces and no file extension)
  2. Created at: This is the system created at time.
  3. Author: This will be stored in the body of the file

These three things make up a single post. All of the posts will be stored in a shared dropbox directory called Soapbox

Base Requirements

Create a Bubble class which is like a social media post (think tweet or facebook post)

  1. Include the following attributes:
  • username : A persons username such as @bookis
  • body : The body of the post
  • created_at : The time the post was created
  1. Use a Hash to initialize the attributes with values
  2. Add methods or attr_accessor to get and set all of the attributes

Create a seperate file called app.rb. Use require_relative 'bubble' at the top of the file to include the code from your bubble class (this is no different than having the code written in this spot). When the script is run from the terminal with ruby app.rb, it will:

  1. Ask for a username
  2. Ask for the body of a Bubble
  3. Create a Bubble instance using that information (with created_at being Time.now)
  4. Add the bubble instance to an Array
  5. Print out the details of each bubble.
  6. Start over at step 2.

Social Media

We will all be creating our own clients to read and post to the social media platform from the command line.

  • Add the dropbox app for os x.
  • Get added to the shared Soapbox directory from bookis
  • Update app.rb to run from the terminal using ruby app.rb. This file will:
    • Read all of the files in your Soapbox directory, sort them by created at time
      • Use the Bubble class to create objects which represent each post.
      • print out each file with the body, author, and time
    • Ask if you'd like to make a new post
      • Ask for your username
      • Ask for a new post
      • Write a file with the post as the file name and username as the body of the file

Extended Requirements

  • Use the colorize gem to print a nicely formatted output for each bubble
  • When running the app.rb allow print the bubbles but then allow the user to input any of the following to choose their action:
    • Post
    • Refresh
    • Exit
  • If Post or Refresh, keep them in the app and ask the question again.
  • Save the users username in a local file called .soapbox, so they only have to enter it once, running the app in the future should read from the file what their username is.
  • Add a .save method to a bubble, which actually writes the file for that bubble.
  • Create a SoapboxFiles class which encapsulates the file reading and sorting methods as class methods.

soapbox's People

Contributors

bookis avatar khambro avatar

Watchers

 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.