Code Monkey home page Code Monkey logo

upthing's Introduction

About UpThing

UpThing uses the Up Bank API to provide a web interface for displaying account information and managing Webhooks.

Account view

Basic account information, including transaction listing is available to view using UpThing.

Webhook actions

The main purpose of creating UpThing was to configure webhooks for sending transaction information to various locations, including to Google Sheets and creating Discord Notifications.

Getting Started

Setting Up(thing)

UpThing is a Laravel-based application. Please follow these instructions to get started.

Once that's done and you can see the login screen, grab your personal access token by following the instructions on Up's website here.

Create a new account on UpThing by using the register link up in the top corner and fill in the necessary details and you should be good to go!

Discord Integration

Create a new Discord webhook on a server you're an admin on:

  1. Open the Discord Server Settings, and go to Integrations
  2. Click Webhooks
  3. Click New Webhook
  4. Type in a name (this is what "user" the messages will come from)
  5. (Optional) Give the Bot an avatar
  6. Copy the Webhook URL
  7. Click Save

Create a new UpThing webhook:

  1. Navigate to Webhooks, Create Webhook
  2. Give it a name
  3. Select Discord Notification for the Action Type
  4. Paste the Discord Webhook URL into the 'Action URL'
  5. Click Create Webhook

Next time a transaction is settled, you should get a Discord Notification!

Google Sheets Integration

A potentially much more useful integration is with Google Sheets, however the setup is a bit more involved.

Firstly, you will need to set up a way for Google Sheets to receive the information from UpThing. This involves creating a script within the sheet (Tools -> Script Editor), and addding the following code:

function getNewRow(sheet) {
  let Avals = sheet.getRange("A1:A").getValues();
  let Alast = Avals.filter(String).length;
  let newRow = Alast + 1;
  return newRow;
}

function doPost(e) {
  let jsonData = JSON.parse(e.postData.contents)
  let transaction = {
    "date": new Date(jsonData.attributes.settledAt),
    "description": jsonData.attributes.description + " (" + jsonData.attributes.rawText + ")",
    "category": jsonData.relationships.category.data.id,
    "value": jsonData.attributes.amount.value
  };
  let ss = SpreadsheetApp.getActiveSpreadsheet();
  let txSheet = ss.getSheetByName("Transactions");
  
  let newRow = getNewRow(txSheet);
  
  txSheet.getRange(newRow, 1, 1, 4).setValues([ [ 
    transaction.date,
    transaction.description,
    transaction.category,
    transaction.value
  ]]);

  let JSONOutput = ContentService.createTextOutput(`{"success":true}`);
  JSONOutput.setMimeType(ContentService.MimeType.JSON);
  return JSONOutput;
}

Once this has been entered, publish the script as a Web App (with anonymous access). Google have some instructions on this process here.

Create a new webhook as a JSON POST, and use the URL of the Google Script.

License

UpThing is open-sourced software licensed under the MIT license.

upthing's People

Contributors

aliask avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 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.