Skip to content

A little project to send Tweets about the weather

Notifications You must be signed in to change notification settings

luizcarvalho/wetweet

Repository files navigation

WeTweet

WeTweet Logo

Maintainability Test Coverage Test workflow

WeTweet é um projeto simples que permite por uma simples requisição HTTP enviar um tweet com o clima atual de uma cidade e a média da temperatura para os próximos 5 dias.

Getting started

First of all, clone this repository and run bundle install inside of the project directory.

    bundle install

Now, you need to configure the credentials of Twitter, for this, you need to create a developer account on Twitter.

With the Twitter keys, run:

    bundle exec rails credentials:edit --environment development

This command will be open your main text editor, the encrypted credentials file, replace text for:

twitter:
  consumer_key: xxxx
  consumer_secret: xxxx
  access_token: xxxx
  access_secret: xxx
open_weather_map:
  appid: xxxx

And close editor.

Starting project

Start the Rails server with the command:

bundle exec rails s

If all occurs good, you can access the project on URL http://localhost:3000/

With Docker

To use this project with Docker, just run the following commands

docker-compose build
docker-compose up

Using WeTweet

To make a tweet using WeTweet, you need to request URL /twitter/send_weather with coordinates params. Like this:

curl -X POST -H "Content-Type: application/json" -d '{"lat": "-23.561355", "lon": "-46.6578882"}' "http://localhost:3000/twitter/send_weather"

And receive the response message 'Tweet was successfully sent!' and the weather will be displayed in the Twitter account.

Thanks for using WeTweet!

About

A little project to send Tweets about the weather

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published