XMLCharts - Industrial and Precious Metals Prices
Component ID
Component name
Component type
Maintenance status
Development status
Component security advisory coverage
Downloads
Component created
Component changed
Component body
Notice January 9, 2017: The XML Charts web service have changed their business model and no longer provide the free XML chart feed.
This XML Charts module will work with the paid model with some slight changes to the codebase. If there is interest, I'll refactor it in order to work with the paid service and push another version with the changes.
XMLCharts is a Drupal module that consumes, caches and produces blocks to display industrial and precious metal prices from the XML Charts free XML price feeds. If you're looking for a method to place precious and/or industrial metal pricing on your website, this is probably the solution you're looking for.
At this time XMLCharts provides pricing information for:
- Precious metals: Gold, Platinum, Palladium & Silver
- Industrial metals: Nickel, Copper, Zink, Lead & Aluminum
The metals are priced in 13 currencies.
About XML Charts: The XML Charts service is free. However, if you are using it you have to set the links to their service. According to their terms of service, they "don't care where or how visible your link is but it has to be set". The XML Charts module provides the appropriate link by default and the visibility of the link can be adjusted in the block configuration page.
Note: I had an email conversation with the owners of the XML Charts web service feeds recently about the requirement of providing a link to their website and when they indicate that they don't care about the visibility of the link, they simply mean that it doesn't have to have a high profile position on the page that displays their feed data but it needs to be visible somewhere; they suggested the footer or some other inconspicuous placement. I have included two additional blocks for this purpose so that you can turn off the link visibility in the price block and then include the appropriate link block in the footer or wherever is appropriate for your needs.
Before using this module, read the XML Charts terms of service to ensure it is the right solution for you: http://www.xmlcharts.com/terms-of-service.html
Once installed, you will be able to place one or more of the precious or
industrial metal prices on your site in any of the supported currencies.
The feed is acquired and cached within the Drupal host site and refreshed
twice a day; after 10.30 a.m. and after 03.00 p.m. GMT. Set a crontab schedule
to run cron just after 10.30 a.m. and after 03.00 p.m. GMT in order to get the
most up to date pricing data.
INSTALLATION
- Install and activate this module
- Navigate to Structure -> Blocks and enable the blocks that you
would like to use in your site. - Visit the configuration page for each block to adjust the title,
units of measurement, and link to XML Charts visibility. - Set a crontab schedule to run cron just after 10.30 a.m. and after
03.00 p.m. GMT in order to get the most up to date pricing data. You can set it to run just after every hour and it will update twice a day. - Don't forget to set the appropriate link back to the XML Charts website.
THEMING
The blocks that are produced by the XML Charts module contain CSS classes to assist
front end developers in theming the data to suit their website needs. The classes
are as follows:
- xml-chart-item - wraps the entire text output
(commodity, currency, units of measure and value) - xml-chart-type - wraps the name of the commodity
- xml-chart-currency - wraps the currency
- xml-chart-units - wraps the units of measure
- xml-chart-value - warps the value including the currency symbol
Disclaimer:
I don't know the owners of the XML Charts Free feed service other than a few email conversations and have only developed this module because I have found it useful. I have reached out to them to let them know that I was building this module to make it easier for Drupal developers to access their service and they responded positively.
I hope others find this module useful and easy to use.
Note: There is a "paid for" XML Charts service that provides refreshed updates, several times per minute which provides a higher degree of accuracy in pricing calculations. If there is enough interest, I will add the capability to choose between the Free and Live versions to an update of this module.
