A daily horoscope is scraped from the web, shuffled, and the signs removed so that you do not know which horoscope is for which sign. A key is provided at the end.
Written for Python2. Requires the BeautifulSoup library. Examples to run from the terminal are provided below.
The default:
./astrology_experiment.py
creates a file astrology_experiment.txt with yesterday's text from horoscope.com. If you want today's horoscope instead, try the -t (--today) flag:
./astrology_experiment.py -t -f horoscope_today.txt
Here the -f (--file_out) flag was used to specify the output file name (horoscope_today.txt). You can also try the shorter horoscope from sfgate.com, which downloads a lot quicker, by using the -s (--source) flag:
./astrology_experiment.py -s sfgate -t -f sfgate_today.txt
Again, we specified the output file name here (sfgate_today.txt).
Make a group of people read the entire horoscope and ask them to tell you which one best matches their day yesterday. Then, show them the key and ask who got their horoscope "right". Go on to discuss how accurate are the predictions of astrology.
An implementation file is included in this repo. This activity was created by the Astronomical Society of the Pacific.
I run this experiment on the first day of my introductory astronomy classes for non-majors. So far all my results have been around 8% "accurate", a suspicious 1/12 chance ... hmmm ...
Have fun!
It is possible that the websites from which the horoscopes are downloaded will change their url format, in which case this code will not work. You can try to fix that by looking at the base and url variables inside the code. Otherwise contact me and I will try to keep this up-to-date.