Last active
June 3, 2020 09:30
-
-
Save alxgrk/e8918d9c697a779d9301fbcbbdbb3a8d to your computer and use it in GitHub Desktop.
Twitter-User Contributor-Algorithm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
actAsContributor(previousSession) { | |
r = Random(0, 1) | |
currentSession = null | |
if (r <= 0.7 && previousSessions != Sessions.ScrollTimeline) { | |
currentSession = Sessions.ScrollTimeline | |
scrollTimelineSession() | |
} else if (r <= 0.9 && previousSessions != Sessions.Posting) { | |
currentSession = Sessions.Posting | |
postingSession() | |
} else if (r <= 1 && previousSessions != Sessions.Follow) { | |
currentSession = Sessions.Follow | |
followSession() | |
} | |
if (Random(0, 1) <= 0.3) { | |
// sometimes we want to immediately append another session | |
actAsContributor(currentSession) | |
} | |
// might be of interest at some later point | |
// if (Random(0, 1) <= 0.1) { | |
// browseTrends() | |
// } | |
// if (Random(0, 1) <= 0.05) { | |
// editOwnProfile() | |
// } | |
// if (Random(0, 1) <= 0.02) { | |
// sendMessageToFriend() | |
// } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment