Giter Site home page Giter Site logo

thatnerduknow / financial-disclosures Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 0.0 735 KB

Twitter Bot Tracking every Congress members financial disclosure documents freely available through the STOCK act. Follow @CongressionalFD

JavaScript 2.60% TypeScript 97.40%
finance government twitter twitter-bot

financial-disclosures's Introduction

A man getting hit in the face after stepping on a rake after doing a kickflip on said rake

financial-disclosures's People

Contributors

dependabot[bot] avatar snyk-bot avatar thatnerduknow avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

financial-disclosures's Issues

First run tries to open thousands of instances of imagemagick

This is causes by trying to run downloadAndProcessPDF() within records.forEach(). the way it should be done should look something like this

const arr = [1, 2, 3];

await arr.reduce(async (memo, i) => {
	await memo;
	await sleep(10 - i);
	console.log(i);
}, undefined);

// 1
// 2
// 3

console.log("Finished async");
// Finished async

This should only allow one call to downloadAndProcessPDF() at once

Need better tests

The current test suite relies too much on side effects. For example, the test suite for downloadAndProcessPDF() is dependent on both an HTTP request and im.convert() which produces side effects to the file system and is dependent on a working installation of imagemagick and ghostscript which we can't expect a runner like github actions to have in place. methods that have side effects need to be mocked in the tests at the very least with a stub

Implement MongoDB connection instead of using a JSON file to keep track of records

I really wanted to use mongodb from the start but my personal server doesn't support AVX instructions and I was in a hurry so I bodged together a solution backed by a JSON file located in the project directory. I won't be able to host application data on my home server however the pricing for mongodb cloud looks to be fairly sane and considering the amount of data we're talking about here it would be worth implementing it since I have more faith in typeORM than my solution ๐Ÿ˜„

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.