Code Monkey home page Code Monkey logo

govwebsites's Introduction

govWebsites

Directory structure:

The pipeline is in the folders 01_* to 07_* and should be executed in that order. Files within these folders also have this structure. Files without a number prefix will be called by other files and do not need to be run explicitly. Files with identical prefixes can be run in any order.

The 01_other* folders will contain plots and figures that aren't produced in any of the other scripts. Ideally, we should move every plot- and table-producing script in here at some point, but currently some of them are contained in scripts that als do something else.

Most of these folders have subfolders called 'out', where the output used later is saved.

The manuscript will continue to sit in the 'paper' folder. This folder is exactly identical and should hopefully be cleaned up too at some point.

The diagnostics folder is for scripts that don't end up in the paper but have some use for us anyway.

The 00_scrapeCovariates folder will contain the scripts necessary for scraping all the data, urls, etc. that are used for the rest. It will take me longer to get all of these in order, for now I am working on getting everything in the 01_* to 07_* folders to work properly.

govwebsites's People

Contributors

markusneumann avatar bdesmarais avatar flinder avatar

Stargazers

Anton Prokopyev avatar

Watchers

James Cloos avatar  avatar  avatar

govwebsites's Issues

progress report

We should be able to add many more cities to our data---casting a national web, if we can analyze local campaign contribution data to classify the partisanship of mayors. This would broaden the generalizability of our results.

city websites for top 100 cities in the US

This data consists of 1,467,938 files (only txt, html, pdf, doc, and docx), totaling 857.2 GB

I am not sure what to do with this data right now, since (a) I always NEED TO (and there are good reasons for that) make backups before I do anything to the files, but in this case, I can't zip them because (at least) one website has file paths so long that the compression program can't handle them; and another 800GB backup seems really excessive (b) any analysis on this will take ages, and in some cases, probably won't be possible at all.

The main culprits are San Diego, New York and Chicago, which are around 30-60GB each

using mayor's campaign websites as partisan ground truth

I am starting to have more and more doubts about this approach, recently fueled by the fact that I noticed that mayors later re-use their mayoral campaign websites as their campaign websites for running for governor/congress, etc. Basically, there is no guarantee that the current state of their campaign website reflects the way it was during the campaign. At the very least, a lot of mayors often seem to make a 'mission accomplished' post in which they brag about their victory - which obviously wasn't there during the campaign.

Also, the results, while admittedly a lot better when incorporating the mayors of the top 100 cities (see figure 6 (cosine corrplot) and table 13 (bootstrapped lower/upper bounds) in the manuscript), they still don't really prove anything.

some websites can't be downloaded anymore

As noted previously, there are 30 websites on our list of URLs that SHOULD be downloadable, but for some reason aren't. I've now explicitly tried to focus only on these, but wget just can't get them. Notably, this includes Philadelphia and, much more importantly, New Orleans. NOLA was still downloadable back in the fall and contained quite a lot of content, so the question is: do we still include our old version of the website in the paper?

impediments to creating an R package

This issue lists the reasons we might have difficulties turning this project into an R package. These aren't urgent problems that need to be responded to immediately, I just want to maintain a list of concerns that need to be kept in mind. Consequently I will update this post rather than adding additional posts, if anything else comes up.

Unix-only libraries:
wget
libmagic (determining file types) (works on Windows according to the Github page)

Python packages:
spaCy (lemmatization) (spacyR works well enough now)
Selenium (webscraping on interactive websites) (in theory there is an R version, but it is terrible)

R packages not on CRAN:
SpeedReader (fightin' words) (not used any more)
wand (R interface to libmagic)

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.