<commit_before># [AwareOSU](http://cailinpitt.github.io/AwareOSU/)
Be aware of crimes around the campus area.

# Background
OSU students (well, college students in general) enjoy being safe. Whenever a crime occurs on campus that has a continuing safety threat, OSU sends every student and staff an email briefly explaining the crime. However, OSU doesn't send crime alerts for all crimes that occur *on and around* campus (where many students live). The reality is that we live in a dangerous world, and we want to be aware of what is happening around us.

# Features
Program runs once every day (using a CRON job), webscrapes the [Columbus Police Department's unofficial web report portal](http://www.columbuspolice.org/reports/) (to find all crimes committed in zone 4, more on zone 4 later) and the [OSU Police department's daily log system](http://www.ps.ohio-state.edu/police/daily_log/view.php?date=yesterday), finds the previous days crimes, and emails the list of crimes to a Google Group of users who signed up for the mailing list.

# Great overview. What is the code actually doing?
This Ruby program utilizes three great gems, Mechanize, Nokogiri, and Mail. This program visits the CPD web portal and OSU PD online log system (listed above) using Mechanize, parses the HTML of the search page containing all crimes committed yesterday using Nokogiri, and sends the information out in a HTML table using Mail.

# Images
#### Email from AwareOSU
![Email from AwareOSU](https://raw.githubusercontent.com/CailinPitt/AwareOSU/master/images/fullEmail.PNG)

---

#### Looks good on mobile too
<img src="https://raw.githubusercontent.com/CailinPitt/AwareOSU/master/images/IMG_2862.jpg" alt="Mobile" width="250" height="445"/>

---

#### Say hi to the Raspberry Pi that runs AwareOSU every morning!
![Raspberry Pi](https://raw.githubusercontent.com/CailinPitt/AwareOSU/master/images/pi.png)

---
#### Off-campus crime information is pulled from Zone 4 (contains Precincts 2, 3, 4, and 5), visualized here
![Zone 4](https://raw.githubusercontent.com/CailinPitt/AwareOSU/master/images/zone4.PNG)

# Why are some crimes listed multiple times?
For example:

![Sometimes you may see crimes listed multiple times in a digest](https://raw.githubusercontent.com/CailinPitt/AwareOSU/master/images/repeat.PNG)

This is because some crimes may have multiple victims, as seen on the Columbus Police Department's web portal:
![Multiple crimes](https://raw.githubusercontent.com/CailinPitt/AwareOSU/master/images/repeat1.PNG)

Currently, victim names aren't included in the digest. Even though this is publically accessible information, I'm not sure how comfortable people would feel with names being emailed to the 400+ AwareOSU users.

# What does the shell script do?
My Pi sometimes runs into an issue where it has trouble staying connected to the Internet while using an ethernet connection. It will say that it has a connection, but in actuality I cannot access the internet. This seems to be a semi-common problem among Pis, and this also causes problems for AwareOSU since it can't access the internet if there isn't a connection. This script resets the ethernet connection every morning one minute before AwareOSU is scheduled to run, ensuring that the Pi has a valid, working internet connection.

# Goals
1. Develop Android App (no current plans for iPhone because it's $100/year to be an iOS developer, poor college student problems)

# How to sign up
Visit the [AwareOSU Google form](http://goo.gl/forms/Oy5kZ4xHbX) to sign-up.

# Milestones
* 10/27/2015 - AwareOSU has 400 users (note that 10/27/2015 was the day OSU recieved an online threat).

* 10/27/2015 - AwareOSU has 300 users.

* 10/27/2015 - AwareOSU has 200 users.

* 10/24/2015 - AwareOSU is now running from a Raspberry Pi! What does this mean? Basically, this means that AwareOSU is just about fully automated. The only thing I do now is add emails to the Google Group of people who have subscribed, and the Pi uses a CRON job to run Aware OSU every morning at 10:15.

* 10/22/2015 - Program now searches and retrieves on-campus crimes, in addition to off-campus crimes. 

* 10/17/2015 - AwareOSU has 100 users.

* 10/17/2015 - Apparently Google only lets users send out a max of 100 emails/day, so the <EMAIL> account got suspended for a day. From now on, I will be using a Google Group to mass email everyone who signed up through the Google Form. For future software engineers: this is why we test every aspect of our code.

* 10/16/2015 - AwareOSU is released.

# Press
* [Students for Concealed Carry](http://concealedcampus.org/2015/10/students-for-concealed-carry-applauds-student-led-crime-awareness-initiative/)
* [Lantern TV](https://youtu.be/MAaY5FkLQqI?t=1m51s)
* [The Columbus Dispatch](http://www.dispatch.com/content/stories/local/2015/11/24/app-gathers-osu-area-cop-reports.html)

# Disclaimer
[Crimes listed on CPD's web portal is not representative of all crimes that have occurred](http://www.columbuspolice.org/reports/About).<commit_msg>Updated number of users on README<commit_after># [AwareOSU](http://cailinpitt.github.io/AwareOSU/)
Be aware of crimes around the campus area.

# Background
OSU students (well, college students in general) enjoy being safe. Whenever a crime occurs on campus that has a continuing safety threat, OSU sends every student and staff an email briefly explaining the crime. However, OSU doesn't send crime alerts for all crimes that occur *on and around* campus (where many students live). The reality is that we live in a dangerous world, and we want to be aware of what is happening around us.

# Features
Program runs once every day (using a CRON job), webscrapes the [Columbus Police Department's unofficial web report portal](http://www.columbuspolice.org/reports/) (to find all crimes committed in zone 4, more on zone 4 later) and the [OSU Police department's daily log system](http://www.ps.ohio-state.edu/police/daily_log/view.php?date=yesterday), finds the previous days crimes, and emails the list of crimes to a Google Group of users who signed up for the mailing list.

# Great overview. What is the code actually doing?
This Ruby program utilizes three great gems, Mechanize, Nokogiri, and Mail. This program visits the CPD web portal and OSU PD online log system (listed above) using Mechanize, parses the HTML of the search page containing all crimes committed yesterday using Nokogiri, and sends the information out in a HTML table using Mail.

# Images
#### Email from AwareOSU
![Email from AwareOSU](https://raw.githubusercontent.com/CailinPitt/AwareOSU/master/images/fullEmail.PNG)

---

#### Looks good on mobile too
<img src="https://raw.githubusercontent.com/CailinPitt/AwareOSU/master/images/IMG_2862.jpg" alt="Mobile" width="250" height="445"/>

---

#### Say hi to the Raspberry Pi that runs AwareOSU every morning!
![Raspberry Pi](https://raw.githubusercontent.com/CailinPitt/AwareOSU/master/images/pi.png)

---
#### Off-campus crime information is pulled from Zone 4 (contains Precincts 2, 3, 4, and 5), visualized here
![Zone 4](https://raw.githubusercontent.com/CailinPitt/AwareOSU/master/images/zone4.PNG)

# Why are some crimes listed multiple times?
For example:

![Sometimes you may see crimes listed multiple times in a digest](https://raw.githubusercontent.com/CailinPitt/AwareOSU/master/images/repeat.PNG)

This is because some crimes may have multiple victims, as seen on the Columbus Police Department's web portal:
![Multiple crimes](https://raw.githubusercontent.com/CailinPitt/AwareOSU/master/images/repeat1.PNG)

Currently, victim names aren't included in the digest. Even though this is publically accessible information, I'm not sure how comfortable people would feel with names being emailed to the 400+ AwareOSU users.

# What does the shell script do?
My Pi sometimes runs into an issue where it has trouble staying connected to the Internet while using an ethernet connection. It will say that it has a connection, but in actuality I cannot access the internet. This seems to be a semi-common problem among Pis, and this also causes problems for AwareOSU since it can't access the internet if there isn't a connection. This script resets the ethernet connection every morning one minute before AwareOSU is scheduled to run, ensuring that the Pi has a valid, working internet connection.

# Goals
1. Develop Android App (no current plans for iPhone because it's $100/year to be an iOS developer, poor college student problems)

# How to sign up
Visit the [AwareOSU Google form](http://goo.gl/forms/Oy5kZ4xHbX) to sign-up.

# Milestones
* 11/24/2015 - AwareOSU has 500 users.

* 10/27/2015 - AwareOSU has 400 users (note that 10/27/2015 was the day OSU recieved an online threat).

* 10/27/2015 - AwareOSU has 300 users.

* 10/27/2015 - AwareOSU has 200 users.

* 10/24/2015 - AwareOSU is now running from a Raspberry Pi! What does this mean? Basically, this means that AwareOSU is just about fully automated. The only thing I do now is add emails to the Google Group of people who have subscribed, and the Pi uses a CRON job to run Aware OSU every morning at 10:15.

* 10/22/2015 - Program now searches and retrieves on-campus crimes, in addition to off-campus crimes. 

* 10/17/2015 - AwareOSU has 100 users.

* 10/17/2015 - Apparently Google only lets users send out a max of 100 emails/day, so the <EMAIL> account got suspended for a day. From now on, I will be using a Google Group to mass email everyone who signed up through the Google Form. For future software engineers: this is why we test every aspect of our code.

* 10/16/2015 - AwareOSU is released.

# Press
* [Students for Concealed Carry](http://concealedcampus.org/2015/10/students-for-concealed-carry-applauds-student-led-crime-awareness-initiative/)
* [Lantern TV](https://youtu.be/MAaY5FkLQqI?t=1m51s)
* [The Columbus Dispatch](http://www.dispatch.com/content/stories/local/2015/11/24/app-gathers-osu-area-cop-reports.html)

# Disclaimer
[Crimes listed on CPD's web portal is not representative of all crimes that have occurred](http://www.columbuspolice.org/reports/About).
{'fraction_non_alphanumeric': 0.08061325420375866, 'fraction_numerical': 0.028387734915924827, 'mean_word_length': 4.477248104008668, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 14, 'lorem ipsum': 0, 'www.': 8, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5719715', 'n_tokens_mistral': 3183, 'n_tokens_neox': 2885, 'n_words': 1309}