项目作者: it-worked-yesterday

项目描述 :
Scrapes movie/TV Series details and twitter sentiments about the same. Front end src : https://github.com/it-worked-yesterday/HowsTheMovie-FrontEnd
高级语言: Python
项目地址: git://github.com/it-worked-yesterday/HowsTheMovie.git
创建时间: 2018-01-10T10:45:17Z
项目社区:https://github.com/it-worked-yesterday/HowsTheMovie

开源协议:

下载


HowsTheMovie

Scrapes movie/TV Series details from IMDB and analyses twitter sentiments about the same.

This module creates 2 rest apis based on Python/Flask open for GET requests:

  1. getmoviedetails : Scrapes information from IMDB about a movie/TV series. Returns movie object or None if nothing is found.
  2. gettwittersentiments : Fetches tweets with the above movie/TV series title in hashtag and analyses the sentiments. (Pos/Neg/Neutal)

Getting Twitter access tokens

Running locally (with Python3)

Clone the repo

  1. $ git clone https://github.com/it-worked-yesterday/HowsTheMovie-FrontEnd.git

Now create the virtualenv of Python3.6 using

  1. $ conda create --name howsTheMovie python=3

Activate the environment and install requirements using pip, navigate to linkedin folder which have spider as a subfolder and start the bot

  1. $ source activate howsTheMovie
  2. $ pip install -r requirements.txt

Set Consumer and Access keys

  • open confg/config.ini
  • replace the consumer and access keys with ones generated at apps.twitter.com

Run the flask app

  1. $ export FLASK_APP=index.py
  2. $ export FLASK_DEBUG=1
  3. $ python -m flask run

The flask server will create 2 Rest endpoints locally, which you can :

  1. 0.0.0.0:5000/howsthemovie/getmoviedetails?movie_name=
  2. 0.0.0.0:5000/howsthemovie/gettwittersentiments?hashtag=

NOTE
When hosting to a server be sure to add app.run(host=<host>, port=<port>) to index.py file as per the hosting service
documentation.