Git Product home page Git Product logo

dailyquote's Introduction

Daily Quote!

What it does?

It is a Mulesoft ESB tweeter bot that posts a daily quote from the movies Lord Of the Rings (LOTR) using the language you want.

Real twitter account running the bot

What is the data source?

I'm using the nice API created by Ulrike Exner (http://rike.dev) that returns LOTR content. Thanks Rike ;)

How to run it?

This app integrates a LOTR content API and the Twitter v2 API, so you will need the following resources to run it. Everything here is free.

  1. A twitter account.

  2. A twitter developer account using Twitter API v2 updated to Elevated.

  3. A Lord of the Rings (LOTR) API developer account.

  4. A Google Cloud Account and a key to use the service Google Translate.

  5. Create a new file src/main/resources/local.properties with authorization info from twitter and LOTR APIs.

dailyquote.http.port: 8081
dailyquote.tweet.cron: 0 0 0,7,9,11,13,15,17,19,21,23 ? * * *
dailyquote.tweet.cron.timezone: 201
dailyquote.translation.enable: true 

google.translatelanguage.host:translation.googleapis.com
google.translatelanguage.url: /language/translate/v2
google.translate.APIKEY: [your key]
google.translatelanguage.targetlanguage: pt
    
twitter.host: api.twitter.com
twitter.oauth.consumer_key: [value]
twitter.oauth.consumer_secret: [value]
twitter.oauth.access_token: [value]
twitter.oauth.token_secret: [value]

lotr.host: the-one-api.dev
lotr.authorization: [value]  

Testing

You can use postman (https://www.postman.com/) to test it. The offline version of this tool is needed to performs tests against localhost.

  1. http://localhost:8081/api/quoteoftheday
    • Returns a JSON object with a random quote
   {
       "quote": "'War? Yes. It affects us all. Tree, root and twig. But you must understand, young Hobbit......it takes a long time......to say anything in Old Entish... ...and we never say anything......unless it is worth taking......a long time to say.'",
       "author": "'Treebeard'",
       "source": "'The Two Towers '"
   }
  1. http://localhost:8081/api/tweetdailyquote
    • Actually post the quote using the twitter account and return a string with the quote posted.
     "Yes, yes." - BILBO BAGGINS [The Fellowship of the Ring]

Whishlist for future/possible updates

  • Tweet quotes in several languages through Google Translator API or similar.
  • Tweet a picture of the movie caracter owner of the quote along with it its quote.
  • Write proper error handlings including sending e-mails to system admin when an exception happens.
  • Integrate with Github actions to automatically build and deploy in CloudHub.
I'm using Mule 4 in this app

dailyquote's People

Contributors

alexneocoding 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.