Skip to content

Commit 76a228d

Browse files
committed
init
0 parents  commit 76a228d

6 files changed

Lines changed: 53 additions & 0 deletions

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.vscode
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"isAutoTriggerEnabled":true,"extractByRegex":"","jsonBody":[],"id":"76E7C4B2-0851-4992-A027-5635B7377AC8","textBody":"","notificationEnabled":false,"responseExtractMethod":"JavaScript","headers":[],"autoTriggerInterval":60,"notificationType":"extractedValueStringEqual","alias":"💰 BNB","notificationValue":"","url":"https:\/\/api.coingecko.com\/api\/v3\/simple\/price?ids=binancecoin&vs_currencies=usd","extractByJavaScript":"let json = JSON.parse(responseString);\nlet bnbPrice = json[\"binancecoin\"].usd;\nlet bnbPriceFormatted = bnbPrice.toFixed(2);\nreturn `$${bnbPriceFormatted}`;","creationDate":1756650707.7738431,"bodyType":"JSON","extractByKeyPath":[{"indexValue":"","type":"key","uuid":"A77F179B-C7F1-4AFC-98A8-72F13924E995","keyValue":"bpi"},{"type":"key","keyValue":"USD","indexValue":"","uuid":"7DCC3AFA-9969-40E3-B638-121D08CC8EA8"},{"keyValue":"rate","uuid":"A7709A18-1010-4F31-94FA-7B31DCD6DBAF","type":"key","indexValue":""}],"replaceOccurrence":[],"method":"GET"}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"bodyType":"Raw","id":"E651A01A-9C80-42E9-BA40-A91FCFDC5140","responseExtractMethod":"JavaScript","extractByKeyPath":[{"uuid":"A77F179B-C7F1-4AFC-98A8-72F13924E995","keyValue":"bpi","type":"key","indexValue":""},{"keyValue":"USD","uuid":"7DCC3AFA-9969-40E3-B638-121D08CC8EA8","indexValue":"","type":"key"},{"uuid":"A7709A18-1010-4F31-94FA-7B31DCD6DBAF","type":"key","indexValue":"","keyValue":"rate"}],"method":"GET","alias":"💰 BTC","autoTriggerInterval":300,"notificationType":"extractedValueStringEqual","notificationValue":"","replaceOccurrence":[],"jsonBody":[],"url":"https:\/\/api.coingecko.com\/api\/v3\/simple\/price?ids=bitcoin&vs_currencies=usd","isAutoTriggerEnabled":true,"textBody":"","extractByJavaScript":"let json = JSON.parse(responseString);\nlet btcPrice = json.bitcoin.usd; \/\/ Direct number, no commas\nlet btcPriceKeepTwoDigits = btcPrice.toFixed(2);\nreturn `$${btcPriceKeepTwoDigits}`;","creationDate":1703653671.9609408,"extractByRegex":"","notificationEnabled":false,"headers":[]}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"bodyType":"JSON","id":"28846BE5-129E-4016-86E1-9868CEB3EE8E","extractByRegex":"","creationDate":1759546209.1407409,"isAutoTriggerEnabled":true,"textBody":"","method":"GET","autoTriggerInterval":300,"notificationType":"extractedValueStringEqual","extractByKeyPath":[{"uuid":"A77F179B-C7F1-4AFC-98A8-72F13924E995","keyValue":"bpi","indexValue":"","type":"key"},{"uuid":"7DCC3AFA-9969-40E3-B638-121D08CC8EA8","type":"key","indexValue":"","keyValue":"USD"},{"keyValue":"rate","uuid":"A7709A18-1010-4F31-94FA-7B31DCD6DBAF","indexValue":"","type":"key"}],"notificationValue":"","alias":"💰 KCS","responseExtractMethod":"JavaScript","jsonBody":[],"headers":[],"url":"https:\/\/api.coingecko.com\/api\/v3\/simple\/price?ids=kucoin-shares&vs_currencies=usd","notificationEnabled":false,"replaceOccurrence":[],"extractByJavaScript":"let json = JSON.parse(responseString);\nlet kcsPrice = json[\"kucoin-shares\"].usd;\nlet kcsPriceFormatted = kcsPrice.toFixed(2);\nreturn `$${kcsPriceFormatted}`;"}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"alias":"💰 XRP","creationDate":1760873770.488019,"jsonBody":[],"replaceOccurrence":[],"headers":[],"extractByRegex":"","extractByKeyPath":[{"keyValue":"bpi","uuid":"A77F179B-C7F1-4AFC-98A8-72F13924E995","type":"key","indexValue":""},{"keyValue":"USD","uuid":"7DCC3AFA-9969-40E3-B638-121D08CC8EA8","type":"key","indexValue":""},{"type":"key","uuid":"A7709A18-1010-4F31-94FA-7B31DCD6DBAF","indexValue":"","keyValue":"rate"}],"method":"GET","id":"97F3C6B7-EAD7-418E-A04F-74D66F988259","autoTriggerInterval":300,"textBody":"","url":"https:\/\/api.coingecko.com\/api\/v3\/simple\/price?ids=monero&vs_currencies=usd","notificationEnabled":false,"responseExtractMethod":"JavaScript","bodyType":"Raw","notificationValue":"","notificationType":"extractedValueStringEqual","isAutoTriggerEnabled":true,"extractByJavaScript":"let json = JSON.parse(responseString);\nlet xrpPrice = json.monero.usd; \/\/ Direct number, no commas\nlet xrpPriceKeepTwoDigits = xrpPrice.toFixed(2);\nreturn `$${xrpPriceKeepTwoDigits}`;"}

readme.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# HTTP Widget Scripts
2+
A collection of various scripts for that app HTTP Widget
3+
## HTTP Widget
4+
5+
A lightweight widget for fetching and formatting cryptocurrency prices from public APIs like CoinGecko.
6+
7+
### Features
8+
9+
- Fetch live crypto prices (e.g., XRP, Monero) in USD.
10+
- Extract values using key paths, regex, or custom JavaScript.
11+
- Auto-refresh with configurable intervals.
12+
- Supports notifications based on extracted values.
13+
14+
### Installation
15+
16+
Clone the repository:
17+
18+
```bash
19+
git clone https://github.com/yourusername/httpwidget.git
20+
cd httpwidget
21+
22+
Open in your preferred environment and configure your widgets JSON files.
23+
24+
Usage
25+
1. Configure your widget JSON with:
26+
• url for the API endpoint.
27+
• extractByKeyPath or extractByJavaScript to parse the response.
28+
• Optional autoTriggerInterval for periodic updates.
29+
2. Load the widget in the app.
30+
3. View live prices and formatted outputs.
31+
32+
Example JSON
33+
34+
{
35+
"alias": "💰 XRP",
36+
"url": "https://api.coingecko.com/api/v3/simple/price?ids=monero&vs_currencies=usd",
37+
"extractByJavaScript": "let json = JSON.parse(responseString);\nlet xrpPrice = json.monero.usd;\nreturn `$${xrpPrice.toFixed(2)}`;",
38+
"autoTriggerInterval": 300
39+
}
40+
41+
Contribution
42+
• Add new cryptocurrency endpoints.
43+
• Improve extraction methods.
44+
• Enhance notifications or formatting options.
45+
46+
License
47+
48+
MIT License. No PII is stored in this repository; all data comes from public APIs.

0 commit comments

Comments
 (0)