Inspiration
We were interested with how the TikTok algorithm chooses certain videos to go viral, so we built an app that mimics an algorithm that decides what videos go viral.
What it does
The app decides whether or not a video has potential to go viral or not based on different elements such as duration of video, type of video, etc.
How we built it
We first designed what the app would look like, and chose to color code the screens to TikTok colors. We then planned what questions we wanted to ask, and mapped out how the app would work. We then started coding the program and based off what the user answered for the questions, we would add a certain amount of points to a variable that stored how viral the video could become. If the total amount of points exceeded a certain number, then that video would be considered to have viral potential.
Challenges we ran into
We ran into some problems while coding, since the program wasn't outputting the correct results and number of points. We had to troubleshoot that, and after moving some code around, we were able to fix the problems and the program started running smoothly.
Accomplishments that we're proud of
We were proud of coming up with an idea all by ourselves, being able to code an entire program in 2 days, and working around each others schedules.
What we learned
We learned how to work with each other, time management, how to troubleshoot code, and how to design an app.
What's next for Hot or Not
We are going to upgrade the code to ask more questions, and provide more details on the results screen.
Code source
var viral_number = 0; onEvent("welcomeScreen_button", "click", function( ) { setScreen("questionScreen"); }); onEvent("questionScreen_resultsButton", "click", function( ) { var vidLength = getText("questionScreen_1options"); if (vidLength == "Under 15 seconds") { viral_number = viral_number + 20; } else if ((vidLength == "15-30 seconds")) { viral_number = viral_number + 10; } else { viral_number = viral_number + 0; } var trend = getText("questionScreen_2answers"); if (trend == "Yes") { viral_number = viral_number+20; } else { viral_number = viral_number+0; } var typeVid = getText("questionScreen_3answers"); if (typeVid == "Lipsync" || typeVid == "Dance") { viral_number = viral_number+30; } else if (typeVid == "Educational" || typeVid == "Storytime") { viral_number = viral_number+20; } else { viral_number = viral_number+10; } if (viral_number >= 40) { setScreen("viral"); setText("viral_viralNumber", "#"+viral_number); } else { setScreen("notviral"); setText("notviral_number", "#"+viral_number); } }); onEvent("homeButton", "click", function( ) { setScreen("welcomeScreen"); setText("questionScreen_1options", "Choose"); setText("questionScreen_2answers", "Choose"); setText("questionScreen_3answers", "Choose"); viral_number = 0; }); onEvent("notviral_backtostart", "click", function( ) { setScreen("welcomeScreen"); setText("questionScreen_1options", "Choose"); setText("questionScreen_2answers", "Choose"); setText("questionScreen_3answers", "Choose"); viral_number = 0; });
Code link
https://studio.code.org/projects/applab/ayPY1ZBdnn8U1G3KpK8CV9NOCHXUm6L-BMamyIRn4P0
Log in or sign up for Devpost to join the conversation.