ESPN's hidden API endpoints
Latest News: http://site.api.espn.com/apis/site/v2/sports/football/college-football/news
Latest Scores: http://site.api.espn.com/apis/site/v2/sports/football/college-football/scoreboard
| import CoreGraphics | |
| extension CGKeyCode | |
| { | |
| /* | |
| * From Events.h in Carbon.framework | |
| * Summary: | |
| * Virtual keycodes | |
| * | |
| * Discussion: |
| // Variables used by Scriptable. | |
| // These must be at the very top of the file. Do not edit. | |
| // icon-color: cyan; icon-glyph: magic; | |
| // the node sonos http api base url (running on your Pi for example) | |
| let sonosBaseUrl = "http://192.168.178.10:5005" | |
| // optional for cover art: the ip address of one of your Sonos speakers | |
| let sonosPlayerUrl = "http://192.168.178.38:1400" | |
| let param = args.widgetParameter |
| import SwiftUI | |
| import PlaygroundSupport | |
| struct ContentView: View { | |
| @State var text = "" | |
| var body: some View { | |
| SearchBar(text: $text) | |
| } | |
| } |
| import SwiftUI | |
| import WebKit | |
| struct ContentView: View { | |
| var body: some View { | |
| Webview(url: URL(string: "https://google.com")!) | |
| } | |
| } | |
| struct Webview: UIViewRepresentable { |
| /** | |
| * MacEditorTextView | |
| * Copyright (c) Thiago Holanda 2020-2021 | |
| * https://bsky.app/profile/tholanda.com | |
| * | |
| * (the twitter account is now deleted, please, do not try to reach me there) | |
| * https://twitter.com/tholanda | |
| * | |
| * MIT license | |
| */ |
Latest News: http://site.api.espn.com/apis/site/v2/sports/football/college-football/news
Latest Scores: http://site.api.espn.com/apis/site/v2/sports/football/college-football/scoreboard
The following are examples of the four types rate limiters discussed in the accompanying blog post. In the examples below I've used pseudocode-like Ruby, so if you're unfamiliar with Ruby you should be able to easily translate this approach to other languages. Complete examples in Ruby are also provided later in this gist.
In most cases you'll want all these examples to be classes, but I've used simple functions here to keep the code samples brief.
This uses a basic token bucket algorithm and relies on the fact that Redis scripts execute atomically. No other operations can run between fetching the count and writing the new count.
| <?xml version='1.0' encoding='utf-8' ?> | |
| <!--This is the basics - platform (windows or mac)and version number--> | |
| <workbook source-platform='mac' version='9.0' xmlns:user='http://www.tableausoftware.com/xml/user'> | |
| <!-- build 9000.15.0318.1720 --> | |
| <!--No idea what this for --> | |
| <preferences> | |
| <preference name='ui.encoding.shelf.height' value='250' /> | |
| <preference name='ui.shelf.height' value='250' /> | |
| </preferences> | |
| <!--This is everything you need to know about datasources --> |