Skip to content

Commit

Permalink
Merge pull request #1 from kamidipreetham/develop
Browse files Browse the repository at this point in the history
v0.2 Release
  • Loading branch information
Preetham Kamidi committed Jun 25, 2019
2 parents 66c41b7 + 784ddb9 commit be5abf0
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.vscode
venv
dataset
.DS_Store
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM ubuntu:18.04
LABEL author "Preetham Kamidi <kamidipreetham@gmail.com>"
RUN apt-get update && apt-get install -y python3-dev python3-pip imagemagick tesseract-ocr libtesseract-dev
WORKDIR /app
COPY . .
RUN mkdir -p /data/files && \
pip3 install virtualenv && \
python3 -m virtualenv venv -p python3 && \
. venv/bin/activate && \
pip install -r requirements.txt
ENTRYPOINT ["/app/entrypoint.sh"]
19 changes: 17 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,17 @@
# verifytweet
Verify Tweet from Image
# Verify Tweet

Fake tweet images can be generated using a preset meme template from websites like: [TweetGen](https://www.tweetgen.com/), [Prank Me Not](http://www.prankmenot.com/?twitter_tweet) and [Simitator](http://simitator.com/generator/twitter/tweet) . Verification of such tweets takes a manual work to find the user, scroll through their timeline and matching. A viral fake tweet image can prove crucial at a time.

A fake tweet screenshot looks very convincing, misleading the general public. For example:

|Tweet 1 | Tweet 2 |
|:-------------------------:|:-------------------------:|
|![alt text](https://i.imgur.com/gG1RYiR.png "Tweet 1") | ![alt text](https://i.imgur.com/eTKpOFY.png "Tweet 2")|

Verify Tweet attempts to resolve the problem by letting users upload such tweet screenshots and verify if the user actually tweeted or not. A combination of Image processing, Natural language processing as well as Twitter Search API makes this possible. Due to Twitter API rate limits, currently only tweets from last 7 days can be verified.

## Future features

- [ ] Support for Image links
- [ ] Processing Status
- [ ] Support for Tweets with replies
1 change: 1 addition & 0 deletions app/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class Config(object):
APP_HOST = os.getenv('APP_HOST')
APP_PORT = os.getenv('APP_PORT')
TIMEOUT = os.getenv('TIMEOUT')
MAX_CONTENT_LENGTH = int(os.getenv('MAX_CONTENT_LENGTH'))
TESSERACT_PATH = os.getenv('TESSERACT_PATH')
IMAGEMAGICK_PATH = os.getenv('IMAGEMAGICK_PATH')
UPSCALE_PERCENTAGE = os.getenv('UPSCALE_PERCENTAGE')
Expand Down
2 changes: 1 addition & 1 deletion app/logger/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
root.setLevel(logger.DEBUG)
handler = logger.StreamHandler(sys.stdout)
handler.setLevel(logger.DEBUG)
formatter = logger.Formatter('%(asctime)s -- %(levelname)s -- %(message)s')
formatter = logger.Formatter(u'%(asctime)s -- %(levelname)s -- %(message)s')
handler.setFormatter(formatter)
root.addHandler(handler)
3 changes: 3 additions & 0 deletions app/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import traceback

from flask import Flask, jsonify, request
from flask_cors import CORS

from app.logger.logger import logger
from app.services.image import uploader, processor
Expand All @@ -11,6 +12,8 @@
from app.config.config import app_config

app_router = Flask(__name__, static_folder=app_config.FILE_DIRECTORY)
app_router.config['MAX_CONTENT_LENGTH'] = app_config.MAX_CONTENT_LENGTH
CORS(app_router)


@app_router.route('/health', methods=['GET'])
Expand Down
3 changes: 3 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
source venv/bin/activate
python wsgi.py

0 comments on commit be5abf0

Please sign in to comment.