League of Legends (LCS)
League of Legends (Challenger)
This is a Twitter bot that retweets posts from CLG related Twitter accounts. Every five minutes, it looks for new Tweets from the above accounts and, if found, retweets them. It ignores reply Tweets. Neither this bot nor I are affiliated with CLG. This is a personal project I'm maintaining.
After finishing a small bot that tracks Facebook group chats, I began thinking about other bot projects I could work on to support my personal hobbies and interests. Naturally that led to this, a hub that keeps up with CLG news and events. I've been a big fan of the team since watching them in League Season 1 and have been following them through the thick and thin ever since.
The basic idea for this bot was to simply track the posts of CLG players and staff. By retweeting all their posts, I'd be able to keep up with CLG news, and also at a more personable level. From a cursory search, I couldn't find any site or feature that offered this kind of group following feature, so I wanted to implement my own. I do have my own Twitter account, but I follow so many people that it's not particularly helpful in keeping up to date with a particular organization or group.
The way the bot works is that it first scrapes this web page's Currently Following section to find the corresponding Twitter handles it should keep track of. Conveniently, this allows me to change the list of followers on the fly. I can edit this page in browser rather than having to mess with uploading/managing docs somewhere. This list includes mostly all CLG players, important staff, and managers. I've taken the liberty to leave off sponsors and some smaller roles like article contributors.
Once it has the list of accounts, it uses the Twitter API/library to look for each person's recent Tweets. To stay in context, I've removed Twitter replies, as through testing I found these messages to be excessive and out of place. I've decided, however, to keep other people's retweets, as though these too could be somewhat irrelevant, they are more publicly viewable and often point to some interesting posts.
Twitter keeps track of each individual Tweet with a special id. To help save some crunching time, I keep track of the most recent Tweet id that I've retweeted. The API allows a special parameter, since_id, that specifies from what point to send back responses. So, for instance, if I specified since_id 123, it will only give me back Tweets with id 124 and above.
That's pretty much the gist of program logistics. The last step is to repeat the above process on a 5 minute timer. The Twitter API has a max request limit, so you can't just keep asking it for info. I also don't need to grab so many responses at once since people don't post that fast anyways. Saves some unnecessary computation time, so a win-win.
Overall, this was a pretty cool project. Outside of this, I don't really have another web-related project I'm cooking up right now, so I don't know if I'll do a lot more web dev in the foreseeable future. For now, I guess it's back to osu! storyboarding and maybe some game programming eventually, I don't know.
As of July 2017, I've decided to retire this bot in lieu of not really using it or maintaining it that well. There are Twitter lists that exist which better do its job anyways, see kibou511's list.