Welcome to the Politweet! A simple web application designed to compare swedish politicians based on their Twitter statistics. Follow the instrictions below, if you encounter any difficulties, don't hesitate to submit your issue here.
The Politweet backend is built on Python2.7 utilizing the Tweepy API library and requires a computer capable of running Python2.7 scripts. Follow the instrictions below, if you encounter any difficulties, don't hesitate to submit your issue!
- Download and install Python2.7.
- During the installation process make sure you tick the option to get "PIP" as well.
- Once python2 with pip are both installed, open the cmd and type
pip install tweepy
.
- Download and install Python2.7
- During the install process make sure you tick the option to get "PIP" as well.
- Once python2 with pip are both installed, open your terminal and type
sudo pip install tweepy
.
Enter your computers password and press enter (PW won't visually show in your terminal window, but it's there).
Python2.7 comes preinstalled on most Linux distros, if you have removed the python package you can get it by following these steps:
- Open your terminal
- Download/install Python2 with
sudo apt-get install python
- Download/install PIP through
apt-get install python-pip
- Once Python2 with PIP is installed, type
pip install tweepy
inorder to get the tweepy library.
Make sure that you have Node.js installed on your system.
If you don't, you can download node.js from nodejs.org.
Your next step will be to download/clone this Github-repo. If you are familiar with Github, you can clone it. If not, just download the zip-file and extract it to a suitable location.
Now head over to your terminal or cmd, navigate to politweet/client and type:
bash npm install
This will install all the dependencies required to run the project.
Navigate to the backend folder and type:
bash npm install
afterwards, start the backend by typing node app.js
Navigate to the tweets folder and type:
python tweet.py
Wait until the terminal tells you that the script is finished!
Create a config.js file in backend, contact hej@politweet.se for a API key.
Navigate back to the client folder and run the application by starting a local server with the following command:
bash npm start
The server should start on localhost:3000 automatically, if it doesn't, you can navigate to it manually in your webbrowser.
A: This error may occur if you have not correctly installed pip or because pip is installed, but it's not installing tweepy in the correct dic/folder with the right path. For issues with pip, see Q2 below. For tweepy, check where you have python2 installed by writing which python
Navigate to that dic/folder and write sudo pip install tweepy
A: Make sure you have pip installed by writing pip -v
in your terminal. It should give you an output, similar to this: pip 9.0.1 from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (python 2.7)
If not, write easy_install pip
, if you still recive errors, write sudo easy_install pip
A: First, make sure that you have Python2 installed by writing python -V
in your terminal.
+If you don't get the following output: * Python 2.7.14 * you have not installed Python2.
+Head back up and follow the install guide for your local OS.