Skip to content

Script which shows your Reddit-Karma, Coins, Profile Image etc.

Notifications You must be signed in to change notification settings

mvan231/Reddit-Widget

 
 

Repository files navigation

Reddit User Widget for Scriptable {}

Script which shows your Karma, Coin-Balance, Profile Image, Cakeday, Profile Image etc.

Update Notes 1.1 (May 05th 2022)

  • Updated Function for calculating karma numbers (e.g. 1494 = 1.494K; 20567 = 20.57K; 1000000 = 1M etc.)
  • Added Feature notification Badge also for Medium Widget
  • Added selfupdate function (Function is written by the amazing @mvan231 - Thx for your Support)

Next Update Includes:

  • Saves USERNAME, PASSWORD, CLIENT_ID & CLIENT_SECRET as JSON to iCloud. After an script-update you'll find your Login datas there.

✨ FEATURES

Overview

Theme

The Widget has a Dynamic Gradient Background

Happy Cakeday

Today is your Cakeday!? The widget will tell you subtly.

⚙️ SETUP

Create Personal Reddit App/Script

  1. Login to your Account and go to https://old.reddit.com/prefs/apps/

  2. Create new Personal Script

  1. Click Checkbox "script" and set a redirect uri (e.g. same as in the image)

  1. Create App

  2. Copy Client_ID & Client_Secret

  1. Config Script
const USERNAME = 'your-username' //without 'u/'
const PASSWORD = 'your-password'

const CLIENT_ID = 'ABC1234567-XYZ7654321'
const CLIENT_SECRET = 'qwertzuiopasdfghjklyxcvbnm'

const showNotifyBadge = true //smallwidget
const showCoinBalance = true //smallwidget, mediumwidget
const showCakedayConfetti = true //smallwidget, mediumwidget
const showUserTitle = true //mediumwidget, largewidget
const cornerRadiusProfileImg = 0 //Set +50 for a rounded Image
const standardRedditClient = 'Apollo'//Enter Apollo or Reddit

Official Reddit API Guidelines: https://github.com/reddit-archive/reddit/wiki/OAuth2


Set Widget Parameter

Default: Reddit;60
For App Icon (Small & Medium) and clickable elements; Widget Refresh Intervall in minutes

Long tab the individual widget an chose Edit "Scriptable" or Edit Widget set a number for the update intervall (in minutes) into the widget Parameter - The script runs every X minutes yet. If it's not filled the script runs default every 60 minutes.

Helper-Shortcut for downloading App-Icons from the App-Store: https://routinehub.co/shortcut/11635/


Run Script In App

By running the scirpt In App it will present a menu including Username, Total Karma, Coin Balance & Unread Inbox Count at the Top. You can choose one of the following three options in the sheet: Show small-, medium-, largewidget or open your profile in your standard Reddit-Client (Create Personal Reddit App/Script - 6. Config Script)

⬇️ INSTALL SCRIPT & WIDGET

Install Script

  1. Install Scriptable for iOS
  2. Copy each line of the Script or download this helper shortcut
  3. + Add new Script

Scriptable-File

  1. Paste it into the new Script
  2. Finish

Add Widget To Homescreen

  1. Go to your homescreen and long tab anywhere
  2. By tapping the + it will opens the gallery
  3. chose or search for scriptable
  4. Chose the widget-size and tap "Add Widget"
  5. Tap the widget and choose the script, then set "When Interacting" = "Run Script"
  6. Set the widget Parameters (if you want)
  7. Finish

On First Run

It will Downloads and Save the Following Symbols at the directory "Reddit-Widget"

iCloud Drive/
├─ Scriptable/
│  ├─ Reddit-Widget/
│  │  ├─ karma.png
│  │  ├─ coins.png
│  │  ├─ cakedayApollo.png
│  │  ├─ cakedayConfetti.png
---- alternative symbols ----
│  │  ├─ coins2.png
│  │  ├─ cakedayReddit.png


Known Issues!

  • Long usernames may not display correctly (Small-Widget)
  • Long usertitles may not be displayed correctly in conjunction with username (Medium-Widget)
  • High karma values (>10k) may not be displayed correctly (Small-Widget)

About

Script which shows your Reddit-Karma, Coins, Profile Image etc.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%