Created
May 16, 2017 10:46
-
-
Save DustinAlandzes/3428781030579bdfcf58e056fb3c60d2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #https://github.com/schollz/howmanypeoplearearound | |
| startDate = datetime.today() - datetime.timedelta(days=1) # today - 1day aka yesterday | |
| endDate = datetime.today() | |
| strengthThreshold = -60 | |
| probes = Probe.query.filter_by(Probe.first_seen > startDate) # first_seen > startDate | |
| .filter_by(Probe.last_seen < endDate) # last_seen < endDate | |
| .filter_by(Probe.rssi > strengthThreshold).all() # rssi > strengthThreshold | |
| macs = [] | |
| for probe in probes: | |
| if probe.mac not in macs: | |
| macs.append(probe.mac) | |
| numProbes = len(probes) | |
| numUniques = len(macs) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment