An infrared emitter (LED) opposed to an infrared sensor on a gate through which the bees enter and exit would seem to be the simplest solution. But I do not know to which extent bees are disturbed by IR light of a certain wavelength. A microcontroller would pulse the emitter LED and would compare the received signal from the sensor and count whenever it considers it valid. Pulsing the led instead of continuously lighting is makes the setup better resist ambient lighting conditions. With a (
simple ir photo transistor (with led) you would need to filter out/demodulate an the pulsing frequency in software. Or a
little more advanced detector would do this automatically (at a specific pulse frequency). The digital output signal indicates that it has received such IR flashes.
In order to measure direction of movement you could have 2 detectors some space apart (with the emitter opposed illuminating both). A bee would then first interrupt one detector before the other indicating it's direction. But it might get complicated in counting when multiple bees can exit or enter the hive gate and interrupt the beam simultaneously.
However, you would probably have this outdoors. So it might need better protection against the elements. And you might need to look around at other vendors than Sparkfun to supply that. I don't have suggestions. But you could use and test it as a proof of concept indoors.
After this is working, and only then, would I consider making this wireless and put the data onto the web. Because wireless internet acces in the outdoors is a whole other ballgame.
Or if bees are sensitive to IR light this could be used as another sort of presence detector:
http://dlacko.org/blog/2017/01/08/ardui ... generator/