Methodology

< Home

The code is available to browse on the GitHub repository but below includes very brief information about the main features of the project. I used Python unless otherwise specified.

I used Google’s pytrends to collect the data using category 185 “Fashion & Style” from official category list. Date from the beginning of 2019 until July 2022. File is fashun_week_trends.py

from pytrends.request import TrendReq as UTrendReq 
...
pytrends.build_payload(values, cat=185, geo="GB-ENG", timeframe=f'2019-01-01 {date.today()}',)

Twitter API

I used Twitter’s API package tweepy only obtaining single tweets - excluding replies, retweets, and links. File is chirp_tweets.py

tweet_search = "lang:en -filter:links -filter:replies -filter:retweets"

If you are interested in the text cleaning, see bath.py. I used VADER for sentiment analysis, singing.py as it is a rule-based method trained w/ tweets.

RShiny

With R I used the shiny library to create a basic set of plots and interactive elements for users to explore. This app is developed based on the time-trends, sentiment, and correlation methods for users to make their own investigations. See the app here: RShiny.


End of page.

Samantha Pendleton | samanfapc@gmail.com | Twitter | GitHub