Skip to content

A java webservice that checks if screenshots of tweets are real or fake news. Uses Vertx Web server and Twitter API.

Notifications You must be signed in to change notification settings

similola/FakeNewsAlert

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Fake News Alert

A java webservice that checks if tweets are real or fake news. Uses Vertx for the webservice and Twitter API to verify tweets based on a username and a tweet.

Project Background

This project won the CreateCon 2018 UK Hackathon, subsequently invited to Microsoft Corp in Redmond to build a beta version at One Week Hackathon 2018.

Demo Video at One Week Hackathon 2018

Demo Video at One Week Hackathon 2018

One Week Hackathon 2018 Vlog

One Week Hackathon 2018 Vlog

Steps to get started:

  1. Import the pom.xml file into IntelliJ/Visual Studio Code or an IDE of your choice
  2. Run the maven clean and install task.(via your IDE or command line). Command line instructions: (First check if maven is installed with the first command)
  • $ mvn -v

  • $ mvn clean install

    Notes: This is what is happening while you are running these tasks: Essentially, if you follow the pom.xml file, as well as downloading dependencies, it will also create a jar file under the lib folder and a war file under this folder target/fakenewsalert-1.0-SNAPSHOT/WEB-INF/lib. You need a jar file and war file to deploy your service in the future.

  1. The next thing you need to do is to get a Twitter App ID, App Secret, Token and Secret and put this into the Constants class See the "How to get started with the Twitter API" section on this page: https://developer.twitter.com/en/docs/basics/getting-started (It is preferable to store credentials somewhere secure like Azure Key Vault)

  2. After this you can start your service. Run your main class "RestLauncher.java" which launches the Rest Service(using the vertx library)

  3. Test the service locally using Postman

  • Use this GET Request endpoint to ping the service(as a healthcheck): http://localhost:8080/test

  • Use a POST request to check if a tweet is real or fake, endpoint: http://localhost:8080/verify, add this JSON payload to the body of the POST request. The Service should return a string with "real" or "fake" to determine whether the tweet is real or not.

{
"handle":"@similola",
"tweet":"This is a test tweet, playing around with the Twitter API (again). As you were :)"
}

About

A java webservice that checks if screenshots of tweets are real or fake news. Uses Vertx Web server and Twitter API.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages