README.md 1.93 KB
Newer Older
1
2
3
4
5
# Collect tweets for H2020 MOOD

This project collects tweets based on a list of keywords or/and twitter accounts in the [H2020 MOOD](https://mood-h2020.eu/) framework

Keywords and Twitter accounts lists have been defined by H2020 MOOD partners :
Rémy Decoupes's avatar
Rémy Decoupes committed
6
* [keyword](params/keywordsFilter.csv)
Rémy Decoupes's avatar
Rémy Decoupes committed
7
* [twitter account](params/accountsFollowed.csv). For MOOD partners, the selection of accounts to follow can be found in [Alfresco](https://collaboratif.cirad.fr/share/page/site/MOODProposal/document-details?nodeRef=workspace://SpacesStore/de5d3d86-356e-4383-9078-cf4b9606c76a)
8
9
10
11
12

**To be compliant with Twitter's [Terms of Service](https://developer.twitter.com/en/developer-terms/agreement-and-policy)** this repository doesn't contains any tweet nor Twitter credentials. 
Users who wants to use this project have to create a [Twitter developer account](https://developer.twitter.com/en)

## Installation
Rémy Decoupes's avatar
Rémy Decoupes committed
13
14
### Dependencies
This project has only been tested on python3.7. 
15
16
Install all dependencies using pip:
```shell
Decoupes Remy's avatar
Decoupes Remy committed
17
pip3 install -r requirements.txt
18
19
```
### Twitter credentials
Rémy Decoupes's avatar
Rémy Decoupes committed
20
A credentials.py has to be created using the [template](params/template-credentials.py)
21
22
23
24
25
26
1. First copy the template :
    ```shell
    cp params/template-credentials.py params/credentials.py 
    ```
2. Edit credentials.py with your own Twitter account credentials
## Run
Rémy Decoupes's avatar
Rémy Decoupes committed
27
28
The run of this script will create a log file.
The script can be launched using this command :
29
30
```shell
python3 collectTweets.py
31
```
Decoupes Remy's avatar
Decoupes Remy committed
32
## Optional : create a systemd deamon
Decoupes Remy's avatar
Decoupes Remy committed
33
1. Copy service file `sudo cp systemd/mood-tweets-collect.service /lib/systemd/system`
Decoupes Remy's avatar
Decoupes Remy committed
34
2. Modify `/lib/systemd/system/mood-tweets-collect.service with the correct `WorkingDirectory` and `User
Decoupes Remy's avatar
Decoupes Remy committed
35
3. Reload systemd :`sudo systemctl daemon-reload`
Decoupes Remy's avatar
Decoupes Remy committed
36
4. Enable auto start using command : `sudo systemctl enable mood-tweets-collect.service`
Rémy Decoupes's avatar
Rémy Decoupes committed
37
## License
38
This code is provided under the [CeCILL-B](https://cecill.info/licences/Licence_CeCILL-B_V1-en.html) free software license agreement.