# User tweets

Each user's labeled tweets must be stored locally to be used for generating user features. To fetch a user's tweets, a search is done on all tweets associated with a user using the following MongoDB query. More info about the tweets collection [here](../cloud-processing/mongodb/tweets).

```python
{
    {'user': username}, 
    {"$or": 
        [{'isBull': True}, {'isBull': False}] 
    }
}
```

Once tweets are fetched, the only information saved is the _time, symbol, and bull/bear_ sentiment associated with each tweet. The data for each user is then stored in the `user_tweets` folder as CSV files (ex. `user_tweets/lemurback.csv`).&#x20;

![Example user tweets](https://1191160537-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MD0bNmrAlgQ-ZkaKZF1%2F-MDGFao6MjRSDr18diSU%2F-MDGG0AaLNmJcQtAeIqF%2FScreen%20Shot%202020-07-27%20at%201.11.48%20PM.png?alt=media\&token=15580f54-bd58-41b9-aa9c-c43b86c9d8ea)

