Code Monkey home page Code Monkey logo

canvas-page-view's Introduction

Canvas Page View

This project downloads the page views for specified Canvas users and outputs a CSV for each user with the following headers:

  • 'id'
  • 'app_name'
  • 'url'
  • 'context_type'
  • 'asset_type'
  • 'controller'
  • 'interaction_seconds'
  • 'created_at'
  • 'user_request'
  • 'render_time'
  • 'user_agent'
  • 'participated'
  • 'http_method'
  • 'remote_ip'
  • 'links'

An explanation of what these headers mean can be found here: https://canvas.instructure.com/doc/api/users.html#PageView

Getting Started

These instructions will get you a copy of the project up and running on your local machine for use with your own API tokens and Canvas domains.

Prerequisites

  1. Install Node 10 or greater.
  2. Install Git.

Host URL and Token setup

  1. Create a .env file.
  2. Generate Canvas API token and copy it to clipboard.
  3. Add the following: CANVAS_API_TOKEN={YOUR API TOKEN} and CANVAS_API_DOMAIN={YOUR API DOMAIN}. An example CANVAS_API_DOMAIN is https://{school}.instructure.com/api/v1

Installation and execution of script

  1. Clone this repo. git clone https://github.com/ubccapico/canvas-page-view
  2. Then cd into the repo. cd canvas-page-view
  3. Run the installation script. npm install (If you see babel-node: command not found, you've missed this step.)
  4. Add your Canvas user IDs to index.js, as well as the start time and end time, where it says: getPageViewsForUsers([/* add Canvas user IDs */], /* add start date */, /* add end date */)
  5. The start and end times should be specified in UTC time like this: 2020-05-18T00:00:00Z
  6. Run the script. npm start.
  7. An {Canvas user id}-pageviews.csv file should be generated for each Canvas user id.

Note

Please note that this project downloads remote-ip, which is the origin IP address of the request. IP addresses are considered personal information and should be treated with care. Sharing IP addresses of students without formal approval from an Associate Dean is not permitted. Please contact the LTHub if you have any questions or concerns.

Authors

License

This project is licensed under the GNU General Public License v3.0.

canvas-page-view's People

Contributors

justin0022 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.