octopusinvitro / twitter-api

Using Sinatra to play with the Twitter API.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build Status build status Coverage Status Maintainability Dependency status

Readme

A project to play with Sinatra and the Twitter API.

How to use this project

This is a Ruby project. You will need to tell your favourite Ruby version manager to set your local Ruby version to the one specified in the .ruby-version file.

For example, if you are using rbenv:

  1. Install the right Ruby version:
$ rbenv install < VERSION >
$ rbenv rehash
  1. Move to the root directory of this project and type:
$ rbenv local < VERSION >
$ ruby -v

You will also need to install the bundler gem, which will allow you to install the rest of the dependencies listed in the Gemfile file of this project.

$ gem install bundler
$ rbenv rehash

Folder structure

  • bin : Executables
  • lib : Sources
  • spec: Tests

To initialise the project

$ bundle install

Go to https://developer.twitter.com/en/apps, create an app and take note of your credentials. Make sure the permissions are set to "Read and write". Then copy .env_example to .env and replace with your app's credentials.

To run the tests

$ bundle exec rake

To run the app

Make sure that the bin/app file has execution permissions:

$ chmod +x bin/app

Then just type:

$ bin/app

Open your browser and go to http://localhost:4567/

Another way of running it

Update the config.ru file, then type

$ rackup

Open your browser and go to http://localhost:9292/

Useful links

License

License GNU License

About

Using Sinatra to play with the Twitter API.

License:GNU General Public License v2.0


Languages

Language:Ruby 62.5%Language:SCSS 20.3%Language:HTML 15.0%Language:JavaScript 2.2%