A being of pure energy and light that exists solely to fav your selfies.
Copy twitter_credentials to .twitter_credentials and replace with credentials from your Twitter developer account.
1.0.3 - Only consider tweets with a single link. Change max hashtag search string. Randomly tweet Anamanaguchi lyrics. 1.0.2 - Set max # characters in tweet. Filter out tweets that start with "when", as it's highly predictive of a meme. Redirect standard error to log. Don't favorite more than one tweet by a user in the same round. 1.0.1 - Fixed bug where hashtag filtering wasn't working if first hastag was #selfie. 1.0.0 - Initial release.
- Cron runs script at predetermined interval.
- Authenticate with Twitter.
- Grab last known Twitter ID from text file.
- Request tweets with the word selfie, with a few restrictions.
- For each tweet in the response, filter out tweets:
- older than last known ID,
- that don't contain the word selfie,
- that don't have a Twitter hosted image, or have more than one such image,
- having @ mentions,
- having hastags, unless only one that's #selfie,
- that don't have 1 or 2 faces as detected by a majority of OpenCV's frontal face algorithms.
- Randonly picks at most 3 tweets to favorite.
- Saves the most recently seen Tweet ID.
- Randomly tweet lyrics from Anamanaguchi's (T-T)b.
- Keyword blacklist.
Code is available under the MIT license. See the included LICENSE file for details.