Skip to content

Instantly share code, notes, and snippets.

@fyhao
fyhao / popcatclick.js
Created August 14, 2021 11:02
popcat click
function send() {
var keyboardEvent = document.createEvent('KeyboardEvent');
var initMethod = typeof keyboardEvent.initKeyboardEvent !== 'undefined' ? 'initKeyboardEvent' : 'initKeyEvent';
keyboardEvent[initMethod](
'keydown', // event type: keydown, keyup, keypress
true, // bubbles
true, // cancelable
window, // view: should be window
false, // ctrlKey
@fyhao
fyhao / Nearby Bus Stop.js
Created November 14, 2020 14:49
Scriptable widget script to show Singapore nearby bus stop
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: pink; icon-glyph: magic;\
queryBusStopCode(function(code) {
queryBusArrival(code, function(arrivalData) {
let widget = createWidget({'busstopcode':code,'arrivalData':arrivalData});
if (config.runsInWidget) {
// The script runs inside a widget, so we pass our instance of ListWidget to be shown inside the widget on the Home Screen.