## 3 Method Description
### Activity Monitor  
The defined set of authorities in the previous step is used to filter the Twitter API stream. The output is a constant flow of messages (tweets) where: (1) the authority is the author of the post or retweet; (2) the authority post has been retweeted; or (3) a previous tweet from the authority is replied to.  
Algorithm 1 describes the flow that is followed by each tweet obtained from the \"authorities\" tracking. The aim of this first script is double: first, it accumulates the hashtags contained in the \"authorities\" messages and weights them; second, it is in charge of the time window, effectively setting the beat to which the system updates itself.  
```
Input: A Tweet coming from the \"authorities\" stream and \(C_{t}\longleftarrow\) Set of hashtags for current time window \(t\). (\(C_{t}\) is empty at the start of every time window \(t\)). Output:\(C_{t}^{\prime}\longleftarrow\) An updated set of hashtags for the same window \(t\) (in case the period has not changed) or a new set of hashtags for the new window \(t+1\) (\(C_{t+1}\)) (in case a new period has started) begin /* Check for a new time window (and renew if true) */ ifnew time window then  Save \(C_{t}\) to file /* Store \(C_{t}\) to use it later */  Clear \(C_{t}\) /* \(C_{t}\) becomes \(C_{t+1}\) */  end if /* Go over the Tweet that was obtained from the stream */ for each Hashtag in Tweet do ifHashtag not in \(C_{t}\)then  Add Hashtag to \(C_{t}\) with weight \(w\) else  Increase \(C_{t}[Hashtag]\)\(w\) units  end if  end for
```  
**Algorithm 1**Tweet Monitor.  
The collection \(C\) of hashtags in time window \(t\) (\(C_{t}\)) contains the hashtags adopted by the authorities and included in their tweets in a single time period. The script stores all the hashtags from each post (they are recognized using the # character). Here, it is possible to compute a weight \(w\) following a user-defined weight function, introducing a certain degree of flexibility in the prioritization, as the weight function can be adapted to the desired application. Some examples include a simple repetition count (number of messages that include the hashtag in question), weighting by the user follower base (e.g., a larger potential impact of a hashtag if tweeted by a user with more followers), limiting the influence of large users by using the logarithm of the same number, or any other mathematical function that fits the application.  
The user must define the time window \(t\), which again, allows for customization, as the tracking of different events might have different needs. When following a political election period or a public health crisis, for example, the rate of messages by the authorities is relatively slow, as are the user reactions, which often last for hours or days. In these contexts, the time window could be set at one hour or even one day. On the other hand, briefer events such as a football match or a song contest, where users basically comment during the event itself and react to what happens in them, would also need a briefer window. Whatever time period is chosen, the script stores an arranged collection of key terms (\(C_{t}\)) for each of them.