This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Function to save the token to iCloud | |
async function saveAccessToken(token) { | |
let fileManager = FileManager.iCloud(); | |
let filePath = fileManager.joinPath(fileManager.documentsDirectory(), "threads_token.txt"); | |
// Save the token to iCloud | |
fileManager.writeString(filePath, token); | |
console.log("Access token saved to iCloud."); | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Function to save the token to iCloud | |
async function saveAccessToken(token) { | |
let fileManager = FileManager.iCloud(); | |
let filePath = fileManager.joinPath(fileManager.documentsDirectory(), "threads_token.txt"); | |
// Save the token to iCloud | |
fileManager.writeString(filePath, token); | |
console.log("Access token saved to iCloud."); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let token = "change_me"; // Replace with your actual access token | |
// Path to the token file in iCloud (Scriptable iCloud directory) | |
let filePath = FileManager.iCloud().joinPath(FileManager.iCloud().documentsDirectory(), "threads_token.txt"); | |
// Save the token in the file | |
FileManager.iCloud().writeString(filePath, token); | |
console.log("Token saved to iCloud."); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Define the API URLs and access token | |
const insightsApiUrlBase = "https://graph.threads.net/v1.0/"; | |
// Function to get the access token from iCloud | |
async function getAccessToken() { | |
let fileManager = FileManager.iCloud(); | |
let filePath = fileManager.joinPath(fileManager.documentsDirectory(), "threads_token.txt"); | |
// Check if the file exists | |
if (!fileManager.fileExists(filePath)) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#######!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!####### | |
# PLEASE MAKE SURE DURING BUILD TRANSACTION STEP YOU PUT YOUR OWN POOL ID after required-signer-hash!!!!!!!!!!!!!!!! | |
# PLEASE MAKE SURE DURING BUILD TRANSACTION STEP YOU PUT YOUR OWN POOL ID after required-signer-hash!!!!!!!!!!!!!!!! | |
# PLEASE MAKE SURE DURING BUILD TRANSACTION STEP YOU PUT YOUR OWN POOL ID after required-signer-hash!!!!!!!!!!!!!!!! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GBPEUR=$(curl -s "https://api.transferwise.com/v3/comparisons/?sourceCurrency=GBP&targetCurrency=EUR&sendAmount=8000" | jq .providers | jq '.[] | select( .alias == "wise" ).quotes' | jq .[].rate) | |
echo "gbpeur ${GBPEUR}" > /adapools/stats/wise.prom |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"__inputs": [ | |
{ | |
"name": "DS_LOKI", | |
"label": "Loki", | |
"description": "", | |
"type": "datasource", | |
"pluginId": "loki", | |
"pluginName": "Loki" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"LocalRoots": { | |
"groups": [ | |
{ | |
"localRoots": { | |
"accessPoints": [ | |
{ | |
"address": "bp-host-name/ip", | |
"port": 3001 | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# script should be located under /adapools directory and statistic file in /adapools/stats directory | |
# mkdir -p /adapools/stats | |
# our crontab entry: | |
# * * * * * /adapools/price.sh | |
# node exporter should be reading /adapools/stats directory something like this: | |
# --collector.textfile.directory=/adapools/stats | |
# following metrics should be availlable in grafana, if you did everything right - adaeur, adausd, btcusd & ethusd | |
PRICES=$(curl -s https://api.kraken.com/0/public/Ticker?pair=ADAEUR,ADAUSD,XXBTZUSD,XETHZUSD) | |
echo $PRICES | jq .result.ADAEUR.c | jq .[0] | sed 's/"//g'| sed 's/^/adaeur /' > /adapools/stats/price.prom | |
echo $PRICES | jq .result.ADAUSD.c | jq .[0] | sed 's/"//g'| sed 's/^/adausd /' >> /adapools/stats/price.prom |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- With this Lua code we will substitute body of header "User-Agent" to cisco, if there are more then one User-Agent headers, then we will fix them all. | |
-- Just add this to your docker compose part for heplify-server: | |
-- volumes: | |
-- - ./lua:/lua | |
-- set variables: | |
-- - "HEPLIFYSERVER_SCRIPTENABLE=true" | |
-- - "HEPLIFYSERVER_SCRIPTFOLDER=/lua/" | |
-- put your script in ./lua directory and restart docker-container | |
NewerOlder