Skip to content

Uses SOCRATA API to scrape NYPD Reports API, and the Twitter API to post to account timeline in a small and readable format

License

Notifications You must be signed in to change notification settings

kyletimmermans/nypd-twitter-tool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

Version 2.0 NodeJS 12.18.4 Latest Commit kyletimmermans Twitter

NYPD Twitter Tool

This tool collects reported incidents from the NYPD API which is an API that returns NYPD reported incidents into a json format. The tool then connects to a developer twitter account and tweets the incidents that were reported that day into a small and readable report format. See @fordhamcyberpa1 on Twitter for the final product!


NodeJS Requirements
jsdom
jquery
twitter
sleep

Screenshots

Result

Result

Backend

Backend


Clear Duplicate Algorithm

1) Initialize yesterday var at 11:59 PM (Next day this date will actually be yesterday)
2) Next day at 12:00 AM, clear anything out of duplicate array that has the attribute: date = yesterday (So we don't clear any data from today by accident)
3) Only get items that have: date = today (To prevent getting any of yesterday's data)
4) Go back to step 1

Note: Originally built with the idea that the NYPD API was a live update, turns out that it's delayed by two days. The dates for data can be delayed as long as a year.

About

Uses SOCRATA API to scrape NYPD Reports API, and the Twitter API to post to account timeline in a small and readable format

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published