Skip to content

Instantly share code, notes, and snippets.

View binocularity's full-sized avatar

Nick Holliman binocularity

View GitHub Profile
req = HTTPRequest[
"http://api.thingspeak.com/channels/1417/field/2/last.json"];
f[] := (
colour = Brown;
reqStat = Quiet[ URLRead[ req, TimeConstraint -> 2]];
If[ Not[FailureQ[reqStat]],
( rawData = Import[req];
colour = RGBColor[Lookup[ rawData, "field2"]]; )
];
colour
@binocularity
binocularity / CheerLights_Mathematica.txt
Created October 18, 2022 20:15
@cheerlights dynamic updating with dropped network mangement in @WolframResearch Mathematica from @binocularity
req = HTTPRequest[
"http://api.thingspeak.com/channels/1417/field/2/last.json"];
f[] := (
colour = HatchFilling[];
reqStat = Quiet[ URLRead[ req, TimeConstraint -> 2]];
If[ Not[FailureQ[reqStat]],
( rawData = Import[req];
colour = RGBColor[Lookup[ rawData, "field2"]]; )
];
colour