Skip to content

Commit a9c5417

Browse files
author
Jan Groenewald
committed
Change to ZAR
1 parent ef9342f commit a9c5417

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# usd-bra
1+
# usd-zar
22

3-
USR-BRA is a Gnome extension that displays the Dolar to Real currency. And all the values are getting from API AWESOMEAPI https://docs.awesomeapi.com.br
3+
USR-ZAR is a Gnome extension that displays the Dolar to Real currency. And all the values are getting from API AWESOMEAPI https://docs.awesomeapi.com.br
44

55
![screenshot](/image/screenshot.png)

extension.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ async function handle_request_dollar_api() {
8080

8181
// Create body of Soup request
8282
let message = Soup.Message.new_from_encoded_form(
83-
"GET", "https://economia.awesomeapi.com.br/last/USD-BRL", Soup.form_encode_hash({}));
83+
"GET", "https://economia.awesomeapi.com.br/last/USD-ZAR", Soup.form_encode_hash({}));
8484

8585
// Send Soup request to API Server
8686
await session.send_and_read_async(message, GLib.PRIORITY_DEFAULT, null, (_, r0) => {
@@ -89,8 +89,8 @@ async function handle_request_dollar_api() {
8989
const body_response = JSON.parse(response);
9090

9191
// Get the value of Dollar Quotation
92-
upDown = body_response["USDBRL"]["varBid"];
93-
dollarQuotation = body_response["USDBRL"]["bid"];
92+
upDown = body_response["USDZAR"]["varBid"];
93+
dollarQuotation = body_response["USDZAR"]["bid"];
9494
dollarQuotation = dollarQuotation.split(".");
9595
dollarQuotation = dollarQuotation[0] + "." + dollarQuotation[1].substring(0, 2);
9696

@@ -99,7 +99,7 @@ async function handle_request_dollar_api() {
9999

100100
// Sent text in Widget
101101
panelButtonText = new St.Label({
102-
text: " BRL: $" + dollarQuotation + " " + upDownIcon,
102+
text: " ZAR: $" + dollarQuotation + " " + upDownIcon,
103103
y_align: Clutter.ActorAlign.CENTER,
104104
});
105105
panelButton.set_child(panelButtonText);
@@ -112,7 +112,7 @@ async function handle_request_dollar_api() {
112112
} catch (error) {
113113
log(`Traceback Error in [handle_request_dollar_api]: ${error}`);
114114
panelButtonText = new St.Label({
115-
text: "BRL: $" + _dollarQuotation + " * ",
115+
text: "ZAR: $" + _dollarQuotation + " * ",
116116
y_align: Clutter.ActorAlign.CENTER,
117117
});
118118
panelButton.set_child(panelButtonText);

metadata.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"uuid": "[email protected]",
3-
"name": "USD-BRA",
4-
"description": "An easy and clean viewer of USD -> BRL currency. In which it is easy to understand if the currency is increasing or decreasing.",
2+
"uuid": "[email protected]",
3+
"name": "USD-ZAR",
4+
"description": "An easy and clean viewer of USD -> ZAR currency. In which it is easy to understand if the currency is increasing or decreasing.",
55
"version": 3.5,
66
"shell-version": ["42"],
77
"url": "https://github.com/Bramba7/USD-BRA"

0 commit comments

Comments
 (0)