busylog
minimal example for full screen browser with droidscript
Droidscript site: https://droidscript.org/
Google Play: https://play.google.com/store/apps/details?id=com.smartphoneremote.androidscriptfree
Docs: https://droidscript.github.io/Docs/docs/latest/Docs.htm
function OnStart()
{
app.SetScreenMode("Game");
lay = app.CreateLayout("linear", "FillXY");
web = app.CreateWebView(
1, 1,
"Wide,NoActionBar,NoScrollBars,NoLongTouch,NoLocate"
);
lay.AddChild(web);
app.AddLayout(lay);
app.ChooseFile(
"Open HTML",
"text/html",
function(url)
{
web.LoadUrl(url);
}
);
}
busylog
devtools script to extract apple music playlist
it is also a nice example to expand/edit to suit other uses. disclaimer: ai generated code
copy(JSON.stringify(
[...document.querySelectorAll('div.songs-list-row')].map((row, i) => {
const links = [...row.querySelectorAll('a.click-action[href]')];
return {
rank: i + 1,
links: links.map(a => ({
text: a.innerText.trim(),
url: a.href
}))
};
}),
null,
2
));
busylog
Vue/Nuxt list transform in python
unwrap is optional but looks better.
def unwrap(value):
if isinstance(value, list) and len(value) == 2:
if isinstance(value[0], str) and value[0] in ("ShallowReactive", "Reactive"):
return value[1]
return value
def expand(value, data):
if isinstance(value, dict):
return {
key: expand(val, data)
for key, val in value.items()
}
if isinstance(value, list):
return unwrap([
expand(item, data)
for item in value
])
if isinstance(value, int):
if isinstance(data[value], (dict,list)):
return expand(data[value], data)
else:
return data[value]
return value