{'fraction_non_alphanumeric': 0.02955391548559859, 'fraction_numerical': 0.014989223434132323, 'mean_word_length': 4.81412568824758, 'pattern_counts': {'":': 0, '<': 1, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
The rhythms of the night: increase in online night activity and emotional resilience during the spring 2020 Covid-19 lockdown

Context The lockdown orders established in multiple countries in response to the Covid-19 pandemic are arguably one of the most widespread and deepest shock experienced by societies in recent years. Studying their impact trough the lens of social media offers an unprecedented opportunity to understand the susceptibility and the resilience of human activity patterns to large-scale exogenous shocks. Firstly, we investigate the changes that this upheaval has caused in online activity in terms of time spent online, themes and emotion shared on the platforms, and rhythms of content consumption. Secondly, we examine the resilience of certain platform characteristics, such as the daily rhythms of emotion expression. Data Two independent datasets about the French cyberspace: a fine-grained temporal record of almost 100 thousand YouTube videos and a collection of 8 million Tweets between February 17 and April 14, 2020. Findings In both datasets we observe a reshaping of the circadian rhythms with an increase of night activity during the lockdown. The analysis of the videos and tweets published during lockdown shows a general decrease in emotional contents and a shift from themes like work and money to themes like death and safety. However, the daily patterns of emotions remain mostly unchanged, thereby suggesting that emotional cycles are resilient to exogenous shocks. Supplementary Information The online version contains supplementary material available at 10.1140/epjds/s13688-021-00262-1.


Introduction
The lockdown established in France from March 17th to May 11th as a response to the Covid-19 pandemic created a sudden and severe transformation of daily routines. This disruption represents a textbook case of exogenous shocks on human behaviors, which can, by comparison, reveal features of normal social life. In this paper we carry out this comparative analysis, focusing on online behaviors and leveraging a unique YouTube dataset. A few weeks before the lockdown, we started following a corpus of more than one thousand French political YouTube channels with an exceptional temporal granularity -recording hour by hour the number of views of all of their videos. This collection provided us with a unique dataset to study how the lockdown transformed the circadian rhythms of on-line activities. To make sure our findings are not platform specific, we compare the results obtained on YouTube with a Twitter dataset of 8 million tweets in French.
In this paper, we investigate changes in the daily rhythm of online activities and address two related research questions: what are the changes produced by the lockdown and how resilient are online circadian rhythms. The analysis of such a exceptional period allows us to distinguish the dynamics due to the Covid-19 crisis from the stable features of the social media we investigate. We focus our research on a single country, France, in order to identify precisely the start and end dates of the lockdown and to work on a (relatively) uniform population sample that excludes national differences.
Our analysis shows an increase of online activities, for both platforms, likely a consequence of the decrease of real-life interactions. The growth in online participation and content consumption is not uniform across the 24 hours, but it is more salient during the night. Besides this variation in volume, we register changes in the kind of content shared from an emotional and thematic point of view. On both platforms, the lockdown is marked by an unexpected decrease in emotional contents and by a more predictable thematic shift from topics like "social life" and "leisure" before the lockdown, to matters related to "house" or "death" during the lockdown. Against these lockdown-induced changes, some constants of YouTube and Twitter stand out. Despite its quantitative change, the shape of the daily cycle of different emotions (i.e. their prevalence by hour) is not impacted by the lockdown: this finding confirms the results of previous studies that showed a stability of emotional rhythms across seasons and cultures [1][2][3]. The resilience of these patterns, despite the disruption of the lockdown, may be due to biological origins of the emotional expression, which seems to be more influenced by the biological clock than by exogenous factors.

Related work
The patterns of activity in different social media vary according to the characteristics and the scope of the different platforms and to the composition of its user pool. Several papers in the literature have studied circadian fingerprints in different social media. On YouTube, scholars have investigated the rhythms of content creation (i.e. video posting) [4] and of content fruition (i.e. videos watching) [5]. Daily and weekly use of Twitter has been analyzed in various countries [6]. Among other platforms, Foursquare has attracted researchers' attention for its circadian and geographic patterns [7] and its similarities with Twitter [8], while Wikipedia editing patterns have been studied in [9] with an interesting focus on inter-cultural variations. Moreover, slightly deviating from the social media framework, mobile phones and instant messaging activities have been frequently analyzed in [10,11]. Despite their differences, all platforms unsurprisingly show a substantial decrease of activity during the night.
The realm of night owls is characterized not only by a general quiet but also by typical emotional markers. Emotional content of Twitter activity has been studied in several papers with different approaches [1][2][3]. Despite the variety of data considered, all these papers share the same finding: digital nights are consistently characterized by a lower level of shared emotions (both positive and negative).
The Covid-19 lockdown partially disrupted these rhythms, by drastically changing people's habits and daily routines: from physical commuting to telecommuting, from school classes to distance learning, from in-person meetings to video calls. Within few days whole populations had to re-adapt their behaviors into a new life scenario characterized by deep health and professional concerns. Such unpredictable situation strongly impacted peoples' sleep-wake cycles, as reported in several studies based on surveys [12]. With our study, therefore, we create a link between the literature on circadian online rhythms and the one on the stress experienced by many societies in recent months.

Data and methods
Since circadian patterns of online activity are strongly dependent on users' demography and on platforms' scope we conducted our study across two different platforms: YouTube and Twitter. This comparative framework will be central to distinguish platform-specific findings from more general trends.

The YouTube dataset
As mentioned in the introduction, the YouTube dataset is particularly interesting because of its temporal granularity. Indeed, historical data about the number of views can no longer be retrieve from the YouTube application programming interface (API), which only returns the views at the moment of querying and not their temporal evolution. Therefore, studies like the ones by [13] and [14] involving time series of engagement metrics are not longer possible, unless constantly querying the API all along the period of interest, as we did.
The dataset covers 1031 popular French channels that (according to the experts we consulted) are particularly influential in the French public debate. These channels, with their description, are listed in the Supplementary Material. The channels have been selected through a qualitative analysis of the French YouTube, aiming to identify relevant actors that diffuse political opinions through the platform. The selected channels belong to the following categories: local and national media; influential Youtubers discussing political topics; militant associations; politicians; candidates for the European elections; political parties; Yellow Vests groups; associations devoted to public causes; large public or private institutions. YouTube provides no information about the location from which videos are viewed, but since the channels of our corpus focus on the French public debate, we can assume most of their viewers to be based in France. In collaboration with the Qatar Computing Research Institute (QCRI), we recorded hour by hour the evolution of views of each video published after February 17, for an entire week after the publication. Between February 17 and April 14, we collected the views time series for 99.992 videos. For every video, we also collected the title, the description and other metadata available through the official YouTube API.
Before being able to perform our analysis, some preprocessing turned out to be necessary. Contrarily to what one might expect, the total number of views of a given video is not always increasing. Occasionally, YouTube removes from its counting earlier views that it deems to be fake because likely produced by bots, click-farming or through other illegitimate tricks, since YouTube wants "to make sure that videos are viewed by actual humans and not computer programs" [15], as per the official support web-page. Since the corrections of these views are made after their recording, our dataset contain hours with a negative number of views. To correct such negative views, we have preprocessed our data in order to uniformly redistribute the corrections made at a given time on the previous hours. More precisely, if we call v h the views collected by a generic video at hour h after publication and T h the total number of views at hour h, if T h+1 < T h , we correct the time series as follows: whereT j is the corrected time series until hour h and p = T h -T h+1 T h is the percentage of correction.

The Twitter dataset
The Twitter dataset comprises about 8 millions tweets, retrieved through the official Twitter API, posted by 5161 active but non-professional users from February 17 to April 14. These non-professional users have been identified from a wider dataset of about 33 millions tweets containing Covid-19-related content. This corpus of tweets was collected by Science-Po MediaLab in Paris, by using the python based scraper Gazouilloire [16], a tool developed by Dime Web for systematic and configurable Twitter data collection through Twitter's official API. The data were collected based on a query of Covid-19-related words in French. All twitting and re-twitting times were collected in European Central Timezone (UTC +1). Being Covid-19 the most trending communication topic in France (as we can observe for example from Google Trends) since its first diffusion in Europe and even more around the lockdown decision, we can assume that a relevant part of the French Twittosphere is potentially present in this database.
Differently from the YouTube database, which does not allow extracting information on the users, for the Twitter database we can define precise profiles of the users we are interested in studying, in order to have a more homogeneous, even if reduced, population. Since we are interested in the activity of common Twitter users, we decided to exclude newspapers, bloggers, radios, associations, etc. and only consider non-professional users. Moreover, recalling that the aim of this work is to provide robust cross-platform results, we needed the Twitter dataset to be comparable to the YouTube one: we hence had to restrict the content production on Twitter to the sole production taking place in France. The requirements listed above, together with the filtering they set off, can be clarified as follows: • facing the need to exclude professional users, we only considered those (1) whose profile did not contain keywords associated to professional use of the platform (e.g. "media", "blog", "official", etc.); (2) with a number of followers lower than the median of the whole dataset; (3) with an activity lower than the median activity (∼400 tweets by week); • targeting a significant statistical analysis, we discarded users who published less than 100 tweets in the whole period; • focusing on France, we filtered the sole users who explicitly declared their location to be in France, searching in the location descriptions multiple translations of "France", the name of all the cities in France with a population larger than 10,000 inhabitants (with eventual translations), the French regions and departments. This filtering left us with 5161 users: their Twitter profiles' descriptions have been manually checked to make sure that the non-professional selection mechanism was effective. Finally, in order to construct the dataset of tweets, the entire timelines of the selected users have been collected through the Twitter API, including tweets not related to Covid-19. Even though this sample is not meant to be representative of the full French Twittosphere, it provides a complete perspective of a sizable and homogeneous set of active non-professional users of the platform over the relevant time frame.

The tool for emotion and topic mining
To analyze the emotional and thematic contents of tweets and YouTube videos, we used a very well-known and tested tool: the LIWC dictionary [17]. The LIWC dictionary classifies words on more than 70 emotional, stylistic and thematic dimensions and has been used in several analogous studies such as [1,2]. More precisely, the LIWC dictionary provides a list of words associated to each of the dimensions (for example, the category "Positive emotions" contains words like: happy, pretty, and good. Since the texts we analyze are written in French, we used the French version of the LIWC dictionary [18].

Results
The first major habit change generated by the 2020 spring lockdown in France is a considerable increase in the online activity. Recalling that the French first lockdown was announced on March 15 and enforced on the 17th, we can better understand the time series for Twitter posting, YouTube posting and YouTube views displayed in Fig. 1. All three time series show weekly and daily fluctuations. The average daily signals, smoothed by a moving average over a 7 day rolling window, reveal an increase of activity for Twitter posting and YouTube watching around the beginning of the lockdown. Notice that on both platforms the increase of activity started from the very moment the lockdown was announced (which itself sparked much debate).
As for the posting of videos on YouTube, this activity is less casual and more stable than tweeting (particularly for the high-visibility channels that we monitored) and therefore conserved the same weekly and daily rhythms during the lockdown. Since the video production is hardly affected by the lockdown, we will not consider this dimension in the rest of the paper.

The rhythm of the night
To highlight the effects of the lockdown, in the following we analyze thematic and emotional changes before and after the start of the lockdown (March 17). We refer to the period before the lockdown as to the three weeks from February 17 to March 9. At the same time we will refer to the period after the lockdown enforcement as to the three weeks from March 23 to April 14. To exclude the transient effects of the transition phase, we discard the data about the two weeks around the lockdown onset (from the 9th to the 22nd of March). Preliminarly, we calculated the normalized daily activity profiles before and after lockdown for each hour of the day by and where h ∈ {0, . . . , 23} are the hours of day, d are the days considered, and N tweets (d, h) and N views (d, t) are respectively the number of tweets and of YouTube views at hour h of day d.
The results are reported in the left plots of Fig. 2. We first observe that the profiles for Twitter and YouTube are quite different: while Twitter is mostly used during the day, with a strong activity decrease after midnight, YouTube is characterized by a higher night activity. While Twitter is an active media, characterized by a debating and prosuming culture [19] that encourages participation at the time of the day when engagement is maximum, videos watching on YouTube is, for many users, a more passive activity [20] which can easily fit the more relaxed late hours.
To quantify the differences between profiles before and after the lockdown, we calculated the relative differences of the normalized profiles: This quantity is reported in the right plots of Fig. 2. Both YouTube and Twitter experienced an activity increase during the night and a smaller decrease of the activity in the early morning (6 am-9 am for Twitter and 9 am-12 am for YouTube). We observe that the morning decrease in Twitter is much smaller than the night increase. This suggests that, with the lockdown, people stayed longer awake during the night but without oversleeping in the morning.
To appraise the variations in the activity during lockdown nights, we compare this variation with another factor known to impact online circadian patterns: the weekly cycle of weekends and working days. We aggregate the data at the level of day and night: based on the shapes of the curves in Fig. 2, we consider night on Twitter the hours between 11 PM Figure 2 Circadian Rhythm Changes. On the left, Twitter and YouTube circadian rhythms before and after the lockdown. On the right, we explicitly evaluate the relative differences between rhythms before and after the lockdown and 6 AM of the following day and on YouTube the hours between 1 AM and 8 AM. We decompose the aggregated activity into weekends and working days. To obtain comparable measures we divide the activity counts by the number of hours of the corresponding time period (night = 7, day = 17) and by the number of days of week parts (weekend = 2, working days = 5). The average number of tweets/views in the different categories are represented in Fig. 3, together with the relative changes among the classes. As we already observed, the night variations are the largest changes, both in weekends and working days. The activity increments due to lockdown are significantly larger than the variations associated with the normal week cycle. In YouTube the variations also have opposite signs: while the activity normally decreases during weekend, it increases with lockdown. For both platforms, and both for day and night, the most significant difference concerns the working days: the augmented social media usage seems to be replacing the time previously dedicated to daily routines (like commuting to work, going to sleep early, etc.) more than the time of recreational activities.
To confirm the hypothesis of reduced sleep during the lockdown, we analyze the situation at the individual level. For each Twitter user, we calculate the average time lag between two consecutive Tweets. Figure 4 shows the hourly average of this measure colorred (and the boxplots to appreciate its variability) before and after the lockdown. While, in normal times, the average inter-event times are much higher during the night (because of sleeping breaks), the lockdown flattened the curve, thereby suggesting a short-  ening of sleep intervals [12]. In the right plot of Fig. 4 we display, for each hour of the night, the probability that the subsequent tweet is posted on the following morning (between 7 AM and 12 AM) rather than during the same night. This quantity represents the probability to "go to sleep" after an event at t 0 . For this analysis we only considered the inter-events that are longer than 1 hour, in order to get the last action only in a potential activity burst and reduce the noise. We also excluded all the inter-events finishing after the next morning. We see that, until 4 AM, the probability to get asleep is lower during lockdown. These findings are based on an aggregated statistical study of the interevents. Unfortunately, the short time span of our data collection (2 months) does not allow a more sophisticated analysis, for example, of the users chronotypes, which, as shown by [21,22] can be extremely important for understanding the individual sleep behavior.

What is night?
In this paragraph we analyze whether the quantitative changes observed in the previous paragraph correspond to differences in terms of contents. For Twitter, we build the sets K(d, h) containing all the hashtags posted in day d at hour h. For YouTube, we build the sets K(d, h) containing all the videos visualized in day d at hour h. We define the time similarity matrix, , between two day's hours h 1 , h 2 , based on the Jaccard similarity between the sets K(d, h 1 ) and K(d, h 2 ) as: where J(K(d, h 1 ), K(d, h 2 )) = |K(d,h 1 )∩K(d,h 2 )| |K(d,h 1 )∪K(d,h 2 )| is the Jaccard similarity. Matrix , represented in Fig. 5, indicates how the content shared or viewed at a certain hour is similar to the content in all the other hours. We perform a k-means clustering procedure on this matrix to better identify the relationships between the hours of the day. The results of the clustering are represented by the colors of the hours on the left of the plots of Fig. 5. Remarkably, these clusters identify different periods of the day, thereby showing that contents evolve along the day and different periods of the day are characterized by specific contents. Both for Twitter and YouTube, and both before and after lockdown, night hours (0 am-5 am) are characterized by contents that are distinctively different from the rest of the day. Before the lockdown, morning hours (6 am-10 am for Twitter and 6 am-8 am for YouTube) were the most different from night-time and constitute a well definite cluster. For Youtube before the lockdown, the late morning hours 9 am-10 am showed a return of the night contents. For both platforms before the lockdown, we observe a lunch-afternoon cluster and an evening cluster. Lockdown affected the morning cluster, though in opposite ways for the two platforms. In Twitter, the morning cluster extended to first hours of the afternoon cluster (lunch hours), while in YouTube the night vibe extended into the morning (until 11 am). In Twitter, the lockdown shifted the afternoon cluster after lunch time (3 pm-9 pm) and consequently reduced the evening hours (10 pm-11 pm). In YouTube, we observe the emergence of contents dedicated to the lunch hours (12 am-2 pm) and a second uniform block covering the afternoon and the evening (3 pm-11 pm).

A significant change of content
We proceed with the analyses of the emotional and thematic content of Twitter and YouTube activities, before and after the lockdown.
Using the categories of the LIWC dictionary we will consider 3 separated analytic dimensions: • General Affects: Positive Affect, Negative Affect; • Specific Emotions: Sadness, Anger, Anxiety and Accomplishment: • Thematic contents: Work, Social life, Religion, Death, Fun, Exclusion, Biology, Money. We first assign the tweets and YouTube videos (based on the words contained in their titles and descriptions) to one category for each dimension. To do so, we count how many terms from each category are contained in each tweet/video, and we assign the content to the prevalent category. For example, for the dimension "General Affect", each content is categorized as either Positive or Negative Affect or not classified if the item contains no categorical words or similar proportions of positive and negative terms. We also consider the global emotional level ("Affect") of the items, by counting together the positive and negative words. For each dimension, we compute the fraction of tweets and retweets in each category during the lockdown and the difference compared to the previous period. In the same way, for YouTube, we evaluate the fraction of visualization of videos in each category over the total number of views. The results are reported in the left plot of Fig. 6.
Comparing the two platforms, we first observe that YouTube is more "emotional" than Twitter and is generally populated by more positive content. Both platforms experience a decrease of the emotional sphere during the lockdown, but on YouTube in particular we observe an increase of emotionally negative contents. Regarding specific emotions, we notice that expressions of accomplishment decline in both platforms. Instead, while Twitter  3.50 · 10 -2 3.11 · 10 -12 Anxiety 1.15 · 10 -2 9.39 · 10 -3 3.11 · 10 -12 Accomplishment 1.46 · 10 -1 1.32 · 10 -1 3.11 · 10 -12 Work 6.96 · 10-2 5.58 · 10-2 0.0025 Social Life 0.119 0.117 1.46 · 10 -6 Religion 6.87 · 10 -3 7.14 · 10 -3 3.85 · 10 -3 Death 5.51 · 10 -3 5.90 · 10 -3 1.03 · 10 -3 Leisure 5.34 · 10 -2 4.57 · 10 -2 3.11 · 10 -15 Exclusion 1.37 · 10 -1 1.34 · 10 -1 1.73 · 10 -8 Biology 1.06 · 10 -1 1.03 · 10 -1 4.20 · 10 -8 Money 5.91 · 10 -2 4.51 · 10 -2 3.11 · 10 -15 experienced a decrease of all specific emotions, YouTube, which was already characterized by a higher level of anger, sadness and anxiety before the lockdown, goes through an important increase of these sentiments. From a thematic point of view we observe, unsurprisingly, a decrease of the contents related to social life and leisure and an increase of contents related to death and house. On Twitter we also have a significant increase of religion-related contents. All differences in distribution of contents before and after the lockdown have been tested statistically with Kolmogorov-Smirnov (KS) tests. For both platforms before and after the lockdown an hourly aggregation has been performed in order to get two different samples of emotion distribution. The results of the KS test over those distributions are reported in Table 1 and Table 2 and most of the times support the statistical relevance of differences in content distribution before and after the lockdown.  [1][2][3] we observe that nights are characterized by low emotional levels, especially positive ones, while both positivity and negativity tend to peak at the moment of the awakening. This pattern is more evident on Twitter also at the level of specific emotions, while on YouTube a significant portion of negative contents is consumed during the night. An interesting observation, again in phase with the precedent findings of [1][2][3], is that the daily emotional patterns seem to be resilient to the Covid-19 disruption: even if the volumes of some emotions changed during the lockdown, their daily distribution generally maintained the same shape, as demonstrated by a rough parallelism of the lines before and during the lockdown (with some exceptions regarding anger and anxiety on YouTube). This fact confirms the observation made in [1] that external factors, even as important as the Covid-19 lockdown, influence the emotional patterns less than the sleep-wake cycles. Interestingly, this is not the case for the distribution of topics which has been more significantly influenced by the lockdown.

Discussion
The Covid-19 pandemic and the ensuing lockdown have deeply and widely disrupted people's daily routines. Our research exposed some of these changes through the lens of social media. By highlighting what has changed during the lockdown and what has resisted the Covid-19 shock, our research proves that certain online habits are more resilient to external disruption than others, thereby suggesting which human behaviors are more influenced by exogenous factors and which are, on the contrary, constant even in exceptional situations.
Circadian rhythms of activity proved to be strongly related to lifestyle and working hours: the change observed in the lockdown rhythms suggests in particular that in the absence of external constraints such as school and office hours, the boundaries between night and day become more flexible.
Perhaps surprisingly, we found out that the emotional charge of tweets and YouTube videos decreased with the lockdown, arguably leaving space to less emotional contents. However, this general finding is tempered by the fact that on YouTube (which is inherently a more emotional medium than Twitter) negative sentiments like anger and anxiety did increase, thus revealing the stressful situation for the population. As topics are concerned, online discussions proved to follow real world events and, unsurprisingly in a global epidemic that forced people at home, shifted towards questions connected to biology, house, and death.
As an even more interesting result, we pointed out the resilience of emotional patterns in online activities. While the general emotional charge of online contents decreased during the lockdown, it maintained its normal daily distribution. After March 17th, nightlife continues to be characterized by less emotional content despite the stress caused by the Covid-19 crisis. Even if the circadian rhythms change and people stay awake longer, at night, they seem to continue to share and consume the same type of contents.
In future research, we would like to investigate more in depth the nature of this lowemotional nighttime space, in order to reveal weather it consists of more informative and impartial contents and it gives rise to positive and constructive forms of debate or, on the contrary, whether it is more markedly affected by fake news and other types of misinformation. The LIWC dictionary used so far allowed us to distinguish emotional from unemotional contents: more specific dictionaries could lead to deeper insights about nighttime activity and to better understand the relationship between information and emotion in different medias. Broadly speaking, we hope that noticing the resilience of some online patterns during the lockdown might encourage future research in emotional rhythms and their reaction to external shocks.
Before concluding, we would like to briefly discuss two limitations of our study. In this research, we analyzed two different platforms, therefore providing insights on two different types of public. However, we should remind that these two viewpoints are not sufficient to completely represent the French social media and, even less, French society. A comparison with other type of data, not available to our team, like phone call datasets or mobile usage information would be useful to confirm and refine our findings. As a second limitation, our analysis is limited to a single country and to the period of the first lockdown. The continued and worldwide impact of the Covid-19 crisis calls for a comparison with similar analyses in other countries and in other phases of the pandemic.