[Feature Request] Crypto Prices #4
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: m.giller/E-Paper-Calendar#4
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Anyway to implement crypto prices instead of RSS feed?
Been trying to reverse-engineering it, but it hasn't been easy. Any guidance?
Currently, only the title of a RSS post is printed in a line, preceded by a dot. If you know any source that provides the desired information in such a format, where everything important is mentioned in the title, you could simply add those to the rss_feeds. That is probably not the case.
To help you, I need to know how and what information should be presented (Name of the currency, current value, maybe the latest change?) and what the source looks like. Are there some RSS-Feed similiar links? Should an additional python package be used?
I don't know much about the stock market, currrencies and all of that, but I imagine that stock and currency are related enough, so that they can be merged together into one feature somehow?
I'm not a python dev, but I have some webdev skills. I understand the theory, its just the whole adapting to someone elses code is a little hard for me but I'm sure we can work together here!
https://api.coingecko.com/api/v3/simple/price?ids=bitcoin&vs_currencies=USD
Heres an example of an API pull from coingecko. Perhaps we could find a source that has both stocks and crypto but coingecko provides a free API (w/o token) if you can help me develop into something..
https://api.coingecko.com/api/v3/simple/price?ids=bitcoin,litecoin&vs_currencies=USD
would be both btc and ltc
That looks great! Thanks for your research! I will work on this asap, which basically means tomorrow :D
To give some more insight into my code:
Every information (except datetime) comes from a specific class. Weather comes from OwmForecast, RSS Feeds from RssParserPosts and Events from IcalEvents. But everyone of those "data classes" inherits from an abstract data class (OwmForecast => WeatherInterface, IcalEvents => CalendarInterface, ...) and they all inherit from the abstract DataSourceInterface class (CalendarInterface => DataSourceInterface).
For the currencies that would make something like GeckoCurrency => CurrencyInterface => DataSourceInterface to provide all the functionality needed.
But you don't need to implement it that technically. You could, if you want, create one general class/collection of functions/function that collects all necessary data and transforms it into an according data object.
Every type of information is packed into its own data object class, to use data in a coherent manner. Weather is transported in a WeatherForecast object, RSS-Posts are transported in a RssPost object and events are transported in a CalendarEvent object.
Later on, every panel (a whole, finished design) needs to have somekind of function to take those information/data objects. The PanelDesign class is the basis of every design and defines the interface. A function like "add_currency" would be needed.
As you can see, I probably overcomplexified it a little bit, but on the other hand it is easier to add new things without disrupting the rest of the code. I am planning to refactor that system a little bit to make it cleaner and reduce duplicated code.
I will have a closer look tomorrow and feel free to explore the code and implement new features.
Defintely got somewhere. Just need to get the prices to display one row, instead of like this:
$8
$8
$.
$4
$7
To display information in rows or just one row, you should use the TableDesign. Simply create a matrix in the format:
In the constructor of TableDesign you can set a variety of design options like the alignment of the content, font size and color for each cell. These information are passed to the parameter
cell_properties
which receives a matrix in the form of the content-matrix, but each cell is replaced with a dictionary that describes each parameter of the cell:If no dictionary is given, these default values are used.
Alignment settings are passed over to
column_horizontal_alignments
as a list with the length of the amount of columns and texts, describing the horizontal alignment ("left", "center", "right") for each column.I definitely got some progress. The code definitely isn't beautiful or stable... but might need your help on some of this.
I would like to help :D Could you push your files to your fork or share them somehow?
I'll upload them now. I'll sort of try to brief you i nthe commit
2 sep commits, one has my comment. Have fun!