Script for getting current price of...

User 2623310 Photo


Ambassador
282 posts

Hello Everyone,

I was just wondering if their is any script for getting the current price of gas to display on a website? Is this possible or do I need to go do it manually every time the price changes?

Thanks
User 122279 Photo


Senior Advisor
14,447 posts

I'm not able to reply to this one, but have you thought of which is/should be your authority? I live in a small country, and although the stock exchange says one thing, the different petrol companies might well say something different. Is there just one price in all of the US (assuming that's where you are)?
Ha en riktig god dag!
Inger, Norway

My work in progress:
Components for Site Designer and the HTML Editor: https://mock-up.coffeecup.com


User 2623310 Photo


Ambassador
282 posts

Yes, I do live in the US. We do have different types of gasoline which are at different prices per gallon. I was just if there was a easy way to do it.
User 122279 Photo


Senior Advisor
14,447 posts

I'm sure it can be done if the price is published somewhere on the web or in a DB that can be accessed. You just have to wait for Eric to turn up, I guess... ;)
Ha en riktig god dag!
Inger, Norway

My work in progress:
Components for Site Designer and the HTML Editor: https://mock-up.coffeecup.com


User 187934 Photo


Senior Advisor
20,181 posts

Does this work.
<script type="text/javascript" src="https://www.gas-cost.net/widget.php?lang=en"> </script>

Looks like this on my host.
https://ericrohloff.com/coffeecup/ccfor … el-prices/

Here's some more API's
https://www.eia.gov/opendata/qb.php?category=711295
http://www.mygasfeed.com/keys/api
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 2623310 Photo


Ambassador
282 posts

Thanks!! I will have a look at theses.

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.