Commit 713511c3 authored by Stephane Mankowski's avatar Stephane Mankowski

Remove coinmarketcap because not morking anymore

parent a5cf7683
......@@ -9,6 +9,7 @@ skrooge (2.22.0)
*Correction: Bad display in dashboard when all accounts of a type are closed
*Correction: With last version of KDE, KMessageWidget are sometimes empty
*Correction: Add missing "Full screen" menu
*Correction: Remove coinmarketcap because not morking anymore
-- Stephane MANKOWSKI <stephane@mankowski.fr>
......
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#**************************************************************************
#* Copyright (C) 2017 by S. MANKOWSKI / G. DE BURE support@mankowski.fr
#* Redistribution and use in source and binary forms, with or without
#* modification, are permitted provided that the following conditions
#* are met:
#*
#* 1. Redistributions of source code must retain the above copyright
#* notice, this list of conditions and the following disclaimer.
#* 2. Redistributions in binary form must reproduce the above copyright
#* notice, this list of conditions and the following disclaimer in the
#* documentation and/or other materials provided with the distribution.
#*
#* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
#* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
#* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
#* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
#* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
#* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
#* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
#* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
#* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
#* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#**************************************************************************
import urllib.request
import json
import sys
import time
f = urllib.request.urlopen('https://api.coinmarketcap.com/v1/ticker/')
print("Date,Price")
for item in json.loads(f.read().decode('utf-8')):
if item["symbol"] == sys.argv[1]:
print(time.strftime('%Y-%m-%d', time.gmtime(int(item["last_updated"])))+','+item["price_usd"])
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#**************************************************************************
#* Copyright (C) 2017 by S. MANKOWSKI / G. DE BURE support@mankowski.fr
#* Redistribution and use in source and binary forms, with or without
#* modification, are permitted provided that the following conditions
#* are met:
#*
#* 1. Redistributions of source code must retain the above copyright
#* notice, this list of conditions and the following disclaimer.
#* 2. Redistributions in binary form must reproduce the above copyright
#* notice, this list of conditions and the following disclaimer in the
#* documentation and/or other materials provided with the distribution.
#*
#* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
#* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
#* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
#* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
#* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
#* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
#* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
#* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
#* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
#* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#**************************************************************************
import urllib.request
import json
import sys
import time
f = urllib.request.urlopen('https://api.coinmarketcap.com/v1/ticker/')
for item in json.loads(f.read().decode('utf-8')):
if item["symbol"] != "BTC":
print(' {')
print(' // '+item["id"].upper())
print(' SKGServices::SKGUnitInfo info;')
print(' info.Name = i18nc("Noun, a cryptocurrency", "'+item["name"]+'");')
print(' info.Symbol = QStringLiteral("'+item["symbol"]+'");')
print(' info.Date = QDate(2009, 2, 4);')
print(' info.Country = i18nc("Noun, the country of bitcoin", "Internet");')
print(' info.Internet = QStringLiteral("'+item["symbol"]+'");')
print(' info.Source = QStringLiteral("CoinMarketCap");')
print(' info.Parent = QStringLiteral("USD");')
print(' info.NbDecimal = 4;')
print(' info.Value = -1;')
print(' currencies.push_back(info);')
print(' }')
[Desktop Entry]
Name=CoinMarketCap
Name[ca]=CoinMarketCap
Name[ca@valencia]=CoinMarketCap
Name[en_GB]=CoinMarketCap
Name[es]=CoinMarketCap
Name[et]=CoinMarketCap
Name[fr]=CoinMarketCap
Name[gl]=CoinMarketCap
Name[it]=CoinMarketCap
Name[nl]=CoinMarketCap
Name[pl]=CoinMarketCap
Name[pt]=CoinMarketCap
Name[pt_BR]=CoinMarketCap
Name[sv]=CoinMarketCap
Name[uk]=CoinMarketCap
Name[x-test]=xxCoinMarketCapxx
Comment=You can get the list of available quotes from <a href="https://coinmarketcap.com">CoinMarketCap</a>.<br/>Then, enter the expected quote (the xxx in the url like this https://coinmarketcap.com/currencies/xxx/).
Comment[ca]=Podeu obtenir la llista de les cotitzacions disponibles a <a href="https://coinmarketcap.com">CoinMarketCap</a>.<br/>Després introduïu la cotització esperada (les «xxx» a l'URL com aquest https://coinmarketcap.com/currencies/xxx/).
Comment[ca@valencia]=Podeu obtindre la llista de les cotitzacions disponibles a <a href="https://coinmarketcap.com">CoinMarketCap</a>.<br/>Després introduïu la cotització esperada (les «xxx» a l'URL com aquest https://coinmarketcap.com/currencies/xxx/).
Comment[en_GB]=You can get the list of available quotes from <a href="https://coinmarketcap.com">CoinMarketCap</a>.<br/>Then, enter the expected quote (the xxx in the URL like this https://coinmarketcap.com/currencies/xxx/).
Comment[es]=Puede obtener la lista de las cotizaciones disponibles de <a href="https://coinmarketcap.com">CoinMarketCap</a>.<br/>A continuación, introduzca la cotización esperada (el xxx del url, como en https://coinmarketcap.com/currencies/xxx/).
Comment[et]=Saadaolevate kursside loendi võib hankida saidilt <a href="https://coinmarketcap.com">CoinMarketCap</a>,<br/>Seejärel sisesta oodatav kurss (xxx URL-is, näiteks https://coinmarketcap.com/currencies/xxx/).
Comment[fr]=Vous pouvez récupérer la liste des cotation disponibles depuis <a href="https://coinmarketcap.com">CoinMarketCap</a>.<br/> Ensuite, saisissez la cotation souhaitée (le xxx dans l'adresse comme celle-ci https://coinmarketcap.com/currencies/xxx/).
Comment[gl]=Pode obter a lista de cotizacións dispoñíbeis de <a href="https://coinmarketcap.com">CoinMarketCap</a>.<br/>A continuación escriba a cotización esperada (o xxx dos URL coa forma https://coinmarketcap.com/currencies/xxx/).
Comment[it]=Puoi ottenere un elenco delle quotazioni disponibili da <a href="https://coinmarketcap.com/it">CoinMarketCap</a>.<br/>Digita, quindi la quotazione attesa (la xxx nell'URL, tipo https://coinmarketcap.com/currencies/xxx/).
Comment[nl]=U kunt de lijst met namen van beschikbare koersen ophalen uit <a href="https://coinmarketcap.com">CoinMarketCap</a>.<br/>Voer dan de naam van de gevraagde koers in (de xxx in de url zoals deze https://coinmarketcap.com/currencies/xxx/).
Comment[pl]=Wykaz dostępnych wycen można pobrać z <a href="https://coinmarketcap.com">CoinMarketCap</a>.<br/>Następnie podaj żądaną wycenę(trzy iksy xxx w adresie url tak jak w https://coinmarketcap.com/currencies/xxx/).
Comment[pt]=Poderá obter a lista de cotações disponíveis a partir de <a href="https://coinmarketcap.com">CoinMarketCap</a>.<br/>Depois, indique a cotação esperada (o 'xxx' num URL como o seguinte: https://coinmarketcap.com/currencies/xxx/).
Comment[sv]=Listan över tillgängliga kursnoteringar kan hämtas från <a href="https://coinmarketcap.com">CoinMarkedCap</a>.<br/>Skriv därefter in förväntad kurs (xxx i webbadressen https://coinmarketcap.com/currencies/xxx/).
Comment[uk]=Список доступних курсів можна отримати з <a href="https://coinmarketcap.com">CoinMarketCap</a>.<br/>Далі, введіть потрібний курс (xxx у адресі, наприклад https://coinmarketcap.com/currencies/xxx/).
Comment[x-test]=xxYou can get the list of available quotes from <a href="https://coinmarketcap.com">CoinMarketCap</a>.<br/>Then, enter the expected quote (the xxx in the url like this https://coinmarketcap.com/currencies/xxx/).xx
Encoding=UTF-8
Icon=skrooge
Type=Service
X-KDE-ServiceTypes=skrooge/source
X-Krunner-ID=coinmarketcap
X-KDE-PluginInfo-Author=Stephane MANKOWSKI,miraks
X-KDE-PluginInfo-Email=stephane@mankowski.fr
X-KDE-PluginInfo-Name=CoinMarketCap
X-KDE-PluginInfo-Version=1.0
X-KDE-PluginInfo-Website=https://skrooge.org/
X-KDE-PluginInfo-Category=Plugins
X-KDE-PluginInfo-Depends=
X-KDE-PluginInfo-License=GPL
X-KDE-PluginInfo-EnabledByDefault=true
#The url or the command line to get the list of accounts in the standard output, something like this:
#%1 will be replaced by the internet code of the unit
#%2 will be replaced by the current day in format yyyy-MM-dd
#%3 will be replaced by the previous date in format yyyy-MM-dd
#Example:
# X-SKROOGE-url=https://server/?s=%1
# or
# X-SKROOGE-script=mydownloadscript %1
#This parameter is MANDATORY
X-SKROOGE-script=skrooge-coinmarketcap.py %1
#The mode (HTML or CSV or CSVR). In HTML mode, only one value will be extracted from downloaded page. In CSV mode, a value per line will be extracted. CSVR means CSV in reverse mode
X-SKROOGE-mode=CSV
#Regular expression to capture the price of the quote
#This parameter is not MANDATORY.
X-SKROOGE-price=[^,]*,([^,]*)
#Regular expression to capture the date of the quote
#This parameter is not MANDATORY.
X-SKROOGE-date=([^,]*),.*
#The date format
X-SKROOGE-dateformat=yyyy-MM-dd
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment