mitchbregs / viral_tees

Viral-Tees is a service that aims to catch the most trending topics and offer limited time access to merchandise showcasing these topics.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ViralTees

Viral-Tees is a service that aims to catch the most trending topics and offer limited time access to merchandise showcasing these topics. Using the social media to track trends, we aim to be first to market with viral-tees.

Authors

  • Mitchell Bregman - Initial work - [Gallup]
  • Leon Kozlowski - Initial work - [Bloomberg]

Setup

  1. git clone {repo}

  2. pip install -r requirements.txt

  3. .env:

SHOPIFY_API="{shopify-api}"

TWITTER_API_KEY="{twitter-api}"
TWITTER_API_SECRET="{twitter-api}"
TWITTER_API_TOKEN="{twitter-api}"
TWITTER_API_ACCESS="{twitter-api}"

FACEBOOK_TOKEN="{facebook-api}"
FACEBOOK_APP_ID="{facebook-api}"
FACEBOOK_APP_SECRET="{facebook-api}"
FACEBOOK_AD_ACCT_ID="{facebook-api}"
FACEBOOK_BUSINESS_ID="{facebook-api}"
FACEBOOK_PAGE_ID="{facebook-api}"
FACEBOOK_PIXEL_ID="{facebook-api}"

MONGO_SERVER="{server}"
MONGO_PORT="{port}"
MONGO_DATABASE="{database}"
  1. Open 4 terminals:
  • luigid
  • mongod --port=$MONGO_PORT
  • python app.py
  • python run_luigi.py --all

Tasks

  1. DeepClean

Removes data and static folders and all files within. python run_luigi.py --flow clean

  1. StartLogging

Start logging mechanism of pipeline

  1. QueryTwitterTrends

For each city metro location in run_luigi.py, write to json with trend data.

  1. StoreTrendsData

For each json saved by QueryTwitterTrends write data to mongo

  1. StoreTrimTrendsData

Query mongo for all trends in current run, and generate a unique list of trends for all metro regions

  1. StoreImageTweets

Query Twitter via tweepy and save only tweets with images to mongo

  1. SaveImage

Saves images from filtered trends data.

  1. CropImage

Cropping images based on a cv2 KeyPoints heuristic

  1. ParseImageTweets

Parse out images in order to host on backend via Flask

  1. ImageOverlay

Overlay cropped images onto background shirt image along with text outlining the trend and date

  1. GenerateShirtData

Using data stored in mongo, develop a set of data in order to post shirts to Shopify

  1. PostShopify

From the data generated in GenerateData and the shirt produced in ImageOverlay post a product to Shopify

  1. OutputTwitterTasks

Dependency Graph Screen Shot

  1. OutputImageTasks

Dependency Graph Screen Shot

  1. OutputShirtTasks

Wrapper task for developing shirts

  1. OutputShopifyTasks

Wrapper task for pushing shirts to Shopify

References

  1. Luigi Basic Working Example

  2. Luigi Multiple Inputs and Multiple Outputs - Ex. 1

  3. Luigi Multiple Inputs and Multiple Outputs - Ex. 2

  4. Gmail API

About

Viral-Tees is a service that aims to catch the most trending topics and offer limited time access to merchandise showcasing these topics.


Languages

Language:Python 77.7%Language:HTML 21.6%Language:Shell 0.7%