Login About Gallery
Fitbit Importer
COMMENT
‎Created by Travis Roman https://shortcuts.toggleable.com/fitbit-importer/
VARIABLES
‎Set variable ‎Queue ‎to ‎Shortcut Input
VARIABLES
‎Set variable ‎Unshift ‎to ‎Input
DICTIONARY
TEXT
‎{ "null": "<null>", "forever": 1500, "listChunkSize": 500, "listChunkHTML": "<!DOCTYPE html><html><head></head><body>\n <script>\n let arr = (DICT).list;\n const origArr = Array.from(arr);\n let dictArr = {};\n \n let arrParts = Math.max(Math.ceil(arr.length / CHUNKSIZE), 1);\n\n for (let i = 1; i <= arrParts; i++)\n dictArr[i] = arr.splice(0, CHUNKSIZE);\n \n document.write(JSON.stringify({ total: origArr.length, listCount: arrParts, lists: dictArr }));\n </script>\n</body></html>", "instructionsURL": "https://shortcuts.toggleable.com/fitbit-importer/instructions", "fitbit": { "baseAPIURL": "https://api.fitbit.com", "authorizeURL": "https://www.fitbit.com/oauth2/authorize?response_type=token&client_id=CLIENT_ID&redirect_uri=CALLBACK_URL&scope=heartrate%20profile%20sleep%20activity%20weight%20nutrition&expires_in=31536000&prompt=login%20consent&state=STATE" }, "commands": { "authorize": { "command": "authorize" }, "reset-authorization": { "command": "reset-authorization" }, "get-authorization": { "command": "get-file", "file": "auth.json" }, "options": { "command": "options" }, "check-for-updates-main": { "command": "check-for-updates", "for": "main" }, "redo-setup": { "command": "redo-setup" }, "first-run": { "command": "first-run" }, "get-config": { "command": "get-config" }, "get-strings": { "command": "get-strings" }, "exit": { "command": "exit" } }, "files": { "dirname": "/fitbit-importer", "auth": "auth.json", "skipped-updates": "skipped-updates.txt", "prefs": "prefs.json", "imported-exercises": "imported-exercises.txt" }, "exit": { "ok": 0 }, "info": { "main": { "name": "Fitbit Importer", "updateURL": "https://shortcuts.toggleable.com/fitbit-importer/latest.json", "releaseNotesURL": "https://shortcuts.toggleable.com/fitbit-importer/release-notes" }, "automated": { "name": "Fitbit Importer Automated", "updateURL": "https://shortcuts.toggleable.com/fitbit-importer-automated/latest.json", "releaseNotesURL": "https://shortcuts.toggleable.com/fitbit-importer-automated/release-notes" } }, "strings": { "English": { "profile": "Profile", "heart-rate": "Heart Rate", "sleep": "Sleep", "steps": "Steps", "distance": "Distance", "calories": "Calories", "fat": "Body Fat", "weight": "Weight", "nutrition": "Nutrition", "water": "Water", "exercises": "Exercises", "choose-option": "Choose what data to import into Apple Health", "choose-date": "Choose a day to import from", "getting-entries": "Getting current entries…", "processing-data": "Processing data… Keep the Shortcuts app open!", "processing-total": "Processing TOTAL points of data… Keep the Shortcuts app open!", "processing-current": "Processed CURRENT/TOTAL points of data…", "processing-finished": "Finished processing data in TIME.", "failed-fetch": "Failed to fetch data. Login information has been reset. Please try again.", "install-update": "Install Update", "view-release-notes": "View Full Release Notes", "skip-update": "Skip This Version", "instructions": "Instructions", "begin-setup": "Begin Setup", "release-notes": "Release Notes", "update-available": "Update Available", "client-id": "Client ID", "callback-url": "Callback URL", "logged-in-as": "Logged in as NAME", "import-data": "Import Data", "check-for-updates": "Check for Updates", "clear-authorization": "Clear Authorization", "confirm-clear-authorization": "Are you sure you want to clear authorization information?", "continue-on-fitbit": "Authorize on Fitbit", "redo-setup": "Redo Setup", "redo-setup-confirm": "Are you sure you want to redo the setup process?", "redo-setup-description": "You'll have to provide your Client ID and Callback URL again if you do this.", "invalid-date-future": "You can't choose a date in the future.", "invalid-date-range": "End date must be after start date.", "choose-date-start": "Choose a start date", "choose-date-end": "Choose an end date", "choose-date-range": "Between Dates", "choose-date-single": "From A Single Day", "no-data-found": "No data was found.", "nutrition-import-date": "You can only import nutrition/water data for past dates. This is to ensure all log entries have been entered.", "reaching-out": "Reaching out to Fitbit…", "description-heart rate": "intraday and resting heart rate", "description-sleep": "time spent in bed, asleep, and awake", "description-steps": "daily step count", "description-distance": "distance travelled", "description-calories": "active and resting calories", "description-fat": "body fat percentage", "description-weight": "weight and BMI", "description-nutrition": "totals for carbs, fat, fiber, protein, sodium, and dietary calories", "description-water": "water intake", "description-exercises": "walks and runs" } }, "empty": {} }
SCRIPTING
‎Get dictionary from ‎Text
VARIABLES
‎Set variable ‎Config ‎to ‎Dictionary
DOCUMENTS
‎Replace ‎CHUNKSIZE ‎with ‎Config ‎in ‎Config
Case Sensitive
Regular Expression
VARIABLES
‎Set variable ‎List Chunk HTML ‎to ‎Updated Text
SCRIPTING
‎Repeat ‎Config
SCRIPTING
‎If ‎Queue ‎does not have any value
VARIABLES
‎Add ‎Config ‎to ‎Queue
VARIABLES
‎Add ‎Config ‎to ‎Queue
SCRIPTING
‎End If
SCRIPTING
‎Get ‎First Item ‎from ‎Queue
VARIABLES
‎Set variable ‎Input ‎to ‎Item from List
VARIABLES
‎Set variable ‎Command ‎to ‎Input
VARIABLES
‎Set variable ‎Result ‎to ‎Input
SCRIPTING
‎Get ‎All Keys ‎in ‎Input
SCRIPTING
‎If ‎Input Keys ‎contains ‎result
VARIABLES
‎Set variable ‎Has Result ‎to ‎Config
SCRIPTING
‎Otherwise
VARIABLES
‎Set variable ‎Has Result ‎to ‎Config
SCRIPTING
‎End If
SCRIPTING
‎Count ‎Items ‎in ‎Queue
SCRIPTING
‎If ‎Count ‎is greater than ‎1
SCRIPTING
‎Get ‎Items in Range ‎2 ‎to ‎Count ‎from ‎Queue
SCRIPTING
‎Otherwise
LIST
SCRIPTING
‎End If
VARIABLES
‎Set variable ‎Queue ‎to ‎If Result
DATE
‎Current Date
DOCUMENTS
‎Get File
Service
‎iCloud Drive
Show Document Picker
File Path
‎/Shortcuts/example.txt
Error If Not Found
SCRIPTING
‎Get ‎Value ‎for ‎language ‎in ‎Prefs
SCRIPTING
‎If ‎Language ‎has any value
SCRIPTING
‎Get ‎Value ‎for ‎strings ‎in ‎Config
SCRIPTING
‎Get ‎Value ‎for ‎Language ‎in ‎Config Strings
SCRIPTING
‎Otherwise
SCRIPTING
‎Get ‎Value ‎for ‎English ‎in ‎Config
SCRIPTING
‎End If
VARIABLES
‎Set variable ‎Strings ‎to ‎User Strings
SCRIPTING
‎If ‎Command ‎is ‎exit
SCRIPTING
‎Exit shortcut with ‎Input
SCRIPTING
‎End If
SCRIPTING
‎If ‎Command ‎is ‎first-run
DOCUMENTS
‎Create Folder
Service
‎iCloud Drive
Path
‎[{'value': '/Shortcuts/', 'class': 'text'}, {'class': 'magic', 'value': 'Config', 'glyph': 'assets/cat/Variable.svg', 'UUID': ''}]
SCRIPTING
‎Choose from Menu
SCRIPTING
‎Strings (begin-setup)
SCRIPTING
‎Get ‎All Keys ‎in ‎Config
SCRIPTING
‎Choose from ‎Language Options
Prompt
‎Choose a language
Select Multiple
SCRIPTING
‎Ask ‎Strings
Input Type
‎Text
Default Answer
‎Text
DOCUMENTS
‎Replace ‎^\s*([^\s]+)\s*$ ‎with ‎$1 ‎in ‎Setup Client ID
Case Sensitive
Regular Expression
SCRIPTING
‎Ask ‎Strings
Input Type
‎URL
Default Answer
‎Text
DOCUMENTS
‎Replace ‎^\s*([^\s]+)\s*$ ‎with ‎$1 ‎in ‎Setup Callback URL
Case Sensitive
Regular Expression
DICTIONARY
DOCUMENTS
‎Save ‎Dictionary
Service
‎iCloud Drive
Ask Where to Save
Destination Path
‎[{'value': '/Shortcuts/', 'class': 'text'}, {'class': 'magic', 'value': 'Config', 'glyph': 'assets/cat/Variable.svg', 'UUID': ''}, {'value': '/', 'class': 'text'}, {'class': 'magic', 'value': 'Config', 'glyph': 'assets/cat/Variable.svg', 'UUID': ''}]
Overwrite If File Exists
SCRIPTING
‎Strings (instructions)
SAFARI
‎Open ‎Config
SCRIPTING
‎Exit shortcut with ‎Result
SCRIPTING
‎End Menu
SCRIPTING
‎End If
SCRIPTING
‎If ‎Command ‎is ‎redo-setup
SCRIPTING
‎Show alert ‎Strings
Title
‎[{'class': 'magic', 'value': 'Strings', 'glyph': 'assets/cat/Variable.svg', 'UUID': ''}]
Show Cancel Button
DOCUMENTS
‎Get File
Service
‎iCloud Drive
Show Document Picker
File Path
‎/Shortcuts/example.txt
Error If Not Found
DOCUMENTS
‎Delete ‎File
Confirm Before Deleting
VARIABLES
‎Add ‎Config ‎to ‎Unshift
SCRIPTING
‎End If
SCRIPTING
‎If ‎Command ‎is ‎options
SCRIPTING
‎If ‎Has Result ‎is ‎Config
SCRIPTING
‎Set ‎callback ‎to ‎Input ‎in ‎Dictionary
VARIABLES
‎Add ‎Dictionary ‎to ‎Unshift
SCRIPTING
‎Otherwise
DOCUMENTS
‎Replace ‎NAME ‎with ‎Result ‎in ‎Strings
Case Sensitive
Regular Expression
TEXT
‎◀︎ ‎Updated Text ‎ ▶︎ ‎Config
SCRIPTING
‎Choose from Menu
SCRIPTING
‎Strings (import-data)
VARIABLES
‎Set variable ‎DateRangeList ‎to ‎Input
TEXT
‎BEGIN:VCARD VERSION:3.0 N;CHARSET=utf-8: ‎Strings ‎;;;; ORG: ‎Strings ‎; TITLE:heart rate END:VCARD BEGIN:VCARD VERSION:3.0 N;CHARSET=utf-8: ‎Strings ‎;;;; ORG: ‎Strings ‎; TITLE:sleep END:VCARD BEGIN:VCARD VERSION:3.0 N;CHARSET=utf-8: ‎Strings ‎;;;; ORG: ‎Strings ‎; TITLE:steps END:VCARD BEGIN:VCARD VERSION:3.0 N;CHARSET=utf-8: ‎Strings ‎;;;; ORG: ‎Strings ‎; TITLE:distance END:VCARD BEGIN:VCARD VERSION:3.0 N;CHARSET=utf-8: ‎Strings ‎;;;; ORG: ‎Strings ‎; TITLE:calories END:VCARD BEGIN:VCARD VERSION:3.0 N;CHARSET=utf-8: ‎Strings ‎;;;; ORG: ‎Strings ‎; TITLE:fat END:VCARD BEGIN:VCARD VERSION:3.0 N;CHARSET=utf-8: ‎Strings ‎;;;; ORG: ‎Strings ‎; TITLE:weight END:VCARD BEGIN:VCARD VERSION:3.0 N;CHARSET=utf-8: ‎Strings ‎;;;; ORG: ‎Strings ‎; TITLE:nutrition END:VCARD BEGIN:VCARD VERSION:3.0 N;CHARSET=utf-8: ‎Strings ‎;;;; ORG: ‎Strings ‎; TITLE:water END:VCARD BEGIN:VCARD VERSION:3.0 N;CHARSET=utf-8: ‎Strings ‎;;;; ORG: ‎Strings ‎; TITLE:exercises END:VCARD
SCRIPTING
‎Set name of ‎Text ‎to ‎Options.vcf
SCRIPTING
‎Choose from ‎Options VCF
Prompt
‎[{'class': 'magic', 'value': 'Strings', 'glyph': 'assets/cat/Variable.svg', 'UUID': ''}]
Select Multiple
Select All Initially
SCRIPTING
‎Count ‎Items ‎in ‎Chosen Data Types
SCRIPTING
‎If ‎Count ‎is greater than ‎0
TEXT
‎Combine ‎Chosen Data Types ‎with ‎Custom ‎,
TEXT
‎◀︎ ‎Combined Text ‎ ▶︎ ‎Config
SCRIPTING
‎Choose from Menu
SCRIPTING
‎Strings (choose-date-range)
SCRIPTING
‎Ask ‎Strings
Input Type
‎Date
Default Answer
‎Time
SCRIPTING
‎Ask ‎Strings
Input Type
‎Date
Default Answer
‎Time
SCRIPTING
‎If ‎Chosen Start Date ‎is greater than ‎Chosen End Date
SCRIPTING
‎Show alert ‎Informational Message
Title
‎optional
Show Cancel Button
SCRIPTING
‎Exit shortcut with ‎Result
SCRIPTING
‎End If
SCRIPTING
‎If ‎Chosen End Date ‎is greater than ‎Current Date
SCRIPTING
‎Show alert ‎Informational Message
Title
‎optional
Show Cancel Button
SCRIPTING
‎Exit shortcut with ‎Result
SCRIPTING
‎End If
SCRIPTING
‎If ‎Chosen Start Date ‎is greater than ‎Current Date
SCRIPTING
‎Show alert ‎Informational Message
Title
‎optional
Show Cancel Button
SCRIPTING
‎Exit shortcut with ‎Result
SCRIPTING
‎End If

Showcuts

Magic Vars

Screenshot

Submitted Anonymously over a year ago

Visit iCloud (iOS)

Copy iCloud Link

Scan QR Code

0

615 more actions