Probably A Dog Pic is just what the name advertises. It tweets photos from Flickr that are tagged "dogs". Usually photos tagged "dogs" have one or more dogs in them, but sometimes they don't. Most of the time there's a dog though.
Initially the bot just searched Flickr for any photos, however lots of people photograph their dogs outdoors, so I felt that having it be seasonally representative (though mainly for the northern hemisphere, I assume) was kind of neat. As such, all photos it posts are taken within the last two weeks of the current day (though not necessarily on the same year). For example if it's January 14th, 2015, then all posted photos will be ones taken January 1st through the 14th.
The photos are acquired via a Flickr photo search. Here's the lazy search algorithm and search parameters I used, if you're interested:
$yrs = 86400 * 365 * mt_rand(0, 5); $start = (time() - (86400 * 14)) - $yrs; $end = time() - $yrs; $params = array( 'sort' => "interestingness-desc", 'safe_search' => 2, 'content_type' => 1, 'per_page' => 15, 'tags' => implode(',', $tags), 'tag_mode' => "all", 'extras' => "tags,license", 'min_taken_date' => $start, 'max_taken_date' => $end, );
It also does some basic filtering on the tags of each image. Sometimes things get uploaded to Flickr as an attempt to game the tags system, so it checks for some "suspicious" tags and also the number of tags (things with a ton of tags are often non-relevant). If the counts for all those things are above a certain threshold then it rejects the photo. It's a pretty simple system but it works fairly well.
After that one image is picked at random and an md5 hash of the image URL is stored. The last 300 hashes are stored and if a URL returned by the API matches one then it won't be re-posted. 300 covers over 16 days worth of photos, so in theory there shouldn't be any repeats.
The bot used to use a different search/cache mechanism (before August 25th, 2015) so if you see duplicates in the feed that's probably why. The new bot could potentially post duplicates as well, but that's future me's problem.
If you want to know anything else, feel free to ask me on Twitter.
Here's A Dog (Probably)
Since you were nice enough to read this far, here's your reward. This is the most recent (probable) dog photo: