Skip to content

Instantly share code, notes, and snippets.

@0507spc
0507spc / strava.js
Created January 11, 2021 10:18 — forked from scottpdawson/strava.js
Bulk download Strava activities
var maxPage = 25; // calculate this using (activities/20 + 1)
var activityType = "Run"; // change to the workout type you want, or blank for all
var p = 1;
var done = 0;
var url;
var nw = window.open("workouts.html");
nw.document.write("[");
while (p <= maxPage) {
url = "https://www.strava.com/athlete/training_activities" +
"?keywords=&activity_type=" + activityType + "&workout_type=&commute=&private_activities=" +
@0507spc
0507spc / DataUsage.py
Created January 7, 2021 00:46 — forked from Terrance/DataUsage.py
Methods for parsing free mobile data usage on Three UK and FreedomPop UK. No guarantees that these will work with paid data plans.
from collections import namedtuple
from datetime import datetime, date, timedelta
import re
import requests
from bs4 import BeautifulSoup
Row = namedtuple("Row", ["number", "network", "total", "left", "reset"])
let items = await loadItems()
// if (config.runsInWidget) {
let widget = createWidget(items)
Script.setWidget(widget)
Script.complete()
// } else {
// let item = items[0]
// Safari.open(item.url)
// }
// Shows latest news from MacStories in a table.
// The table shows an image from the article, if available, and the title of the article.
let inputStr = args.widgetParameter
// if exclude itrms, this meeds to be higger than vLimit
// logError(inputStr)
if ( inputStr == null ) { inputStr = "apollo@scriptable@1@pic@4" }
let vRedditLimit = 15
let vItemCount = 1
var res = inputStr.split("@")
// Shows latest news from MacStories in a table.
// The table shows an image from the article, if available, and the title of the article.
// let rReddit = "scriptable"
let inputStr = args.widgetParameter
// if exclude itrms, this meeds to be higger than vLimit
// logError(inputStr)
if ( inputStr == null ) { inputStr = "apollo@scriptable@1" }
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: black; icon-glyph: user-md;
var fm = FileManager.iCloud()
var imgLocation = fm.bookmarkedPath("WeightTracker.png")
var imgToShow = fm.readImage(imgLocation)
if (config.runsInWidget) {