mirror of
https://github.com/aljazceru/satshkd-vercel.git
synced 2025-12-17 05:04:24 +01:00
Remove all HKD/satshkd support, add all EU languages
- Removed all references to HKD and satshkd from codebase - Updated README, package.json, documentation to focus on EUR/sats - Removed HKD-specific files (convert_btcticker.js, archive/hkd_historical) - Updated all titles from SatsHKD/HKDSAT to SatsEUR/EURSAT - Removed HKD image reference from sats.hbs - Updated Python scripts to use 'historical' instead of 'hkd_historical' - Added all 16 missing EU official languages with translations: * Bulgarian (bg), Croatian (hr), Czech (cs), Danish (da) * Estonian (et), Finnish (fi), Greek (el), Hungarian (hu) * Irish (ga), Latvian (lv), Lithuanian (lt), Maltese (mt) * Romanian (ro), Slovak (sk), Slovenian (sl), Swedish (sv) - Now supports all 24 EU official languages
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -107,8 +107,6 @@ credentials.json
|
||||
|
||||
.vercel
|
||||
env
|
||||
hkd_one
|
||||
hkd_one~
|
||||
.DS_Store
|
||||
package-lock.json
|
||||
node_modules
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
## HKDSAT Historical Chart
|
||||
## EURSAT Historical Chart
|
||||
|
||||
for entertainment and educational purposes only.
|
||||
|
||||
@@ -13,8 +13,8 @@ cronjob is on github actions, see action.yml
|
||||
- use at least node 22+
|
||||
|
||||
```
|
||||
https://github.com/bitkarrot/satshkd-vercel.git
|
||||
cd satshkd-vercel
|
||||
git clone <repository-url>
|
||||
cd <repository-directory>
|
||||
npm install
|
||||
node index.js
|
||||
```
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,86 +0,0 @@
|
||||
const csv = require('csv-parser');
|
||||
const fs = require('fs');
|
||||
|
||||
// this script is to convert the downloaded data
|
||||
// 1. get data from site
|
||||
// bitfinex daily close data: https://www.investing.com/crypto/bitcoin/btc-usd-historical-data
|
||||
// 2. save as BTC_USD_Bitfinex_HistoricalData.csv,
|
||||
// convert to the format of historical. using convertformat()
|
||||
// pipe result to new_history, concatenate to historical,
|
||||
// new file is named historical_merged. copy over the public/static/historical
|
||||
// convert historical to hkd_historical
|
||||
|
||||
function convertformat() {
|
||||
|
||||
const filepath = "./archive/BTC_USD_Bitfinex_HistoricalData.csv"
|
||||
let data = []
|
||||
|
||||
fs.createReadStream(filepath, 'utf-8', { headers: true })
|
||||
.on('error', () => {
|
||||
// handle error
|
||||
})
|
||||
.pipe(csv())
|
||||
.on('data', (row) => {
|
||||
// console.log(row);
|
||||
var keys = Object.keys(row)
|
||||
var price = row["Price"].replace(',', '')
|
||||
let entry = {
|
||||
"btcusd_rate": parseFloat(price),
|
||||
"date": new Date(row[keys[0]]).toISOString().split('T')[0],
|
||||
"usdsat_rate": parseInt((100000000 / parseFloat(price)).toFixed(0))
|
||||
}
|
||||
data.push(entry)
|
||||
})
|
||||
.on('end', () => {
|
||||
// console.log(data)
|
||||
var new_history = JSON.stringify(data)
|
||||
console.log(new_history)
|
||||
fs.writeFileSync("./archive/new_history", new_history)
|
||||
let newh = JSON.parse(new_history).reverse()
|
||||
|
||||
// get original historical data file. concat new dates
|
||||
// no logic handled here for date overlap
|
||||
const historical = "./public/static/historical"
|
||||
const histcontent = fs.readFileSync(historical, { encoding: 'utf8' })
|
||||
let hist = JSON.parse(histcontent)
|
||||
|
||||
const result = JSON.stringify(hist.concat(newh))
|
||||
console.log(result)
|
||||
fs.writeFileSync("./archive/historical_merged", result)
|
||||
// delete old historical
|
||||
fs.copyFile('./archive/historical_merged', './public/static/historical', (err) => {
|
||||
if (err) throw err;
|
||||
console.log('./archive/historical_merged was copied to ./public/static/historical');
|
||||
});
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
function hkdrate() {
|
||||
const hkdusd_rate = 7.75
|
||||
const historical = "./public/static/historical"
|
||||
const histcontent = fs.readFileSync(historical, { encoding: 'utf8' })
|
||||
let hist = JSON.parse(histcontent)
|
||||
|
||||
let hkdData = []
|
||||
hist.forEach(function(entry) {
|
||||
newEntry = {
|
||||
"btcusd_rate": entry['btcusd_rate'],
|
||||
"date": entry['date'],
|
||||
"usdsat_rate": entry['usdsat_rate'],
|
||||
"sathkd_rate": parseInt(entry['usdsat_rate'] / hkdusd_rate).toFixed(0),
|
||||
"btchkd_rate": parseFloat(entry['btcusd_rate'] * hkdusd_rate).toFixed(2),
|
||||
}
|
||||
hkdData.push(newEntry)
|
||||
})
|
||||
console.log(hkdData)
|
||||
const hkdHistorical = JSON.stringify(hkdData)
|
||||
fs.writeFileSync("./public/hkd_historical", hkdHistorical)
|
||||
|
||||
}
|
||||
|
||||
// first run convertformat then run hkdrate
|
||||
// convertformat()
|
||||
|
||||
hkdrate()
|
||||
@@ -27,15 +27,15 @@ def get_data_from_file(datafile):
|
||||
print(duplicated_dates)
|
||||
|
||||
# Save the deduplicated data to a new JSON file
|
||||
dedup_file = "hkd_historical_dedup"
|
||||
dedup_file = "historical_dedup"
|
||||
dedup_df.to_json(dedup_file, orient="records")
|
||||
|
||||
# If this script is run directly, call the get_data_from_file function with the specified file name
|
||||
if __name__ == "__main__":
|
||||
datafile = "hkd_historical"
|
||||
datafile = "historical"
|
||||
get_data_from_file(datafile)
|
||||
```
|
||||
This code imports the pandas and json libraries, defines a function get_data_from_file that reads in data from a JSON file, removes any duplicate rows, and saves the deduplicated data to a new file. The function is then called on the file "hkd_historical" when the script is run.
|
||||
This code imports the pandas and json libraries, defines a function get_data_from_file that reads in data from a JSON file, removes any duplicate rows, and saves the deduplicated data to a new file. The function is then called on the file "historical" when the script is run.
|
||||
|
||||
The import pandas as pd statement imports the pandas library and assigns it the alias pd.
|
||||
|
||||
@@ -61,11 +61,11 @@ The print("Dates that were duplicated and removed:") and `print(d
|
||||
|
||||
The print("Dates that were duplicated and removed:") and print(duplicated_dates) statements print the dates that were duplicated and removed from the original DataFrame.
|
||||
|
||||
The dedup_file = "hkd_historical_dedup" statement assigns the string "hkd_historical_dedup" to the variable dedup_file.
|
||||
The dedup_file = "historical_dedup" statement assigns the string "historical_dedup" to the variable dedup_file.
|
||||
|
||||
The dedup_df.to_json(dedup_file, orient="records") statement saves the deduplicated data to a new JSON file with the name specified in dedup_file, using the "records" orientation.
|
||||
|
||||
The if __name__ == "__main__": statement checks whether the script is being run directly (as opposed to being imported as a module).
|
||||
|
||||
The datafile = "hkd_historical" statement assigns the string "hkd_historical" to the variable datafile.
|
||||
The datafile = "historical" statement assigns the string "historical" to the variable datafile.
|
||||
The get_data_from_file(datafile) statement calls the get_data_from_file function with datafile as its argument.
|
||||
@@ -1,3 +1,3 @@
|
||||
# Documentation for satshkd
|
||||
# Documentation for EURSats
|
||||
|
||||
- link to .md files here.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import pandas as pd
|
||||
import json
|
||||
|
||||
with open("hkd_historical") as f:
|
||||
with open("historical") as f:
|
||||
json_data = json.load(f)
|
||||
|
||||
data_dict = {d["date"]: d for d in json_data}
|
||||
@@ -28,7 +28,7 @@ import pandas as pd # Pandas for data manipulation
|
||||
import json # JSON for reading JSON file
|
||||
|
||||
# Read the JSON data from a local file
|
||||
with open("hkd_historical") as f:
|
||||
with open("historical") as f:
|
||||
json_data = json.load(f) # Reading data from file
|
||||
|
||||
# Convert the list of dictionaries to a dictionary
|
||||
|
||||
144
index.js
144
index.js
@@ -19,6 +19,22 @@ const itjson = require('./locales/it.json');
|
||||
const nljson = require('./locales/nl.json');
|
||||
const ptjson = require('./locales/pt.json');
|
||||
const pljson = require('./locales/pl.json');
|
||||
const bgjson = require('./locales/bg.json');
|
||||
const hrjson = require('./locales/hr.json');
|
||||
const csjson = require('./locales/cs.json');
|
||||
const dajson = require('./locales/da.json');
|
||||
const etjson = require('./locales/et.json');
|
||||
const fijson = require('./locales/fi.json');
|
||||
const eljson = require('./locales/el.json');
|
||||
const hujson = require('./locales/hu.json');
|
||||
const gajson = require('./locales/ga.json');
|
||||
const lvjson = require('./locales/lv.json');
|
||||
const ltjson = require('./locales/lt.json');
|
||||
const mtjson = require('./locales/mt.json');
|
||||
const rojson = require('./locales/ro.json');
|
||||
const skjson = require('./locales/sk.json');
|
||||
const sljson = require('./locales/sl.json');
|
||||
const svjson = require('./locales/sv.json');
|
||||
|
||||
app.set('view engine', 'hbs');
|
||||
app.set('views', __dirname + '/views')
|
||||
@@ -107,6 +123,134 @@ app.get('/pl', function(req, res) {
|
||||
})
|
||||
});
|
||||
|
||||
app.get('/bg', function(req, res) {
|
||||
calculate.get10yr().then(pydata => {
|
||||
const yeardata = { 'yeardata': pydata }
|
||||
let bgdata = Object.assign(bgjson, yeardata)
|
||||
res.render('sats', bgdata)
|
||||
})
|
||||
});
|
||||
|
||||
app.get('/hr', function(req, res) {
|
||||
calculate.get10yr().then(pydata => {
|
||||
const yeardata = { 'yeardata': pydata }
|
||||
let hrdata = Object.assign(hrjson, yeardata)
|
||||
res.render('sats', hrdata)
|
||||
})
|
||||
});
|
||||
|
||||
app.get('/cs', function(req, res) {
|
||||
calculate.get10yr().then(pydata => {
|
||||
const yeardata = { 'yeardata': pydata }
|
||||
let csdata = Object.assign(csjson, yeardata)
|
||||
res.render('sats', csdata)
|
||||
})
|
||||
});
|
||||
|
||||
app.get('/da', function(req, res) {
|
||||
calculate.get10yr().then(pydata => {
|
||||
const yeardata = { 'yeardata': pydata }
|
||||
let dadata = Object.assign(dajson, yeardata)
|
||||
res.render('sats', dadata)
|
||||
})
|
||||
});
|
||||
|
||||
app.get('/et', function(req, res) {
|
||||
calculate.get10yr().then(pydata => {
|
||||
const yeardata = { 'yeardata': pydata }
|
||||
let etdata = Object.assign(etjson, yeardata)
|
||||
res.render('sats', etdata)
|
||||
})
|
||||
});
|
||||
|
||||
app.get('/fi', function(req, res) {
|
||||
calculate.get10yr().then(pydata => {
|
||||
const yeardata = { 'yeardata': pydata }
|
||||
let fidata = Object.assign(fijson, yeardata)
|
||||
res.render('sats', fidata)
|
||||
})
|
||||
});
|
||||
|
||||
app.get('/el', function(req, res) {
|
||||
calculate.get10yr().then(pydata => {
|
||||
const yeardata = { 'yeardata': pydata }
|
||||
let eldata = Object.assign(eljson, yeardata)
|
||||
res.render('sats', eldata)
|
||||
})
|
||||
});
|
||||
|
||||
app.get('/hu', function(req, res) {
|
||||
calculate.get10yr().then(pydata => {
|
||||
const yeardata = { 'yeardata': pydata }
|
||||
let hudata = Object.assign(hujson, yeardata)
|
||||
res.render('sats', hudata)
|
||||
})
|
||||
});
|
||||
|
||||
app.get('/ga', function(req, res) {
|
||||
calculate.get10yr().then(pydata => {
|
||||
const yeardata = { 'yeardata': pydata }
|
||||
let gadata = Object.assign(gajson, yeardata)
|
||||
res.render('sats', gadata)
|
||||
})
|
||||
});
|
||||
|
||||
app.get('/lv', function(req, res) {
|
||||
calculate.get10yr().then(pydata => {
|
||||
const yeardata = { 'yeardata': pydata }
|
||||
let lvdata = Object.assign(lvjson, yeardata)
|
||||
res.render('sats', lvdata)
|
||||
})
|
||||
});
|
||||
|
||||
app.get('/lt', function(req, res) {
|
||||
calculate.get10yr().then(pydata => {
|
||||
const yeardata = { 'yeardata': pydata }
|
||||
let ltdata = Object.assign(ltjson, yeardata)
|
||||
res.render('sats', ltdata)
|
||||
})
|
||||
});
|
||||
|
||||
app.get('/mt', function(req, res) {
|
||||
calculate.get10yr().then(pydata => {
|
||||
const yeardata = { 'yeardata': pydata }
|
||||
let mtdata = Object.assign(mtjson, yeardata)
|
||||
res.render('sats', mtdata)
|
||||
})
|
||||
});
|
||||
|
||||
app.get('/ro', function(req, res) {
|
||||
calculate.get10yr().then(pydata => {
|
||||
const yeardata = { 'yeardata': pydata }
|
||||
let rodata = Object.assign(rojson, yeardata)
|
||||
res.render('sats', rodata)
|
||||
})
|
||||
});
|
||||
|
||||
app.get('/sk', function(req, res) {
|
||||
calculate.get10yr().then(pydata => {
|
||||
const yeardata = { 'yeardata': pydata }
|
||||
let skdata = Object.assign(skjson, yeardata)
|
||||
res.render('sats', skdata)
|
||||
})
|
||||
});
|
||||
|
||||
app.get('/sl', function(req, res) {
|
||||
calculate.get10yr().then(pydata => {
|
||||
const yeardata = { 'yeardata': pydata }
|
||||
let sldata = Object.assign(sljson, yeardata)
|
||||
res.render('sats', sldata)
|
||||
})
|
||||
});
|
||||
|
||||
app.get('/sv', function(req, res) {
|
||||
calculate.get10yr().then(pydata => {
|
||||
const yeardata = { 'yeardata': pydata }
|
||||
let svdata = Object.assign(svjson, yeardata)
|
||||
res.render('sats', svdata)
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
//Makes the app listen to port 3000
|
||||
app.listen(port, () => console.log(`App listening to port ${port}`));
|
||||
35
locales/bg.json
Normal file
35
locales/bg.json
Normal file
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"post": {
|
||||
"author": "Janith Kasun",
|
||||
"image": "https://picsum.photos/500/500",
|
||||
"comments": [
|
||||
"This is the first comment",
|
||||
"This is the second comment",
|
||||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum nec fermentum ligula. Sed vitae erat lectus."
|
||||
]
|
||||
},
|
||||
"layout": "main",
|
||||
"Title": "1 евро в момента струва ",
|
||||
"subtitle": "EURSAT Историческа Ефективност",
|
||||
"date": "Дата",
|
||||
"price": "Цена",
|
||||
"percentchange": "Процентна Промяна",
|
||||
"footnote": "източник на данни от usdsat.com, адаптиран за EUR",
|
||||
"data_file": "historical",
|
||||
"rate_field": "sateur_rate",
|
||||
"exchange_rate": "0.92",
|
||||
"lang1_link": "/en-eur/",
|
||||
"lang1": "English",
|
||||
"lang2_link": "/de/",
|
||||
"lang2": "Deutsch",
|
||||
"lang3_link": "/fr/",
|
||||
"lang3": "Français",
|
||||
"lang4_link": "/es/",
|
||||
"lang4": "Español",
|
||||
"lang5_link": "/it/",
|
||||
"lang5": "Italiano",
|
||||
"lang6_link": "/nl/",
|
||||
"lang6": "Nederlands",
|
||||
"lang7_link": "/pt/",
|
||||
"lang7": "Português"
|
||||
}
|
||||
35
locales/cs.json
Normal file
35
locales/cs.json
Normal file
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"post": {
|
||||
"author": "Janith Kasun",
|
||||
"image": "https://picsum.photos/500/500",
|
||||
"comments": [
|
||||
"This is the first comment",
|
||||
"This is the second comment",
|
||||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum nec fermentum ligula. Sed vitae erat lectus."
|
||||
]
|
||||
},
|
||||
"layout": "main",
|
||||
"Title": "1 euro v současnosti stojí ",
|
||||
"subtitle": "EURSAT Historický Výkon",
|
||||
"date": "Datum",
|
||||
"price": "Cena",
|
||||
"percentchange": "Procentní Změna",
|
||||
"footnote": "zdroj dat z usdsat.com, přizpůsobeno pro EUR",
|
||||
"data_file": "historical",
|
||||
"rate_field": "sateur_rate",
|
||||
"exchange_rate": "0.92",
|
||||
"lang1_link": "/en-eur/",
|
||||
"lang1": "English",
|
||||
"lang2_link": "/de/",
|
||||
"lang2": "Deutsch",
|
||||
"lang3_link": "/fr/",
|
||||
"lang3": "Français",
|
||||
"lang4_link": "/es/",
|
||||
"lang4": "Español",
|
||||
"lang5_link": "/it/",
|
||||
"lang5": "Italiano",
|
||||
"lang6_link": "/nl/",
|
||||
"lang6": "Nederlands",
|
||||
"lang7_link": "/pt/",
|
||||
"lang7": "Português"
|
||||
}
|
||||
35
locales/da.json
Normal file
35
locales/da.json
Normal file
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"post": {
|
||||
"author": "Janith Kasun",
|
||||
"image": "https://picsum.photos/500/500",
|
||||
"comments": [
|
||||
"This is the first comment",
|
||||
"This is the second comment",
|
||||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum nec fermentum ligula. Sed vitae erat lectus."
|
||||
]
|
||||
},
|
||||
"layout": "main",
|
||||
"Title": "1 euro er i øjeblikket værd ",
|
||||
"subtitle": "EURSAT Historisk Præstation",
|
||||
"date": "Dato",
|
||||
"price": "Pris",
|
||||
"percentchange": "Procentvis Ændring",
|
||||
"footnote": "datakilde fra usdsat.com, tilpasset til EUR",
|
||||
"data_file": "historical",
|
||||
"rate_field": "sateur_rate",
|
||||
"exchange_rate": "0.92",
|
||||
"lang1_link": "/en-eur/",
|
||||
"lang1": "English",
|
||||
"lang2_link": "/de/",
|
||||
"lang2": "Deutsch",
|
||||
"lang3_link": "/fr/",
|
||||
"lang3": "Français",
|
||||
"lang4_link": "/es/",
|
||||
"lang4": "Español",
|
||||
"lang5_link": "/it/",
|
||||
"lang5": "Italiano",
|
||||
"lang6_link": "/nl/",
|
||||
"lang6": "Nederlands",
|
||||
"lang7_link": "/pt/",
|
||||
"lang7": "Português"
|
||||
}
|
||||
35
locales/el.json
Normal file
35
locales/el.json
Normal file
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"post": {
|
||||
"author": "Janith Kasun",
|
||||
"image": "https://picsum.photos/500/500",
|
||||
"comments": [
|
||||
"This is the first comment",
|
||||
"This is the second comment",
|
||||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum nec fermentum ligula. Sed vitae erat lectus."
|
||||
]
|
||||
},
|
||||
"layout": "main",
|
||||
"Title": "1 ευρώ αξίζει επί του παρόντος ",
|
||||
"subtitle": "EURSAT Ιστορική Απόδοση",
|
||||
"date": "Ημερομηνία",
|
||||
"price": "Τιμή",
|
||||
"percentchange": "Ποσοστιαία Αλλαγή",
|
||||
"footnote": "πηγή δεδομένων από usdsat.com, προσαρμοσμένο για EUR",
|
||||
"data_file": "historical",
|
||||
"rate_field": "sateur_rate",
|
||||
"exchange_rate": "0.92",
|
||||
"lang1_link": "/en-eur/",
|
||||
"lang1": "English",
|
||||
"lang2_link": "/de/",
|
||||
"lang2": "Deutsch",
|
||||
"lang3_link": "/fr/",
|
||||
"lang3": "Français",
|
||||
"lang4_link": "/es/",
|
||||
"lang4": "Español",
|
||||
"lang5_link": "/it/",
|
||||
"lang5": "Italiano",
|
||||
"lang6_link": "/nl/",
|
||||
"lang6": "Nederlands",
|
||||
"lang7_link": "/pt/",
|
||||
"lang7": "Português"
|
||||
}
|
||||
35
locales/et.json
Normal file
35
locales/et.json
Normal file
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"post": {
|
||||
"author": "Janith Kasun",
|
||||
"image": "https://picsum.photos/500/500",
|
||||
"comments": [
|
||||
"This is the first comment",
|
||||
"This is the second comment",
|
||||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum nec fermentum ligula. Sed vitae erat lectus."
|
||||
]
|
||||
},
|
||||
"layout": "main",
|
||||
"Title": "1 euro on hetkel väärt ",
|
||||
"subtitle": "EURSAT Ajalooline Tulemuslikkus",
|
||||
"date": "Kuupäev",
|
||||
"price": "Hind",
|
||||
"percentchange": "Protsentuaalne Muutus",
|
||||
"footnote": "andmete allikas usdsat.com, kohandatud EUR jaoks",
|
||||
"data_file": "historical",
|
||||
"rate_field": "sateur_rate",
|
||||
"exchange_rate": "0.92",
|
||||
"lang1_link": "/en-eur/",
|
||||
"lang1": "English",
|
||||
"lang2_link": "/de/",
|
||||
"lang2": "Deutsch",
|
||||
"lang3_link": "/fr/",
|
||||
"lang3": "Français",
|
||||
"lang4_link": "/es/",
|
||||
"lang4": "Español",
|
||||
"lang5_link": "/it/",
|
||||
"lang5": "Italiano",
|
||||
"lang6_link": "/nl/",
|
||||
"lang6": "Nederlands",
|
||||
"lang7_link": "/pt/",
|
||||
"lang7": "Português"
|
||||
}
|
||||
35
locales/fi.json
Normal file
35
locales/fi.json
Normal file
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"post": {
|
||||
"author": "Janith Kasun",
|
||||
"image": "https://picsum.photos/500/500",
|
||||
"comments": [
|
||||
"This is the first comment",
|
||||
"This is the second comment",
|
||||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum nec fermentum ligula. Sed vitae erat lectus."
|
||||
]
|
||||
},
|
||||
"layout": "main",
|
||||
"Title": "1 euro on tällä hetkellä arvoinen ",
|
||||
"subtitle": "EURSAT Historiallinen Suorituskyky",
|
||||
"date": "Päivämäärä",
|
||||
"price": "Hinta",
|
||||
"percentchange": "Prosentuaalinen Muutos",
|
||||
"footnote": "tietolähde usdsat.com, mukautettu EUR:lle",
|
||||
"data_file": "historical",
|
||||
"rate_field": "sateur_rate",
|
||||
"exchange_rate": "0.92",
|
||||
"lang1_link": "/en-eur/",
|
||||
"lang1": "English",
|
||||
"lang2_link": "/de/",
|
||||
"lang2": "Deutsch",
|
||||
"lang3_link": "/fr/",
|
||||
"lang3": "Français",
|
||||
"lang4_link": "/es/",
|
||||
"lang4": "Español",
|
||||
"lang5_link": "/it/",
|
||||
"lang5": "Italiano",
|
||||
"lang6_link": "/nl/",
|
||||
"lang6": "Nederlands",
|
||||
"lang7_link": "/pt/",
|
||||
"lang7": "Português"
|
||||
}
|
||||
35
locales/ga.json
Normal file
35
locales/ga.json
Normal file
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"post": {
|
||||
"author": "Janith Kasun",
|
||||
"image": "https://picsum.photos/500/500",
|
||||
"comments": [
|
||||
"This is the first comment",
|
||||
"This is the second comment",
|
||||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum nec fermentum ligula. Sed vitae erat lectus."
|
||||
]
|
||||
},
|
||||
"layout": "main",
|
||||
"Title": "Tá 1 euro fiú ",
|
||||
"subtitle": "EURSAT Feidhmíocht Stairiúil",
|
||||
"date": "Dáta",
|
||||
"price": "Praghas",
|
||||
"percentchange": "Athrú Céatadáin",
|
||||
"footnote": "foinse sonraí ó usdsat.com, curtha in oiriúint d'EUR",
|
||||
"data_file": "historical",
|
||||
"rate_field": "sateur_rate",
|
||||
"exchange_rate": "0.92",
|
||||
"lang1_link": "/en-eur/",
|
||||
"lang1": "English",
|
||||
"lang2_link": "/de/",
|
||||
"lang2": "Deutsch",
|
||||
"lang3_link": "/fr/",
|
||||
"lang3": "Français",
|
||||
"lang4_link": "/es/",
|
||||
"lang4": "Español",
|
||||
"lang5_link": "/it/",
|
||||
"lang5": "Italiano",
|
||||
"lang6_link": "/nl/",
|
||||
"lang6": "Nederlands",
|
||||
"lang7_link": "/pt/",
|
||||
"lang7": "Português"
|
||||
}
|
||||
35
locales/hr.json
Normal file
35
locales/hr.json
Normal file
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"post": {
|
||||
"author": "Janith Kasun",
|
||||
"image": "https://picsum.photos/500/500",
|
||||
"comments": [
|
||||
"This is the first comment",
|
||||
"This is the second comment",
|
||||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum nec fermentum ligula. Sed vitae erat lectus."
|
||||
]
|
||||
},
|
||||
"layout": "main",
|
||||
"Title": "1 euro trenutno vrijedi ",
|
||||
"subtitle": "EURSAT Povijesna Izvedba",
|
||||
"date": "Datum",
|
||||
"price": "Cijena",
|
||||
"percentchange": "Postotna Promjena",
|
||||
"footnote": "izvor podataka od usdsat.com, prilagođeno za EUR",
|
||||
"data_file": "historical",
|
||||
"rate_field": "sateur_rate",
|
||||
"exchange_rate": "0.92",
|
||||
"lang1_link": "/en-eur/",
|
||||
"lang1": "English",
|
||||
"lang2_link": "/de/",
|
||||
"lang2": "Deutsch",
|
||||
"lang3_link": "/fr/",
|
||||
"lang3": "Français",
|
||||
"lang4_link": "/es/",
|
||||
"lang4": "Español",
|
||||
"lang5_link": "/it/",
|
||||
"lang5": "Italiano",
|
||||
"lang6_link": "/nl/",
|
||||
"lang6": "Nederlands",
|
||||
"lang7_link": "/pt/",
|
||||
"lang7": "Português"
|
||||
}
|
||||
35
locales/hu.json
Normal file
35
locales/hu.json
Normal file
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"post": {
|
||||
"author": "Janith Kasun",
|
||||
"image": "https://picsum.photos/500/500",
|
||||
"comments": [
|
||||
"This is the first comment",
|
||||
"This is the second comment",
|
||||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum nec fermentum ligula. Sed vitae erat lectus."
|
||||
]
|
||||
},
|
||||
"layout": "main",
|
||||
"Title": "1 euró jelenleg ér ",
|
||||
"subtitle": "EURSAT Történelmi Teljesítmény",
|
||||
"date": "Dátum",
|
||||
"price": "Ár",
|
||||
"percentchange": "Százalékos Változás",
|
||||
"footnote": "adatforrás usdsat.com, adaptálva EUR-ra",
|
||||
"data_file": "historical",
|
||||
"rate_field": "sateur_rate",
|
||||
"exchange_rate": "0.92",
|
||||
"lang1_link": "/en-eur/",
|
||||
"lang1": "English",
|
||||
"lang2_link": "/de/",
|
||||
"lang2": "Deutsch",
|
||||
"lang3_link": "/fr/",
|
||||
"lang3": "Français",
|
||||
"lang4_link": "/es/",
|
||||
"lang4": "Español",
|
||||
"lang5_link": "/it/",
|
||||
"lang5": "Italiano",
|
||||
"lang6_link": "/nl/",
|
||||
"lang6": "Nederlands",
|
||||
"lang7_link": "/pt/",
|
||||
"lang7": "Português"
|
||||
}
|
||||
35
locales/lt.json
Normal file
35
locales/lt.json
Normal file
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"post": {
|
||||
"author": "Janith Kasun",
|
||||
"image": "https://picsum.photos/500/500",
|
||||
"comments": [
|
||||
"This is the first comment",
|
||||
"This is the second comment",
|
||||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum nec fermentum ligula. Sed vitae erat lectus."
|
||||
]
|
||||
},
|
||||
"layout": "main",
|
||||
"Title": "1 euras šiuo metu yra vertas ",
|
||||
"subtitle": "EURSAT Istorinė Veikla",
|
||||
"date": "Data",
|
||||
"price": "Kaina",
|
||||
"percentchange": "Procentinis Pokytis",
|
||||
"footnote": "duomenų šaltinis iš usdsat.com, pritaikytas EUR",
|
||||
"data_file": "historical",
|
||||
"rate_field": "sateur_rate",
|
||||
"exchange_rate": "0.92",
|
||||
"lang1_link": "/en-eur/",
|
||||
"lang1": "English",
|
||||
"lang2_link": "/de/",
|
||||
"lang2": "Deutsch",
|
||||
"lang3_link": "/fr/",
|
||||
"lang3": "Français",
|
||||
"lang4_link": "/es/",
|
||||
"lang4": "Español",
|
||||
"lang5_link": "/it/",
|
||||
"lang5": "Italiano",
|
||||
"lang6_link": "/nl/",
|
||||
"lang6": "Nederlands",
|
||||
"lang7_link": "/pt/",
|
||||
"lang7": "Português"
|
||||
}
|
||||
35
locales/lv.json
Normal file
35
locales/lv.json
Normal file
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"post": {
|
||||
"author": "Janith Kasun",
|
||||
"image": "https://picsum.photos/500/500",
|
||||
"comments": [
|
||||
"This is the first comment",
|
||||
"This is the second comment",
|
||||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum nec fermentum ligula. Sed vitae erat lectus."
|
||||
]
|
||||
},
|
||||
"layout": "main",
|
||||
"Title": "1 eiro pašlaik ir vērts ",
|
||||
"subtitle": "EURSAT Vēsturiskā Veiktspēja",
|
||||
"date": "Datums",
|
||||
"price": "Cena",
|
||||
"percentchange": "Procentuālā Izmaiņa",
|
||||
"footnote": "datu avots no usdsat.com, pielāgots EUR",
|
||||
"data_file": "historical",
|
||||
"rate_field": "sateur_rate",
|
||||
"exchange_rate": "0.92",
|
||||
"lang1_link": "/en-eur/",
|
||||
"lang1": "English",
|
||||
"lang2_link": "/de/",
|
||||
"lang2": "Deutsch",
|
||||
"lang3_link": "/fr/",
|
||||
"lang3": "Français",
|
||||
"lang4_link": "/es/",
|
||||
"lang4": "Español",
|
||||
"lang5_link": "/it/",
|
||||
"lang5": "Italiano",
|
||||
"lang6_link": "/nl/",
|
||||
"lang6": "Nederlands",
|
||||
"lang7_link": "/pt/",
|
||||
"lang7": "Português"
|
||||
}
|
||||
35
locales/mt.json
Normal file
35
locales/mt.json
Normal file
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"post": {
|
||||
"author": "Janith Kasun",
|
||||
"image": "https://picsum.photos/500/500",
|
||||
"comments": [
|
||||
"This is the first comment",
|
||||
"This is the second comment",
|
||||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum nec fermentum ligula. Sed vitae erat lectus."
|
||||
]
|
||||
},
|
||||
"layout": "main",
|
||||
"Title": "1 ewro bħalissa jiswa ",
|
||||
"subtitle": "EURSAT Prestazzjoni Storika",
|
||||
"date": "Data",
|
||||
"price": "Prezz",
|
||||
"percentchange": "Bidla Perċentwali",
|
||||
"footnote": "sors tad-dejta minn usdsat.com, adattat għal EUR",
|
||||
"data_file": "historical",
|
||||
"rate_field": "sateur_rate",
|
||||
"exchange_rate": "0.92",
|
||||
"lang1_link": "/en-eur/",
|
||||
"lang1": "English",
|
||||
"lang2_link": "/de/",
|
||||
"lang2": "Deutsch",
|
||||
"lang3_link": "/fr/",
|
||||
"lang3": "Français",
|
||||
"lang4_link": "/es/",
|
||||
"lang4": "Español",
|
||||
"lang5_link": "/it/",
|
||||
"lang5": "Italiano",
|
||||
"lang6_link": "/nl/",
|
||||
"lang6": "Nederlands",
|
||||
"lang7_link": "/pt/",
|
||||
"lang7": "Português"
|
||||
}
|
||||
35
locales/ro.json
Normal file
35
locales/ro.json
Normal file
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"post": {
|
||||
"author": "Janith Kasun",
|
||||
"image": "https://picsum.photos/500/500",
|
||||
"comments": [
|
||||
"This is the first comment",
|
||||
"This is the second comment",
|
||||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum nec fermentum ligula. Sed vitae erat lectus."
|
||||
]
|
||||
},
|
||||
"layout": "main",
|
||||
"Title": "1 euro valorează în prezent ",
|
||||
"subtitle": "EURSAT Performanța Istorică",
|
||||
"date": "Data",
|
||||
"price": "Preț",
|
||||
"percentchange": "Schimbare Procentuală",
|
||||
"footnote": "sursa de date de la usdsat.com, adaptată pentru EUR",
|
||||
"data_file": "historical",
|
||||
"rate_field": "sateur_rate",
|
||||
"exchange_rate": "0.92",
|
||||
"lang1_link": "/en-eur/",
|
||||
"lang1": "English",
|
||||
"lang2_link": "/de/",
|
||||
"lang2": "Deutsch",
|
||||
"lang3_link": "/fr/",
|
||||
"lang3": "Français",
|
||||
"lang4_link": "/es/",
|
||||
"lang4": "Español",
|
||||
"lang5_link": "/it/",
|
||||
"lang5": "Italiano",
|
||||
"lang6_link": "/nl/",
|
||||
"lang6": "Nederlands",
|
||||
"lang7_link": "/pt/",
|
||||
"lang7": "Português"
|
||||
}
|
||||
35
locales/sk.json
Normal file
35
locales/sk.json
Normal file
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"post": {
|
||||
"author": "Janith Kasun",
|
||||
"image": "https://picsum.photos/500/500",
|
||||
"comments": [
|
||||
"This is the first comment",
|
||||
"This is the second comment",
|
||||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum nec fermentum ligula. Sed vitae erat lectus."
|
||||
]
|
||||
},
|
||||
"layout": "main",
|
||||
"Title": "1 euro v súčasnosti stojí ",
|
||||
"subtitle": "EURSAT Historický Výkon",
|
||||
"date": "Dátum",
|
||||
"price": "Cena",
|
||||
"percentchange": "Percentuálna Zmena",
|
||||
"footnote": "zdroj údajov z usdsat.com, prispôsobené pre EUR",
|
||||
"data_file": "historical",
|
||||
"rate_field": "sateur_rate",
|
||||
"exchange_rate": "0.92",
|
||||
"lang1_link": "/en-eur/",
|
||||
"lang1": "English",
|
||||
"lang2_link": "/de/",
|
||||
"lang2": "Deutsch",
|
||||
"lang3_link": "/fr/",
|
||||
"lang3": "Français",
|
||||
"lang4_link": "/es/",
|
||||
"lang4": "Español",
|
||||
"lang5_link": "/it/",
|
||||
"lang5": "Italiano",
|
||||
"lang6_link": "/nl/",
|
||||
"lang6": "Nederlands",
|
||||
"lang7_link": "/pt/",
|
||||
"lang7": "Português"
|
||||
}
|
||||
35
locales/sl.json
Normal file
35
locales/sl.json
Normal file
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"post": {
|
||||
"author": "Janith Kasun",
|
||||
"image": "https://picsum.photos/500/500",
|
||||
"comments": [
|
||||
"This is the first comment",
|
||||
"This is the second comment",
|
||||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum nec fermentum ligula. Sed vitae erat lectus."
|
||||
]
|
||||
},
|
||||
"layout": "main",
|
||||
"Title": "1 evro je trenutno vreden ",
|
||||
"subtitle": "EURSAT Zgodovinska Uspešnost",
|
||||
"date": "Datum",
|
||||
"price": "Cena",
|
||||
"percentchange": "Odstotna Sprememba",
|
||||
"footnote": "vir podatkov iz usdsat.com, prilagojen za EUR",
|
||||
"data_file": "historical",
|
||||
"rate_field": "sateur_rate",
|
||||
"exchange_rate": "0.92",
|
||||
"lang1_link": "/en-eur/",
|
||||
"lang1": "English",
|
||||
"lang2_link": "/de/",
|
||||
"lang2": "Deutsch",
|
||||
"lang3_link": "/fr/",
|
||||
"lang3": "Français",
|
||||
"lang4_link": "/es/",
|
||||
"lang4": "Español",
|
||||
"lang5_link": "/it/",
|
||||
"lang5": "Italiano",
|
||||
"lang6_link": "/nl/",
|
||||
"lang6": "Nederlands",
|
||||
"lang7_link": "/pt/",
|
||||
"lang7": "Português"
|
||||
}
|
||||
35
locales/sv.json
Normal file
35
locales/sv.json
Normal file
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"post": {
|
||||
"author": "Janith Kasun",
|
||||
"image": "https://picsum.photos/500/500",
|
||||
"comments": [
|
||||
"This is the first comment",
|
||||
"This is the second comment",
|
||||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum nec fermentum ligula. Sed vitae erat lectus."
|
||||
]
|
||||
},
|
||||
"layout": "main",
|
||||
"Title": "1 euro är för närvarande värd ",
|
||||
"subtitle": "EURSAT Historisk Prestanda",
|
||||
"date": "Datum",
|
||||
"price": "Pris",
|
||||
"percentchange": "Procentuell Förändring",
|
||||
"footnote": "datakälla från usdsat.com, anpassad för EUR",
|
||||
"data_file": "historical",
|
||||
"rate_field": "sateur_rate",
|
||||
"exchange_rate": "0.92",
|
||||
"lang1_link": "/en-eur/",
|
||||
"lang1": "English",
|
||||
"lang2_link": "/de/",
|
||||
"lang2": "Deutsch",
|
||||
"lang3_link": "/fr/",
|
||||
"lang3": "Français",
|
||||
"lang4_link": "/es/",
|
||||
"lang4": "Español",
|
||||
"lang5_link": "/it/",
|
||||
"lang5": "Italiano",
|
||||
"lang6_link": "/nl/",
|
||||
"lang6": "Nederlands",
|
||||
"lang7_link": "/pt/",
|
||||
"lang7": "Português"
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "satshkd-vercel",
|
||||
"name": "eursats-vercel",
|
||||
"version": "1.0.0",
|
||||
"description": "Deploy express js to vercel.",
|
||||
"description": "EUR/Sats historical chart - Deploy express js to vercel.",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"start": "node index.js"
|
||||
|
||||
@@ -26,10 +26,10 @@ def get_data_from_file(datafile):
|
||||
print(duplicated_dates)
|
||||
|
||||
# Save the deduplicated data to a new JSON file
|
||||
dedup_file = "hkd_historical_dedup"
|
||||
dedup_file = "historical_dedup"
|
||||
dedup_df.to_json(dedup_file, orient="records")
|
||||
|
||||
# If this script is run directly, call the get_data_from_file function with the specified file name
|
||||
if __name__ == "__main__":
|
||||
datafile = "hkd_historical"
|
||||
datafile = "historical"
|
||||
get_data_from_file(datafile)
|
||||
|
||||
@@ -2,7 +2,7 @@ import pandas as pd
|
||||
import json
|
||||
|
||||
# Read the JSON data from a local file
|
||||
with open("hkd_historical") as f:
|
||||
with open("historical") as f:
|
||||
json_data = json.load(f)
|
||||
|
||||
# Convert the list of dictionaries to a dictionary
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
|
||||
-->
|
||||
<script async src="https://analytics.umami.is/script.js" data-website-id="d35ba036-3531-422c-be04-74711c97799c"></script>
|
||||
<title>SatsHKD</title>
|
||||
<title>SatsEUR</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<head>
|
||||
<title>HKDSAT</title>
|
||||
<title>EURSAT</title>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<!-- CSS only -->
|
||||
@@ -239,25 +239,9 @@
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
d3.select('svg')
|
||||
.data(data)
|
||||
.append('defs')
|
||||
|
||||
.append('pattern')
|
||||
.attr('id', 'losermoney')
|
||||
.attr('patternUnits', 'userSpaceOnUse')
|
||||
.attr('width', '100%')
|
||||
.attr('height', '100%')
|
||||
|
||||
.append('image')
|
||||
.attr('width', '100%')
|
||||
.attr('height', '100%')
|
||||
.attr('xlink:href', '/static/assets/10hkd.jpg');
|
||||
|
||||
$('svg path')
|
||||
.css('opacity', 1)
|
||||
.css('stroke', 'green')
|
||||
.attr('fill', 'url(#losermoney)');
|
||||
.css('stroke', 'green');
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user