Git Product home page Git Product logo

newsgradient-analize's Introduction

Newsgradient Analysis

This is a tool for the Newsgradient project to help collect data from news articles. It consists of two parts:

  • a Firefox extension that collects information from the user and sends it to the server and

  • a Flask API server that receives and stores information in json files.

Flask API Server

Server code can be found in the 'api' folder.

How does is work

The server accepts GET and POST requests at the root URL. On a GET request it will respond with a simple success message. On a POST request it expects to receive JSON encoded data, with content-type set to application/json in the headers.

On a successful POST request it will store the request body in a JSON file with a timestamp in the name of the file. The files will be saved in the folder 'app/uploaded_files'.

Usage

You can run it locally by either using flask or docker-compose.

flask run

or

docker-compose up

Firefox extension

The extension code can be found in the 'extension' folder.

How it works

The extension collects data about article url, article title, the name of person using the extension (author), veracity, and biases for every party.

An example of sent json:

{
    "url": "https://somerandomurl.com/news/article/",
    "title": "A Random Article Title",
    "author": "Bob",
    "veracity": 2.38,
    "party_biases": [
        "Party 1": "positive",
        "Party 2": "negative",
        "Party 3": "neutral"
    ]
}

How to change parties

Parties are defined in parties.js file in the 'extension/popup' folder, you can add new key-value pairs or delete existing ones.

Usage

# install dependencies
npm install

# develop the extension locally using web-ext
npm run dev

# build for production
npm run build

newsgradient-analize's People

Contributors

patricijab avatar muki avatar

Watchers

 avatar James Cloos avatar Mato Žgajner avatar  avatar  avatar  avatar

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.