Coder Social home page Coder Social logo

alertdcio's Introduction

#AlertDC.io

About

AlertDC was created in response to Washington, DC, Police's announcement that they would no longer tweet breaking crime alerts, but instead send alerts by text and email through the DC Alert system. There was quickly a public outcry in response.

Within 24 hours of the announcement, I created AlertDC to fill the gap.

###Technologies Used

  • Python 3.5
  • Flask
  • PostgreSQL
  • Beautiful Soup 4
  • TweePy Twitter API Wrapper
  • Hosted on Heroku

###Methods AlertDC contains two main components within one application. #####Scraper The scraper monitors a public RSS feed of the official DC Alert system. The page is loaded periodically and any entries present are checked against a database of alerts that were already tweeted. If the alert matches a previous alert, a tweet is not issued.

The scraper runs every time a specific page of the Flask application is requested. A Cron job on a remote Linux server requests this page at regular intervals.

Splitting the Cron job and the application in this way allow the application to have more reliable uptime while avoiding Heroku's additional monthly fees for Cron jobs.

#####Alert Hosting The alerts are committed to a database unaltered and unabridged. During the process of committing each alert to the database, a base 62 identifier is created from the entry ID. This transformed ID is used as a URL parameter for hosted alerts.

In this way, more than 238,000 alerts can be hosted while limiting the URL parameter length to three characters or fewer.

Each alert is hosted in its full form with an accompanying time stamp from when it was collected by the app.

###App Evolution #####MVP The application was initially launched in it's MVP state. Crime alerts were tweeted and (frequently) truncated if they reached more than 140 characters.

#####Hosted Alerts Tweets are truncated at 117 characters in order to make room for a URL to alertdc.io/t/{{base_62_id}}. The entire text of the tweet is made available here in a mobile friendly layout.

#####Future Update Alerts are issued from the official source with a Police District ID tied to each. Each district corresponds to a geographic area within Washington, DC. The next step is to allow alerts on AlertDC.io to be filtered by police district.

alertdcio's People

Contributors

michaelmahony avatar

Watchers

James Cloos avatar  avatar

alertdcio's Issues

Update for 280 char tweet limit

Enjoy the Twitter account โ€“ would be great to get more info per tweet, as now possible with Twitter 280 char limit.

Looks like there's some logic that might keep this from being just trivial number updates.

Appreciate the consideration.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.