Since April 2016, Facebook has been automatically adding alt tags to all images with keywords representing the content of the images:
<img csrc="https://facebook.com/some-url.jpg"
alt="Image may contain: golf, grass, outdoor and nature"
width="316" height="237">
They are labeling the images using a Deep ConvNet built by Facebook's FAIR team team.
On one hand, this is really great. It improves accessibility for blind users who depend on screen readers which are only capable of processing text. But raises privacy concerns too.
Thank you ageitgey for originally finding out about this.
Anyhow, this script uses this addition by Facebook to it's advantage. MemeDensity reads alt tags of the images in your newsfeed and lets you know the quantity of memes on your feed.
Since Facebook doesn't directly allow fetching the newsfeed from its API, this script uses Selenium and PhantomJS to simulate a surf through the newsfeed.
brew install phantomjs
sudo apt-get install phantomjs
Download and set in environment variables
Check out the latest release
$ git clone https://github.com/kalbhor/MemeDensity
$ cd MemeDensity
$ python setup.py install
$ pip install memedensity
If you'll be using a different webdriver (Not PhantomJS), simply edit MemeDensity/command_line.py and add your webdriver
driver = webdriver.PhantomJS()
optional arguments:
-h, --help show this help message and exit
-C, --count How many times to scroll newsfeed (default = 5)
-L, --login Input login credentials
-v, --verbose Shows meme urls
$ memedensity
Currently this project is in its infancy and issues are bound to arise. If the script throws an exception, please make sure to check your running processes to see whether the webdriver has been closed or not. To contribute, post issues without hesitation and open pull requests to add/improve features.