zfhui / simple-twitter

This project implements a simple Twitter search with the twitter gem, which uses Twitter's Standard Search API.

Home Page:https://simple-twitter-search.herokuapp.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Simple Twitter Search

This project implements a simple Twitter search with the twitter gem, which uses Twitter's Standard Search API.

Please note that Twitter’s search service and, by extension, the Search API is not meant to be an exhaustive source of Tweets. Not all Tweets will be indexed or made available via the search interface. - Source

Development

Setup Rails

# Install Ruby 2.5.0 via RVM
$ rvm install 2.5.0

# Install bundler
$ gem install bundler

# Install all gems
$ bundle install

Setup Twitter Development App

Change the .env.sample file to .env and either keep the credentials (which were created for this experiment) or setup a new Twitter App, create a new Access Token and replace those in the .env file.

CSS Framework

This project uses the light-weight, responsive CSS framework Pure for styling the very basic elements in the views. The framework is served via a CDN.

Run the App locally

$ rails s

Now visit http://0.0.0.0:3000 in your favourite browser.

Tests

Run Tests

$ rspec .

Deployment

Continues integration via Travis CI is setup. It also deploys the code to Heroku automatically.

Visit: https://simple-twitter-search.herokuapp.com

Statuses

Tool Travis CI/CD Code Climate
Status Build Status Maintainability

🌟 Ideas for improvements

  • cache search query (e.g. via Redis), because currently each request can take quite long
  • better error handeling (e.g. unauthorized, rate limit, server error, ...)
  • better redering of retrieved tweets (handle, link to original tweet, user image, pagination...)

About

This project implements a simple Twitter search with the twitter gem, which uses Twitter's Standard Search API.

https://simple-twitter-search.herokuapp.com


Languages

Language:Ruby 79.3%Language:HTML 16.3%Language:JavaScript 2.6%Language:CSS 1.7%