From 5b95b6986a7821e58a98e4bb47bffe9efc9eb8fc Mon Sep 17 00:00:00 2001
From: aCandidMind
Date: Fri, 22 Sep 2017 12:50:34 +0200
Subject: [PATCH 01/41] Procfile & static.json for create-react-app-buildpack
---
Procfile | 2 +-
static.json | 9 +++++++++
2 files changed, 10 insertions(+), 1 deletion(-)
create mode 100644 static.json
diff --git a/Procfile b/Procfile
index d39ebe0..0900e0b 100644
--- a/Procfile
+++ b/Procfile
@@ -1 +1 @@
-web: FLASK_ENV=production webapi/run_analytics_server.sh
+web: bin/boot
diff --git a/static.json b/static.json
new file mode 100644
index 0000000..358a41c
--- /dev/null
+++ b/static.json
@@ -0,0 +1,9 @@
+{
+ "root": "web/build/",
+ "https_only": true,
+ "headers": {
+ "/**": {
+ "Strict-Transport-Security": "max-age=7776000"
+ }
+ }
+}
From 7f21529e8782b3e980cf8600bba3b75655f7f03b Mon Sep 17 00:00:00 2001
From: aCandidMind
Date: Fri, 22 Sep 2017 14:54:18 +0200
Subject: [PATCH 02/41] Move web/ top-level to comply with buildpack
mars/create-react-app-buildpack
---
.gitignore | 14 +-
{web/json => json}/Achim_P.json | 0
{web/json => json}/agnieszka_mdb.json | 0
{web/json => json}/parties.json | 0
{web/json => json}/politicians.json | 0
{web/json => json}/topics.json | 0
web/package.json => package.json | 0
polbotcheck/db.py | 2 +-
{web/public => public}/candidates.json | 0
{web/public => public}/favicon.ico | Bin
{web/public => public}/index.html | 0
{web/src => src}/App.css | 0
{web/src => src}/App.js | 0
{web/src => src}/App.test.js | 0
{web/src => src}/BarChart.js | 0
{web/src => src}/MemberPage.js | 0
{web/src => src}/Party.js | 0
{web/src => src}/PieChart.js | 0
{web/src => src}/index.css | 0
{web/src => src}/index.js | 0
{web/src => src}/logo.svg | 0
static.json | 1 -
web/.gitignore | 18 -
web/README.md | 1582 ------------------------
24 files changed, 14 insertions(+), 1603 deletions(-)
rename {web/json => json}/Achim_P.json (100%)
rename {web/json => json}/agnieszka_mdb.json (100%)
rename {web/json => json}/parties.json (100%)
rename {web/json => json}/politicians.json (100%)
rename {web/json => json}/topics.json (100%)
rename web/package.json => package.json (100%)
rename {web/public => public}/candidates.json (100%)
rename {web/public => public}/favicon.ico (100%)
rename {web/public => public}/index.html (100%)
rename {web/src => src}/App.css (100%)
rename {web/src => src}/App.js (100%)
rename {web/src => src}/App.test.js (100%)
rename {web/src => src}/BarChart.js (100%)
rename {web/src => src}/MemberPage.js (100%)
rename {web/src => src}/Party.js (100%)
rename {web/src => src}/PieChart.js (100%)
rename {web/src => src}/index.css (100%)
rename {web/src => src}/index.js (100%)
rename {web/src => src}/logo.svg (100%)
delete mode 100644 web/.gitignore
delete mode 100644 web/README.md
diff --git a/.gitignore b/.gitignore
index 7627e45..2d86a41 100644
--- a/.gitignore
+++ b/.gitignore
@@ -12,5 +12,17 @@ dev_*.ipynb
.DS_Store
node_modules/
polbotcheck/dump/
-web/Release.key
+Release.key
polbotcheck/__pycache__/
+
+
+# testing
+/coverage
+
+# production
+/build
+
+# misc
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
diff --git a/web/json/Achim_P.json b/json/Achim_P.json
similarity index 100%
rename from web/json/Achim_P.json
rename to json/Achim_P.json
diff --git a/web/json/agnieszka_mdb.json b/json/agnieszka_mdb.json
similarity index 100%
rename from web/json/agnieszka_mdb.json
rename to json/agnieszka_mdb.json
diff --git a/web/json/parties.json b/json/parties.json
similarity index 100%
rename from web/json/parties.json
rename to json/parties.json
diff --git a/web/json/politicians.json b/json/politicians.json
similarity index 100%
rename from web/json/politicians.json
rename to json/politicians.json
diff --git a/web/json/topics.json b/json/topics.json
similarity index 100%
rename from web/json/topics.json
rename to json/topics.json
diff --git a/web/package.json b/package.json
similarity index 100%
rename from web/package.json
rename to package.json
diff --git a/polbotcheck/db.py b/polbotcheck/db.py
index 16ad43b..1516449 100644
--- a/polbotcheck/db.py
+++ b/polbotcheck/db.py
@@ -8,7 +8,7 @@
from config.db_credentials import db_credentials
-CANDIDATES_PATH = '../web/public/candidates.json'
+CANDIDATES_PATH = '../public/candidates.json'
# Configure your ArangoDB server connection here
diff --git a/web/public/candidates.json b/public/candidates.json
similarity index 100%
rename from web/public/candidates.json
rename to public/candidates.json
diff --git a/web/public/favicon.ico b/public/favicon.ico
similarity index 100%
rename from web/public/favicon.ico
rename to public/favicon.ico
diff --git a/web/public/index.html b/public/index.html
similarity index 100%
rename from web/public/index.html
rename to public/index.html
diff --git a/web/src/App.css b/src/App.css
similarity index 100%
rename from web/src/App.css
rename to src/App.css
diff --git a/web/src/App.js b/src/App.js
similarity index 100%
rename from web/src/App.js
rename to src/App.js
diff --git a/web/src/App.test.js b/src/App.test.js
similarity index 100%
rename from web/src/App.test.js
rename to src/App.test.js
diff --git a/web/src/BarChart.js b/src/BarChart.js
similarity index 100%
rename from web/src/BarChart.js
rename to src/BarChart.js
diff --git a/web/src/MemberPage.js b/src/MemberPage.js
similarity index 100%
rename from web/src/MemberPage.js
rename to src/MemberPage.js
diff --git a/web/src/Party.js b/src/Party.js
similarity index 100%
rename from web/src/Party.js
rename to src/Party.js
diff --git a/web/src/PieChart.js b/src/PieChart.js
similarity index 100%
rename from web/src/PieChart.js
rename to src/PieChart.js
diff --git a/web/src/index.css b/src/index.css
similarity index 100%
rename from web/src/index.css
rename to src/index.css
diff --git a/web/src/index.js b/src/index.js
similarity index 100%
rename from web/src/index.js
rename to src/index.js
diff --git a/web/src/logo.svg b/src/logo.svg
similarity index 100%
rename from web/src/logo.svg
rename to src/logo.svg
diff --git a/static.json b/static.json
index 358a41c..fa1b605 100644
--- a/static.json
+++ b/static.json
@@ -1,5 +1,4 @@
{
- "root": "web/build/",
"https_only": true,
"headers": {
"/**": {
diff --git a/web/.gitignore b/web/.gitignore
deleted file mode 100644
index 927d17b..0000000
--- a/web/.gitignore
+++ /dev/null
@@ -1,18 +0,0 @@
-# See https://help.github.com/ignore-files/ for more about ignoring files.
-
-# dependencies
-/node_modules
-
-# testing
-/coverage
-
-# production
-/build
-
-# misc
-.DS_Store
-.env
-npm-debug.log*
-yarn-debug.log*
-yarn-error.log*
-
diff --git a/web/README.md b/web/README.md
deleted file mode 100644
index ec1bc31..0000000
--- a/web/README.md
+++ /dev/null
@@ -1,1582 +0,0 @@
-## Starting the project
-
-TL;DR;
- npm install
- npm start
- # open the browser on localhost:3000
-
-_npm install_ is only needed the first time.
-
-
-This project was bootstrapped with [Create React App](https://github.com/facebookincubator/create-react-app).
-
-Below you will find some information on how to perform common tasks.
-You can find the most recent version of this guide [here](https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md).
-
-## Table of Contents
-
-- [Updating to New Releases](#updating-to-new-releases)
-- [Sending Feedback](#sending-feedback)
-- [Folder Structure](#folder-structure)
-- [Available Scripts](#available-scripts)
- - [npm start](#npm-start)
- - [npm test](#npm-test)
- - [npm run build](#npm-run-build)
- - [npm run eject](#npm-run-eject)
-- [Supported Language Features and Polyfills](#supported-language-features-and-polyfills)
-- [Syntax Highlighting in the Editor](#syntax-highlighting-in-the-editor)
-- [Displaying Lint Output in the Editor](#displaying-lint-output-in-the-editor)
-- [Debugging in the Editor](#debugging-in-the-editor)
-- [Changing the Page ``](#changing-the-page-title)
-- [Installing a Dependency](#installing-a-dependency)
-- [Importing a Component](#importing-a-component)
-- [Adding a Stylesheet](#adding-a-stylesheet)
-- [Post-Processing CSS](#post-processing-css)
-- [Adding a CSS Preprocessor (Sass, Less etc.)](#adding-a-css-preprocessor-sass-less-etc)
-- [Adding Images and Fonts](#adding-images-and-fonts)
-- [Using the `public` Folder](#using-the-public-folder)
- - [Changing the HTML](#changing-the-html)
- - [Adding Assets Outside of the Module System](#adding-assets-outside-of-the-module-system)
- - [When to Use the `public` Folder](#when-to-use-the-public-folder)
-- [Using Global Variables](#using-global-variables)
-- [Adding Bootstrap](#adding-bootstrap)
- - [Using a Custom Theme](#using-a-custom-theme)
-- [Adding Flow](#adding-flow)
-- [Adding Custom Environment Variables](#adding-custom-environment-variables)
- - [Referencing Environment Variables in the HTML](#referencing-environment-variables-in-the-html)
- - [Adding Temporary Environment Variables In Your Shell](#adding-temporary-environment-variables-in-your-shell)
- - [Adding Development Environment Variables In `.env`](#adding-development-environment-variables-in-env)
-- [Can I Use Decorators?](#can-i-use-decorators)
-- [Integrating with an API Backend](#integrating-with-an-api-backend)
- - [Node](#node)
- - [Ruby on Rails](#ruby-on-rails)
-- [Proxying API Requests in Development](#proxying-api-requests-in-development)
-- [Using HTTPS in Development](#using-https-in-development)
-- [Generating Dynamic `` Tags on the Server](#generating-dynamic-meta-tags-on-the-server)
-- [Pre-Rendering into Static HTML Files](#pre-rendering-into-static-html-files)
-- [Injecting Data from the Server into the Page](#injecting-data-from-the-server-into-the-page)
-- [Running Tests](#running-tests)
- - [Filename Conventions](#filename-conventions)
- - [Command Line Interface](#command-line-interface)
- - [Version Control Integration](#version-control-integration)
- - [Writing Tests](#writing-tests)
- - [Testing Components](#testing-components)
- - [Using Third Party Assertion Libraries](#using-third-party-assertion-libraries)
- - [Initializing Test Environment](#initializing-test-environment)
- - [Focusing and Excluding Tests](#focusing-and-excluding-tests)
- - [Coverage Reporting](#coverage-reporting)
- - [Continuous Integration](#continuous-integration)
- - [Disabling jsdom](#disabling-jsdom)
- - [Snapshot Testing](#snapshot-testing)
- - [Editor Integration](#editor-integration)
-- [Developing Components in Isolation](#developing-components-in-isolation)
-- [Making a Progressive Web App](#making-a-progressive-web-app)
-- [Deployment](#deployment)
- - [Serving Apps with Client-Side Routing](#serving-apps-with-client-side-routing)
- - [Building for Relative Paths](#building-for-relative-paths)
- - [Azure](#azure)
- - [Firebase](#firebase)
- - [GitHub Pages](#github-pages)
- - [Heroku](#heroku)
- - [Modulus](#modulus)
- - [Netlify](#netlify)
- - [Now](#now)
- - [S3 and CloudFront](#s3-and-cloudfront)
- - [Surge](#surge)
-- [Advanced Configuration](#advanced-configuration)
-- [Troubleshooting](#troubleshooting)
- - [`npm start` doesn’t detect changes](#npm-start-doesnt-detect-changes)
- - [`npm test` hangs on macOS Sierra](#npm-test-hangs-on-macos-sierra)
- - [`npm run build` silently fails](#npm-run-build-silently-fails)
- - [`npm run build` fails on Heroku](#npm-run-build-fails-on-heroku)
-- [Something Missing?](#something-missing)
-
-## Updating to New Releases
-
-Create React App is divided into two packages:
-
-* `create-react-app` is a global command-line utility that you use to create new projects.
-* `react-scripts` is a development dependency in the generated projects (including this one).
-
-You almost never need to update `create-react-app` itself: it delegates all the setup to `react-scripts`.
-
-When you run `create-react-app`, it always creates the project with the latest version of `react-scripts` so you’ll get all the new features and improvements in newly created apps automatically.
-
-To update an existing project to a new version of `react-scripts`, [open the changelog](https://github.com/facebookincubator/create-react-app/blob/master/CHANGELOG.md), find the version you’re currently on (check `package.json` in this folder if you’re not sure), and apply the migration instructions for the newer versions.
-
-In most cases bumping the `react-scripts` version in `package.json` and running `npm install` in this folder should be enough, but it’s good to consult the [changelog](https://github.com/facebookincubator/create-react-app/blob/master/CHANGELOG.md) for potential breaking changes.
-
-We commit to keeping the breaking changes minimal so you can upgrade `react-scripts` painlessly.
-
-## Sending Feedback
-
-We are always open to [your feedback](https://github.com/facebookincubator/create-react-app/issues).
-
-## Folder Structure
-
-After creation, your project should look like this:
-
-```
-my-app/
- README.md
- node_modules/
- package.json
- public/
- index.html
- favicon.ico
- src/
- App.css
- App.js
- App.test.js
- index.css
- index.js
- logo.svg
-```
-
-For the project to build, **these files must exist with exact filenames**:
-
-* `public/index.html` is the page template;
-* `src/index.js` is the JavaScript entry point.
-
-You can delete or rename the other files.
-
-You may create subdirectories inside `src`. For faster rebuilds, only files inside `src` are processed by Webpack.
-You need to **put any JS and CSS files inside `src`**, or Webpack won’t see them.
-
-Only files inside `public` can be used from `public/index.html`.
-Read instructions below for using assets from JavaScript and HTML.
-
-You can, however, create more top-level directories.
-They will not be included in the production build so you can use them for things like documentation.
-
-## Available Scripts
-
-In the project directory, you can run:
-
-### `npm start`
-
-Runs the app in the development mode.
-Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
-
-The page will reload if you make edits.
-You will also see any lint errors in the console.
-
-### `npm test`
-
-Launches the test runner in the interactive watch mode.
-See the section about [running tests](#running-tests) for more information.
-
-### `npm run build`
-
-Builds the app for production to the `build` folder.
-It correctly bundles React in production mode and optimizes the build for the best performance.
-
-The build is minified and the filenames include the hashes.
-Your app is ready to be deployed!
-
-See the section about [deployment](#deployment) for more information.
-
-### `npm run eject`
-
-**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
-
-If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
-
-Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
-
-You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
-
-## Supported Language Features and Polyfills
-
-This project supports a superset of the latest JavaScript standard.
-In addition to [ES6](https://github.com/lukehoban/es6features) syntax features, it also supports:
-
-* [Exponentiation Operator](https://github.com/rwaldron/exponentiation-operator) (ES2016).
-* [Async/await](https://github.com/tc39/ecmascript-asyncawait) (ES2017).
-* [Object Rest/Spread Properties](https://github.com/sebmarkbage/ecmascript-rest-spread) (stage 3 proposal).
-* [Class Fields and Static Properties](https://github.com/tc39/proposal-class-public-fields) (stage 2 proposal).
-* [JSX](https://facebook.github.io/react/docs/introducing-jsx.html) and [Flow](https://flowtype.org/) syntax.
-
-Learn more about [different proposal stages](https://babeljs.io/docs/plugins/#presets-stage-x-experimental-presets-).
-
-While we recommend to use experimental proposals with some caution, Facebook heavily uses these features in the product code, so we intend to provide [codemods](https://medium.com/@cpojer/effective-javascript-codemods-5a6686bb46fb) if any of these proposals change in the future.
-
-Note that **the project only includes a few ES6 [polyfills](https://en.wikipedia.org/wiki/Polyfill)**:
-
-* [`Object.assign()`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) via [`object-assign`](https://github.com/sindresorhus/object-assign).
-* [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) via [`promise`](https://github.com/then/promise).
-* [`fetch()`](https://developer.mozilla.org/en/docs/Web/API/Fetch_API) via [`whatwg-fetch`](https://github.com/github/fetch).
-
-If you use any other ES6+ features that need **runtime support** (such as `Array.from()` or `Symbol`), make sure you are including the appropriate polyfills manually, or that the browsers you are targeting already support them.
-
-## Syntax Highlighting in the Editor
-
-To configure the syntax highlighting in your favorite text editor, head to the [relevant Babel documentation page](https://babeljs.io/docs/editors) and follow the instructions. Some of the most popular editors are covered.
-
-## Displaying Lint Output in the Editor
-
->Note: this feature is available with `react-scripts@0.2.0` and higher.
-
-Some editors, including Sublime Text, Atom, and Visual Studio Code, provide plugins for ESLint.
-
-They are not required for linting. You should see the linter output right in your terminal as well as the browser console. However, if you prefer the lint results to appear right in your editor, there are some extra steps you can do.
-
-You would need to install an ESLint plugin for your editor first.
-
->**A note for Atom `linter-eslint` users**
-
->If you are using the Atom `linter-eslint` plugin, make sure that **Use global ESLint installation** option is checked:
-
->
-
-
->**For Visual Studio Code users**
-
->VS Code ESLint plugin automatically detects Create React App's configuration file. So you do not need to create `eslintrc.json` at the root directory, except when you want to add your own rules. In that case, you should include CRA's config by adding this line:
-
->```js
-{
- // ...
- "extends": "react-app"
-}
-```
-
-Then add this block to the `package.json` file of your project:
-
-```js
-{
- // ...
- "eslintConfig": {
- "extends": "react-app"
- }
-}
-```
-
-Finally, you will need to install some packages *globally*:
-
-```sh
-npm install -g eslint-config-react-app@0.3.0 eslint@3.8.1 babel-eslint@7.0.0 eslint-plugin-react@6.4.1 eslint-plugin-import@2.0.1 eslint-plugin-jsx-a11y@2.2.3 eslint-plugin-flowtype@2.21.0
-```
-
-We recognize that this is suboptimal, but it is currently required due to the way we hide the ESLint dependency. The ESLint team is already [working on a solution to this](https://github.com/eslint/eslint/issues/3458) so this may become unnecessary in a couple of months.
-
-## Debugging in the Editor
-
-**This feature is currently only supported by [Visual Studio Code](https://code.visualstudio.com) editor.**
-
-Visual Studio Code supports live-editing and debugging out of the box with Create React App. This enables you as a developer to write and debug your React code without leaving the editor, and most importantly it enables you to have a continuous development workflow, where context switching is minimal, as you don’t have to switch between tools.
-
-You would need to have the latest version of [VS Code](https://code.visualstudio.com) and VS Code [Chrome Debugger Extension](https://marketplace.visualstudio.com/items?itemName=msjsdiag.debugger-for-chrome) installed.
-
-Then add the block below to your `launch.json` file and put it inside the `.vscode` folder in your app’s root directory.
-
-```json
-{
- "version": "0.2.0",
- "configurations": [{
- "name": "Chrome",
- "type": "chrome",
- "request": "launch",
- "url": "http://localhost:3000",
- "webRoot": "${workspaceRoot}/src",
- "userDataDir": "${workspaceRoot}/.vscode/chrome",
- "sourceMapPathOverrides": {
- "webpack:///src/*": "${webRoot}/*"
- }
- }]
-}
-```
-
-Start your app by running `npm start`, and start debugging in VS Code by pressing `F5` or by clicking the green debug icon. You can now write code, set breakpoints, make changes to the code, and debug your newly modified code—all from your editor.
-
-## Changing the Page ``
-
-You can find the source HTML file in the `public` folder of the generated project. You may edit the `` tag in it to change the title from “React App” to anything else.
-
-Note that normally you wouldn’t edit files in the `public` folder very often. For example, [adding a stylesheet](#adding-a-stylesheet) is done without touching the HTML.
-
-If you need to dynamically update the page title based on the content, you can use the browser [`document.title`](https://developer.mozilla.org/en-US/docs/Web/API/Document/title) API. For more complex scenarios when you want to change the title from React components, you can use [React Helmet](https://github.com/nfl/react-helmet), a third party library.
-
-If you use a custom server for your app in production and want to modify the title before it gets sent to the browser, you can follow advice in [this section](#generating-dynamic-meta-tags-on-the-server). Alternatively, you can pre-build each page as a static HTML file which then loads the JavaScript bundle, which is covered [here](#pre-rendering-into-static-html-files).
-
-## Installing a Dependency
-
-The generated project includes React and ReactDOM as dependencies. It also includes a set of scripts used by Create React App as a development dependency. You may install other dependencies (for example, React Router) with `npm`:
-
-```
-npm install --save
-```
-
-## Importing a Component
-
-This project setup supports ES6 modules thanks to Babel.
-While you can still use `require()` and `module.exports`, we encourage you to use [`import` and `export`](http://exploringjs.com/es6/ch_modules.html) instead.
-
-For example:
-
-### `Button.js`
-
-```js
-import React, { Component } from 'react';
-
-class Button extends Component {
- render() {
- // ...
- }
-}
-
-export default Button; // Don’t forget to use export default!
-```
-
-### `DangerButton.js`
-
-
-```js
-import React, { Component } from 'react';
-import Button from './Button'; // Import a component from another file
-
-class DangerButton extends Component {
- render() {
- return ;
- }
-}
-
-export default DangerButton;
-```
-
-Be aware of the [difference between default and named exports](http://stackoverflow.com/questions/36795819/react-native-es-6-when-should-i-use-curly-braces-for-import/36796281#36796281). It is a common source of mistakes.
-
-We suggest that you stick to using default imports and exports when a module only exports a single thing (for example, a component). That’s what you get when you use `export default Button` and `import Button from './Button'`.
-
-Named exports are useful for utility modules that export several functions. A module may have at most one default export and as many named exports as you like.
-
-Learn more about ES6 modules:
-
-* [When to use the curly braces?](http://stackoverflow.com/questions/36795819/react-native-es-6-when-should-i-use-curly-braces-for-import/36796281#36796281)
-* [Exploring ES6: Modules](http://exploringjs.com/es6/ch_modules.html)
-* [Understanding ES6: Modules](https://leanpub.com/understandinges6/read#leanpub-auto-encapsulating-code-with-modules)
-
-## Adding a Stylesheet
-
-This project setup uses [Webpack](https://webpack.github.io/) for handling all assets. Webpack offers a custom way of “extending” the concept of `import` beyond JavaScript. To express that a JavaScript file depends on a CSS file, you need to **import the CSS from the JavaScript file**:
-
-### `Button.css`
-
-```css
-.Button {
- padding: 20px;
-}
-```
-
-### `Button.js`
-
-```js
-import React, { Component } from 'react';
-import './Button.css'; // Tell Webpack that Button.js uses these styles
-
-class Button extends Component {
- render() {
- // You can use them as regular CSS styles
- return ;
- }
-}
-```
-
-**This is not required for React** but many people find this feature convenient. You can read about the benefits of this approach [here](https://medium.com/seek-ui-engineering/block-element-modifying-your-javascript-components-d7f99fcab52b). However you should be aware that this makes your code less portable to other build tools and environments than Webpack.
-
-In development, expressing dependencies this way allows your styles to be reloaded on the fly as you edit them. In production, all CSS files will be concatenated into a single minified `.css` file in the build output.
-
-If you are concerned about using Webpack-specific semantics, you can put all your CSS right into `src/index.css`. It would still be imported from `src/index.js`, but you could always remove that import if you later migrate to a different build tool.
-
-## Post-Processing CSS
-
-This project setup minifies your CSS and adds vendor prefixes to it automatically through [Autoprefixer](https://github.com/postcss/autoprefixer) so you don’t need to worry about it.
-
-For example, this:
-
-```css
-.App {
- display: flex;
- flex-direction: row;
- align-items: center;
-}
-```
-
-becomes this:
-
-```css
-.App {
- display: -webkit-box;
- display: -ms-flexbox;
- display: flex;
- -webkit-box-orient: horizontal;
- -webkit-box-direction: normal;
- -ms-flex-direction: row;
- flex-direction: row;
- -webkit-box-align: center;
- -ms-flex-align: center;
- align-items: center;
-}
-```
-
-If you need to disable autoprefixing for some reason, [follow this section](https://github.com/postcss/autoprefixer#disabling).
-
-## Adding a CSS Preprocessor (Sass, Less etc.)
-
-Generally, we recommend that you don’t reuse the same CSS classes across different components. For example, instead of using a `.Button` CSS class in `` and `` components, we recommend creating a `
@@ -67,15 +71,16 @@ class App extends Component {
Reichweite anderer Accounts die sie voranbringen wollen. Gut wäre da nun Einblick, wieviele Retweets der
Politiker von Bots sind, um besser einschätzen zu können, ob da nachgeholfen wird. Zur Erkennung ob ein
Twitter Account ein Bot ist, verlassen wir uns auf die mehrjährige Recherche-Arbeit des Projekts
- Botometer (früher Truthy BotOrNot). Es wurde 2014 von der Indiana University
- aus den USA ins Leben gerufen. Über deren Web-Dienst kann man die Wahrscheinlichkeit einholen, mit der ein
- Twitter Account ein Bot ist. Wir gehen ab 70% Prozent davon aus, dass es sich um einen Bot handelt.
- Für jeden Politiker zu dem wir die Daten einholen konnten, zeigen wir hier nun den Anteil der Follower
- die Bots sind, den Anteil der Retweets die von Bots stammen und wieviel Prozent der Retweeter Bots sind.
+ Botometer (früher Truthy BotOrNot). Es wurde 2014 von
+ der Indiana University aus den USA ins Leben gerufen. Über deren Web-Dienst kann man die
+ Wahrscheinlichkeit einholen, mit der ein Twitter Account ein Bot ist. Wir gehen ab 70% Prozent davon aus,
+ dass es sich um einen Bot handelt.
- Die Liste der Politiker und die Infos über sie, u.a. die Twitter-Profile haben wir über
- github.com/okfde/wahldaten eingeholt.
+
+ Für jeden Politiker zu dem wir die Daten einholen konnten, zeigen wir hier nun den Anteil der Follower
+ die Bots sind, den Anteil der Retweets die von Bots stammen und wieviel Prozent der Retweeter Bots sind.
+
@@ -106,7 +111,19 @@ class App extends Component {
})}
-
+
+
+
+ Die Liste der Politiker und die Infos über sie, u.a. die Twitter-Profile haben wir über
+ github.com/okfde/wahldaten eingeholt.
+
+ Die Wahrscheinlichkeit ob ein Account ein Bot ist, holen wir uns über
+ Botometer (früher Truthy BotOrNot) von der
+ Indiana University aus den USA ein.
+
+ Die Follower und Retweet Daten sind über die Twitter-API von Twitter selbst eingeholt worden.
+
+
);
}
From ce1b43e9468a81d8cc52931f0982ee660d62cecb Mon Sep 17 00:00:00 2001
From: aCandidMind
Date: Fri, 22 Sep 2017 16:36:32 +0200
Subject: [PATCH 08/41] Fix logo import in App.js & add proper page title
---
public/index.html | 2 +-
src/App.js | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/public/index.html b/public/index.html
index aab5e3b..d7a954f 100644
--- a/public/index.html
+++ b/public/index.html
@@ -13,7 +13,7 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
- React App
+ BotOrNot hessische BTW-Kandidaten 2017
diff --git a/src/App.js b/src/App.js
index fcf6aa6..870f0ba 100644
--- a/src/App.js
+++ b/src/App.js
@@ -1,7 +1,7 @@
import React, {Component} from 'react'
import { Link } from 'react-router'
import {Grid, Row, Col, Jumbotron, Panel} from 'react-bootstrap'
-import logo from './logo.png'
+import logo from '../public/logo.png'
import './App.css'
class App extends Component {
From 3a19539c0a4a4654c4ed8d63b3fe2b2e94a87615 Mon Sep 17 00:00:00 2001
From: aCandidMind
Date: Fri, 22 Sep 2017 16:50:54 +0200
Subject: [PATCH 09/41] Deactive spinning logo animation and format footer &
give it some whitespace
---
src/App.js | 26 +++++++++++++++-----------
src/index.css | 9 +++++++++
2 files changed, 24 insertions(+), 11 deletions(-)
diff --git a/src/App.js b/src/App.js
index 870f0ba..3656d38 100644
--- a/src/App.js
+++ b/src/App.js
@@ -54,8 +54,8 @@ class App extends Component {
return (
-
-
+
+
BotOrNot hessische BTW-Kandidaten 2017
@@ -113,15 +113,19 @@ class App extends Component {
-
- Die Liste der Politiker und die Infos über sie, u.a. die Twitter-Profile haben wir über
- github.com/okfde/wahldaten eingeholt.
-
- Die Wahrscheinlichkeit ob ein Account ein Bot ist, holen wir uns über
- Botometer (früher Truthy BotOrNot) von der
- Indiana University aus den USA ein.
-
- Die Follower und Retweet Daten sind über die Twitter-API von Twitter selbst eingeholt worden.
+
+
+ Die Liste der Politiker und die Infos über sie, u.a. die Twitter-Profile haben wir über
+ github.com/okfde/wahldaten eingeholt.
+
+
+ Die Wahrscheinlichkeit ob ein Account ein Bot ist, holen wir uns über
+ Botometer (früher Truthy BotOrNot) von der
+ Indiana University aus den USA ein.
+
+
+ Die Follower und Retweet Daten sind über die Twitter-API von Twitter selbst eingeholt worden.
+
diff --git a/src/index.css b/src/index.css
index b4cc725..fb63ec9 100644
--- a/src/index.css
+++ b/src/index.css
@@ -3,3 +3,12 @@ body {
padding: 0;
font-family: sans-serif;
}
+
+.App-logo {
+ -webkit-animation: none;
+ animation: none;
+}
+
+#footer {
+ margin-top: 3em;
+}
\ No newline at end of file
From f2546e5eee2048ad2131bd9bfd4c9295bcf83387 Mon Sep 17 00:00:00 2001
From: aCandidMind
Date: Fri, 22 Sep 2017 17:09:08 +0200
Subject: [PATCH 10/41] Deactivate wordcluster and retweet graphs & improve
homepage text
---
src/App.js | 9 ++++-----
src/MemberPage.js | 23 +++++++++++++++++------
2 files changed, 21 insertions(+), 11 deletions(-)
diff --git a/src/App.js b/src/App.js
index 3656d38..f6d5be9 100644
--- a/src/App.js
+++ b/src/App.js
@@ -67,7 +67,7 @@ class App extends Component {
Twitter Bots sind computergesteuerte Programme die sich automatisiert auf dem Social Network bewegen
und verschiedene Ziele verfolgen. Die meisten betreiben quasi Marketing und folgen wild allen möglichen
- Accounts und tauchen so in deren Benachrichtigungen auf. Andere sorgen aber mit Retweets für eine größere
+ Accounts und erzeugen so Aufmerksamkeit. Andere sorgen aber mit Retweets für eine größere
Reichweite anderer Accounts die sie voranbringen wollen. Gut wäre da nun Einblick, wieviele Retweets der
Politiker von Bots sind, um besser einschätzen zu können, ob da nachgeholfen wird. Zur Erkennung ob ein
Twitter Account ein Bot ist, verlassen wir uns auf die mehrjährige Recherche-Arbeit des Projekts
@@ -77,10 +77,9 @@ class App extends Component {
dass es sich um einen Bot handelt.
-
- Für jeden Politiker zu dem wir die Daten einholen konnten, zeigen wir hier nun den Anteil der Follower
- die Bots sind, den Anteil der Retweets die von Bots stammen und wieviel Prozent der Retweeter Bots sind.
-
+ Für jeden Politiker zu dem wir die Daten einholen konnten, zeigen wir hier nun den Anteil der
+ Follower die Bots sind, den Anteil der Retweets die von Bots stammen und wieviel Prozent der Retweeter
+ Bots sind.
@@ -70,7 +70,7 @@ class App extends Component {
Accounts und erzeugen so Aufmerksamkeit. Andere sorgen aber mit Retweets für eine größere
Reichweite anderer Accounts die sie voranbringen wollen. Gut wäre da nun Einblick, wieviele Retweets der
Politiker von Bots sind, um besser einschätzen zu können, ob da nachgeholfen wird. Zur Erkennung ob ein
- Twitter Account ein Bot ist, verlassen wir uns auf die mehrjährige Recherche-Arbeit des Projekts
+ Twitter Account ein Bot ist, verlassen wir uns auf die mehrjährige Recherche-Arbeit des Projekts
Botometer (früher Truthy BotOrNot). Es wurde 2014 von
der Indiana University aus den USA ins Leben gerufen. Über deren Web-Dienst kann man die
Wahrscheinlichkeit einholen, mit der ein Twitter Account ein Bot ist. Wir gehen ab 70% Prozent davon aus,
@@ -118,7 +118,7 @@ class App extends Component {
github.com/okfde/wahldaten eingeholt.
- Die Wahrscheinlichkeit ob ein Account ein Bot ist, holen wir uns über
+ Die Wahrscheinlichkeit ob ein Account ein Bot ist, holen wir uns über
Botometer (früher Truthy BotOrNot) von der
Indiana University aus den USA ein.
)
}
}
diff --git a/src/index.js b/src/index.js
index 0e69c6a..a622be6 100644
--- a/src/index.js
+++ b/src/index.js
@@ -3,12 +3,14 @@ import ReactDOM from 'react-dom';
import { Router, Route, browserHistory } from 'react-router'
import App from './App';
import MemberPage from './MemberPage';
+import PartyPage from './PartyPage';
import './index.css';
ReactDOM.render(
+ ,
document.getElementById('root')
);
From b07e9240e4b12044cc7140e0c08b1ff308797167 Mon Sep 17 00:00:00 2001
From: aCandidMind
Date: Fri, 22 Sep 2017 23:09:55 +0200
Subject: [PATCH 23/41] As we only have candidate data for the big six parties,
only show them
---
src/App.js | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/src/App.js b/src/App.js
index 54b2643..e0e9d26 100644
--- a/src/App.js
+++ b/src/App.js
@@ -8,7 +8,13 @@ class App extends Component {
state = {
politicians: [],
- parties: [],
+ parties: [
+ {name: "AfD", slug: 'afd'},
+ {name: "CDU", slug: 'cdu'},
+ {name: "Grüne", slug: 'gruene'},
+ {name: "Linke", slug: 'linke'},
+ {name: "SPD", slug: 'spd'}
+ ],
districts: {candidates_by_district: []}
};
@@ -24,7 +30,6 @@ class App extends Component {
}
componentWillMount() {
- this.load('parties', 'https://trustfact.dilab.co/api/v2/parties');
this.load('districts', 'https://botornot-hessen-api.herokuapp.com/pbc');
this.load('politicians', '/candidates.json');
}
@@ -72,9 +77,9 @@ class App extends Component {
dass es sich um einen Bot handelt.
- Für jeden Politiker zu dem wir die Daten einholen konnten, zeigen wir hier nun den Anteil der
- Follower die Bots sind, den Anteil der Retweets die von Bots stammen und wieviel Prozent der Retweeter
- Bots sind.
+ Für jeden Politiker zu dem wir die Daten einholen konnten (siehe Quellen unten), zeigen wir hier nun den
+ Anteil der Follower die Bots sind, den Anteil der Retweets die von Bots stammen und wieviel
+ Prozent der Retweeter Bots sind.
From 10a89d26f06c3e51138a4fc8380c71227ce668c5 Mon Sep 17 00:00:00 2001
From: aCandidMind
Date: Sat, 23 Sep 2017 02:58:54 +0200
Subject: [PATCH 24/41] Use the new pluralized API URLs in the frontend
---
src/MemberPage.js | 2 +-
src/PartyPage.js | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/MemberPage.js b/src/MemberPage.js
index 756fa9c..368ee8f 100644
--- a/src/MemberPage.js
+++ b/src/MemberPage.js
@@ -40,7 +40,7 @@ class MemberPage extends Component {
componentWillMount() {
let self = this;
- const url = 'https://botornot-hessen-api.herokuapp.com/pbc/user/' + this.props.params.slug;
+ const url = 'https://botornot-hessen-api.herokuapp.com/pbc/users/' + this.props.params.slug;
fetch(url, {mode: 'cors', headers: {'Accept': 'application/json'}})
.then(res => {
return res.json().then(data => {
diff --git a/src/PartyPage.js b/src/PartyPage.js
index b29301b..0015b06 100644
--- a/src/PartyPage.js
+++ b/src/PartyPage.js
@@ -8,7 +8,7 @@ class PartyPage extends Component {
state = {
party: {
name: '',
- membersOnList: []
+ membersOnLists: []
}
}
@@ -27,7 +27,7 @@ class PartyPage extends Component {
}
render() {
- let members = this.state.party.membersOnList.map(member => (
+ let members = this.state.party.membersOnLists.map(member => (
{this.getFullName(member.name)}
@@ -44,7 +44,7 @@ class PartyPage extends Component {
-
Mitglieder auf der Liste
+
Mitglieder auf den Listen
{members}
From 8d143dad05b2417a229dc18d1179a4ef80765f21 Mon Sep 17 00:00:00 2001
From: aCandidMind
Date: Sat, 23 Sep 2017 03:06:27 +0200
Subject: [PATCH 25/41] Add names to districts, they are now also sorted by the
name
---
src/App.js | 27 +++++++++++++++------------
1 file changed, 15 insertions(+), 12 deletions(-)
diff --git a/src/App.js b/src/App.js
index e0e9d26..eaef5c8 100644
--- a/src/App.js
+++ b/src/App.js
@@ -15,7 +15,7 @@ class App extends Component {
{name: "Linke", slug: 'linke'},
{name: "SPD", slug: 'spd'}
],
- districts: {candidates_by_district: []}
+ districts: {districts: []}
};
load(what, url) {
@@ -30,7 +30,7 @@ class App extends Component {
}
componentWillMount() {
- this.load('districts', 'https://botornot-hessen-api.herokuapp.com/pbc');
+ this.load('districts', 'https://botornot-hessen-api.herokuapp.com/pbc/districts');
this.load('politicians', '/candidates.json');
}
@@ -52,10 +52,7 @@ class App extends Component {
}
render() {
- const districts = this.state.districts.candidates_by_district;
- if (districts[0]) {
- districts[0].district = "Landesliste"
- }
+ const districts = this.state.districts.districts;
return (
@@ -77,9 +74,10 @@ class App extends Component {
dass es sich um einen Bot handelt.
- Für jeden Politiker zu dem wir die Daten einholen konnten (siehe Quellen unten), zeigen wir hier nun den
- Anteil der Follower die Bots sind, den Anteil der Retweets die von Bots stammen und wieviel
- Prozent der Retweeter Bots sind.
+ Für jeden Politiker zu dem wir die Daten einholen konnten (die Datenlage ist recht eingeschränkt, siehe
+ Quellen ganz unten, daher auch die fehlenden Parteien und Wahlkreise), zeigen wir hier nun den Anteil
+ der Follower die Bots sind, den Anteil der Retweets die von Bots stammen und wieviel Prozent der
+ Retweeter Bots sind.
- Die Liste der Politiker und die Infos über sie, u.a. die Twitter-Profile haben wir über
+ Die Liste der Politiker und die Infos über sie, u.a. die Account-Namen der Twitter-Profile haben wir über
github.com/okfde/wahldaten eingeholt.
@@ -123,7 +121,12 @@ class App extends Component {
Indiana University aus den USA ein.
- Die Follower und Retweet Daten sind über die Twitter-API von Twitter selbst eingeholt worden.
+ Die Follower und Retweet Daten sind über die Twitter-API
+ von Twitter selbst eingeholt worden.
+
diff --git a/src/index.js b/src/index.js
index 8321791..8eb6542 100644
--- a/src/index.js
+++ b/src/index.js
@@ -12,7 +12,7 @@ ReactDOM.render(
-
+
,
document.getElementById('root')
)
From ce9aa8295701dc236979a016616d199f760bdba3 Mon Sep 17 00:00:00 2001
From: Joachim Schirrmacher
Date: Sat, 23 Sep 2017 16:14:33 +0200
Subject: [PATCH 35/41] Readability in main page
---
src/App.css | 8 ++++++++
src/App.js | 5 ++++-
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/src/App.css b/src/App.css
index 46a84a8..5a7bd47 100644
--- a/src/App.css
+++ b/src/App.css
@@ -4,6 +4,14 @@
text-align: center;
}
+.App h2 {
+ font-size: 28px;
+}
+
+.jumbotron p {
+ font-size: 18px;
+}
+
.App-header {
background-color: #222;
padding: 20px;
diff --git a/src/App.js b/src/App.js
index 7b9f8d7..12be2d8 100644
--- a/src/App.js
+++ b/src/App.js
@@ -51,7 +51,10 @@ class App extends Component {
Twitter Bots sind computergesteuerte Programme die sich automatisiert auf dem Social Network bewegen
und verschiedene Ziele verfolgen. Die meisten betreiben quasi Marketing und folgen wild allen möglichen
Accounts und erzeugen so Aufmerksamkeit. Andere sorgen aber mit Retweets für eine größere
- Reichweite anderer Accounts die sie voranbringen wollen. Gut wäre da nun Einblick, wieviele Retweets der
+ Reichweite anderer Accounts die sie voranbringen wollen.
+
+
+ Gut wäre da nun Einblick, wieviele Retweets der
Politiker von Bots sind, um besser einschätzen zu können, ob da nachgeholfen wird. Zur Erkennung ob ein
Twitter Account ein Bot ist, verlassen wir uns auf die mehrjährige Recherche-Arbeit des Projekts
Botometer (früher Truthy BotOrNot). Es wurde 2014 von
From 4e6f91f59d3b8cbee4bacdb138d9f98e55be8204 Mon Sep 17 00:00:00 2001
From: Joachim Schirrmacher
Date: Sat, 23 Sep 2017 16:22:56 +0200
Subject: [PATCH 36/41] Added link to github page
---
src/App.js | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/App.js b/src/App.js
index 12be2d8..bf337f4 100644
--- a/src/App.js
+++ b/src/App.js
@@ -118,6 +118,9 @@ class App extends Component {
Die Namen der Wahlkreise haben wir über die
Abgeordnetenwatch API abgerufen.
+
Der Quellcode dieses Projekts ist zu finden auf
+ github.
+
From 3de0dbe4e576aeb601e06f0f90bb02fc88c54360 Mon Sep 17 00:00:00 2001
From: Joachim Schirrmacher
Date: Sat, 23 Sep 2017 16:32:50 +0200
Subject: [PATCH 37/41] Back button goes back one page and not to main page any
more
---
src/DistrictPage.js | 7 ++++---
src/MemberPage.js | 9 +++++----
src/PartyPage.js | 7 ++++---
3 files changed, 13 insertions(+), 10 deletions(-)
diff --git a/src/DistrictPage.js b/src/DistrictPage.js
index 410e958..f6444e6 100644
--- a/src/DistrictPage.js
+++ b/src/DistrictPage.js
@@ -1,6 +1,7 @@
-import React, {Component} from 'react';
+import React, {Component} from 'react'
+import BrowserHistory from 'react-router/lib/browserHistory'
import { Link } from 'react-router'
-import {Row, Col, Panel} from 'react-bootstrap';
+import {Row, Col, Panel} from 'react-bootstrap'
import Title from './Title'
import { parties, getFullName } from './Utils'
@@ -39,7 +40,7 @@ class DistrictPage extends Component {
return (
diff --git a/src/MemberPage.js b/src/MemberPage.js
index 85445a5..fddacfe 100644
--- a/src/MemberPage.js
+++ b/src/MemberPage.js
@@ -1,11 +1,12 @@
/**
* Created by peter on 04.03.17.
*/
-import React, {Component} from 'react';
+import React, {Component} from 'react'
+import BrowserHistory from 'react-router/lib/browserHistory'
import Title from './Title'
import { Link } from 'react-router'
-import {Col, Row, Panel} from 'react-bootstrap';
-import PieChart from './PieChart';
+import {Col, Row, Panel} from 'react-bootstrap'
+import PieChart from './PieChart'
import picPlaceholder from '../public/Portrait_placeholder.png'
import { parties } from './Utils'
@@ -86,7 +87,7 @@ class MemberPage extends Component {
return (
-
« Zurück
+
« Zurück
diff --git a/src/PartyPage.js b/src/PartyPage.js
index 8682741..4ff4f50 100644
--- a/src/PartyPage.js
+++ b/src/PartyPage.js
@@ -1,6 +1,7 @@
-import React, {Component} from 'react';
+import React, {Component} from 'react'
+import BrowserHistory from 'react-router/lib/browserHistory'
import { Link } from 'react-router'
-import {Row, Col, Panel} from 'react-bootstrap';
+import {Row, Col, Panel} from 'react-bootstrap'
import Title from './Title'
import { parties, getFullName } from './Utils'
import * as partyLogos from './PartyLogos'
@@ -35,7 +36,7 @@ class PartyPage extends Component {
return (
- Twitter Bots folgen vielen Accounts, wieviele sind unter den Followern unserer BTW-Kandidaten 2017?
+ Wer folgt unseren Bundestagswahl-Kandidaten wirklich?
+
Sind es Bots oder echte Menschen, die den Kandidaten folgen? Das finden wir hier für euch heraus,
+ damit klar wird, was echt ist und was nicht.
+
+
+
Was sind das für Bots, um die es geht?
Twitter Bots sind computergesteuerte Programme die sich automatisiert auf dem Social Network bewegen
- und verschiedene Ziele verfolgen. Die meisten betreiben quasi Marketing und folgen wild allen möglichen
- Accounts und erzeugen so Aufmerksamkeit. Andere sorgen aber mit Retweets für eine größere
- Reichweite anderer Accounts die sie voranbringen wollen.
+ und verschiedene Ziele verfolgen. Die meisten betreiben Marketing und folgen allen möglichen
+ Accounts und erzeugen so Aufmerksamkeit. Andere sorgen mit Retweets für eine größere
+ Reichweite anderer Accounts, die sie voranbringen wollen.
+
+
+ Eigentlich ist es noch kein Problem, wenn Bots dem Account eines Kandidaten folgen. Problematisch wird
+ es, wenn wir als Wähler die Meldungen eines Kandidaten häufiger zu sehen bekommen, weil sie angeblich
+ viele andere interessieren (und daher auch mich interessieren könnten), aber hauptsächlich Bots diese
+ Retweets erzeugt haben.
+
+
+
Und wie erkenne ich, welche Retweets "echt" sind, und was von Bots künstlich erzeugt wird?
+
+ Wir geben dir einen Einblick, wieviele Retweets der Politiker von Bots sind, um besser einschätzen zu können,
+ ob nachgeholfen wird. Zur Erkennung ob ein Twitter Account ein Bot ist, verlassen wir uns auf die
+ mehrjährige Recherche-Arbeit des
.
+ Es wurde 2014 von der Indiana University aus den USA ins Leben gerufen. Über deren Web-Dienst kann man die
+ Wahrscheinlichkeit einholen, mit der ein Twitter Account ein Bot ist.
- Gut wäre da nun Einblick, wieviele Retweets der
- Politiker von Bots sind, um besser einschätzen zu können, ob da nachgeholfen wird. Zur Erkennung ob ein
- Twitter Account ein Bot ist, verlassen wir uns auf die mehrjährige Recherche-Arbeit des Projekts
- Botometer (früher Truthy BotOrNot). Es wurde 2014 von
- der Indiana University aus den USA ins Leben gerufen. Über deren Web-Dienst kann man die
- Wahrscheinlichkeit einholen, mit der ein Twitter Account ein Bot ist. Wir gehen ab 70% Prozent davon aus,
- dass es sich um einen Bot handelt.
+ Wir gehen ab 70% Prozent davon aus, dass es sich um einen Bot handelt.
- Für jeden Politiker zu dem wir die Daten einholen konnten (die Datenlage ist recht eingeschränkt, siehe
- Quellen ganz unten, daher auch die fehlenden Parteien und Wahlkreise), zeigen wir hier nun den Anteil
- der Follower die Bots sind, den Anteil der Retweets die von Bots stammen und wieviel Prozent der
- Retweeter Bots sind.
+ Für jeden
Politiker, zu dem wir die Daten einholen konnten
die Datenlage ist recht
+ eingeschränkt, siehe Quellen ganz unten, daher auch die fehlenden Parteien und Wahlkreise
Wir geben dir einen Einblick, wieviele Retweets der Politiker von Bots sind, um besser einschätzen zu können,
ob nachgeholfen wird. Zur Erkennung ob ein Twitter Account ein Bot ist, verlassen wir uns auf die
- mehrjährige Recherche-Arbeit des
.
+ mehrjährige Recherche-Arbeit des Projekts
+ Botometerfrüher Truthy BotOrNot.
Es wurde 2014 von der Indiana University aus den USA ins Leben gerufen. Über deren Web-Dienst kann man die
Wahrscheinlichkeit einholen, mit der ein Twitter Account ein Bot ist.
@@ -78,8 +78,9 @@ class App extends Component {
Wir gehen ab 70% Prozent davon aus, dass es sich um einen Bot handelt.
- Für jeden
Politiker, zu dem wir die Daten einholen konnten
die Datenlage ist recht
- eingeschränkt, siehe Quellen ganz unten, daher auch die fehlenden Parteien und Wahlkreise
+ Für jeden Politiker, zu dem wir die Daten einholen konnten
+ die Datenlage ist recht
+ eingeschränkt, siehe Quellen ganz unten, daher auch die fehlenden Parteien und Wahlkreise
zeigen wir hier nun den Anteil der Follower die Bots sind, den Anteil der Retweets die von Bots
stammen und wieviel Prozent der Retweeter Bots sind.
diff --git a/src/Breadcrumbs.css b/src/Breadcrumbs.css
new file mode 100644
index 0000000..2706100
--- /dev/null
+++ b/src/Breadcrumbs.css
@@ -0,0 +1,3 @@
+.breadcrumbs {
+ margin-bottom: 1em;
+}
diff --git a/src/Breadcrumbs.js b/src/Breadcrumbs.js
new file mode 100644
index 0000000..8a30cb8
--- /dev/null
+++ b/src/Breadcrumbs.js
@@ -0,0 +1,14 @@
+import React, {Component} from 'react'
+import BrowserHistory from 'react-router/lib/browserHistory'
+import './Breadcrumbs.css'
+
+class Breadcrumbs extends Component {
+ render() {
+ return (
+ « Zurück
+
+ )
+ }
+}
+
+export default Breadcrumbs
diff --git a/src/DistrictPage.js b/src/DistrictPage.js
index f6444e6..05414ee 100644
--- a/src/DistrictPage.js
+++ b/src/DistrictPage.js
@@ -1,5 +1,5 @@
import React, {Component} from 'react'
-import BrowserHistory from 'react-router/lib/browserHistory'
+import Breadcrumbs from './Breadcrumbs'
import { Link } from 'react-router'
import {Row, Col, Panel} from 'react-bootstrap'
import Title from './Title'
@@ -40,7 +40,7 @@ class DistrictPage extends Component {
return (
diff --git a/src/MemberPage.js b/src/MemberPage.js
index fddacfe..f28a88c 100644
--- a/src/MemberPage.js
+++ b/src/MemberPage.js
@@ -2,8 +2,8 @@
* Created by peter on 04.03.17.
*/
import React, {Component} from 'react'
-import BrowserHistory from 'react-router/lib/browserHistory'
import Title from './Title'
+import Breadcrumbs from './Breadcrumbs'
import { Link } from 'react-router'
import {Col, Row, Panel} from 'react-bootstrap'
import PieChart from './PieChart'
@@ -87,7 +87,7 @@ class MemberPage extends Component {
return (
-
« Zurück
+
diff --git a/src/PartyPage.js b/src/PartyPage.js
index 4ff4f50..1477e3f 100644
--- a/src/PartyPage.js
+++ b/src/PartyPage.js
@@ -1,5 +1,5 @@
import React, {Component} from 'react'
-import BrowserHistory from 'react-router/lib/browserHistory'
+import Breadcrumbs from './Breadcrumbs'
import { Link } from 'react-router'
import {Row, Col, Panel} from 'react-bootstrap'
import Title from './Title'
@@ -36,7 +36,7 @@ class PartyPage extends Component {
return (
)
}
}
-export default Breadcrumbs
+export default withRouter(Breadcrumbs)
diff --git a/src/DistrictPage.js b/src/DistrictPage.js
index 05414ee..3a19db9 100644
--- a/src/DistrictPage.js
+++ b/src/DistrictPage.js
@@ -1,6 +1,6 @@
import React, {Component} from 'react'
import Breadcrumbs from './Breadcrumbs'
-import { Link } from 'react-router'
+import { Link } from 'react-router-dom'
import {Row, Col, Panel} from 'react-bootstrap'
import Title from './Title'
import { parties, getFullName } from './Utils'
@@ -15,7 +15,7 @@ class DistrictPage extends Component {
componentWillMount() {
let self = this;
- const url = 'https://botornot-hessen-api.herokuapp.com/pbc/districts/' + this.props.params.slug;
+ const url = 'https://botornot-hessen-api.herokuapp.com/pbc/districts/' + this.props.match.params.slug;
fetch(url, {mode: 'cors', headers: {'Accept': 'application/json'}})
.then(res => {
return res.json().then(data => {
diff --git a/src/MemberPage.js b/src/MemberPage.js
index f28a88c..e1f1f66 100644
--- a/src/MemberPage.js
+++ b/src/MemberPage.js
@@ -4,10 +4,10 @@
import React, {Component} from 'react'
import Title from './Title'
import Breadcrumbs from './Breadcrumbs'
-import { Link } from 'react-router'
+import { Link } from 'react-router-dom'
import {Col, Row, Panel} from 'react-bootstrap'
import PieChart from './PieChart'
-import picPlaceholder from '../public/Portrait_placeholder.png'
+import picPlaceholder from './Portrait_placeholder.png'
import { parties } from './Utils'
class MemberPage extends Component {
@@ -48,7 +48,7 @@ class MemberPage extends Component {
componentWillMount() {
let self = this;
- const url = 'https://botornot-hessen-api.herokuapp.com/pbc/users/' + this.props.params.slug;
+ const url = 'https://botornot-hessen-api.herokuapp.com/pbc/users/' + this.props.match.params.slug;
fetch(url, {mode: 'cors', headers: {'Accept': 'application/json'}})
.then(res => {
return res.json().then(data => {
diff --git a/src/PartyLogos.js b/src/PartyLogos.js
index b2738ce..a8295c9 100644
--- a/src/PartyLogos.js
+++ b/src/PartyLogos.js
@@ -1,9 +1,9 @@
-import afd from '../public/partyLogos/afd.svg'
-import cdu from '../public/partyLogos/cdu.svg'
-import fdp from '../public/partyLogos/fdp.svg'
-import gruene from '../public/partyLogos/gruene.svg'
-import linke from '../public/partyLogos/linke.svg'
-import spd from '../public/partyLogos/spd.svg'
+import afd from './partyLogos/afd.svg'
+import cdu from './partyLogos/cdu.svg'
+import fdp from './partyLogos/fdp.svg'
+import gruene from './partyLogos/gruene.svg'
+import linke from './partyLogos/linke.svg'
+import spd from './partyLogos/spd.svg'
export {
afd,
diff --git a/src/PartyPage.js b/src/PartyPage.js
index 1477e3f..20a697c 100644
--- a/src/PartyPage.js
+++ b/src/PartyPage.js
@@ -1,6 +1,6 @@
import React, {Component} from 'react'
import Breadcrumbs from './Breadcrumbs'
-import { Link } from 'react-router'
+import { Link } from 'react-router-dom'
import {Row, Col, Panel} from 'react-bootstrap'
import Title from './Title'
import { parties, getFullName } from './Utils'
@@ -8,14 +8,14 @@ import * as partyLogos from './PartyLogos'
class PartyPage extends Component {
state = {
- name: parties[this.props.params.slug],
- logo: partyLogos[this.props.params.slug],
+ name: parties[this.props.match.params.slug],
+ logo: partyLogos[this.props.match.params.slug],
candidates: []
}
componentWillMount() {
let self = this;
- const url = 'https://botornot-hessen-api.herokuapp.com/pbc/parties/' + this.props.params.slug;
+ const url = 'https://botornot-hessen-api.herokuapp.com/pbc/parties/' + this.props.match.params.slug;
fetch(url, {mode: 'cors', headers: {'Accept': 'application/json'}})
.then(res => {
return res.json().then(data => {
diff --git a/public/Portrait_placeholder.png b/src/Portrait_placeholder.png
similarity index 100%
rename from public/Portrait_placeholder.png
rename to src/Portrait_placeholder.png
diff --git a/src/Title.js b/src/Title.js
index c998bc8..e70d4f6 100644
--- a/src/Title.js
+++ b/src/Title.js
@@ -1,6 +1,6 @@
import React, {Component} from 'react'
import {Row, Col} from 'react-bootstrap'
-import logo from '../public/logo.png'
+import logo from './logo.png'
import './Title.css'
class Title extends Component {
diff --git a/src/index.js b/src/index.js
index 7c09940..bd88a94 100644
--- a/src/index.js
+++ b/src/index.js
@@ -1,17 +1,19 @@
import React from 'react'
import ReactDOM from 'react-dom'
-import { Router, Route, browserHistory } from 'react-router'
+import { BrowserRouter, Route } from 'react-router-dom'
import App from './App'
import MemberPage from './MemberPage'
import PartyPage from './PartyPage'
import DistrictPage from './DistrictPage'
ReactDOM.render(
-
-
-
-
-
- ,
- document.getElementById('root')
+
+
+
+
+
+
+
+ ,
+ document.getElementById('root')
)
diff --git a/public/logo.png b/src/logo.png
similarity index 100%
rename from public/logo.png
rename to src/logo.png
diff --git a/public/partyLogos/afd.svg b/src/partyLogos/afd.svg
similarity index 100%
rename from public/partyLogos/afd.svg
rename to src/partyLogos/afd.svg
diff --git a/public/partyLogos/cdu.svg b/src/partyLogos/cdu.svg
similarity index 100%
rename from public/partyLogos/cdu.svg
rename to src/partyLogos/cdu.svg
diff --git a/public/partyLogos/fdp.svg b/src/partyLogos/fdp.svg
similarity index 100%
rename from public/partyLogos/fdp.svg
rename to src/partyLogos/fdp.svg
diff --git a/public/partyLogos/gruene.svg b/src/partyLogos/gruene.svg
similarity index 100%
rename from public/partyLogos/gruene.svg
rename to src/partyLogos/gruene.svg
diff --git a/public/partyLogos/linke.svg b/src/partyLogos/linke.svg
similarity index 100%
rename from public/partyLogos/linke.svg
rename to src/partyLogos/linke.svg
diff --git a/public/partyLogos/spd.svg b/src/partyLogos/spd.svg
similarity index 100%
rename from public/partyLogos/spd.svg
rename to src/partyLogos/spd.svg