Gas Price Script

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Tomcat7194
Forum Commoner
Posts: 48
Joined: Mon Jul 31, 2006 1:34 pm

Gas Price Script

Post by Tomcat7194 »

Hello everyone, I'm trying to find a script that will show the average US gas price. There are a lot of sites that give a national number (Gasbuddy.com is a big one, MSN Autos has it too), but none of them appear to offer an RSS feed or a script that I could modify. After extensive Googleing, I've yet to find a solution. Does anyone know of a gas price script or some other method for making the US national gas price average into a PHP variable?

Failing that, does anyone know of a script that will simply display the US average price for crude oil?

Thanks
Tom
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Not sure if it will help, but have you had a look at GasPriceWatch.com?
Tomcat7194
Forum Commoner
Posts: 48
Joined: Mon Jul 31, 2006 1:34 pm

Post by Tomcat7194 »

I did, but it doesn't seem to provide any actual feeds. Is there a way that one could somehow get data from the source code?
Tom
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Possible...Yes. Ethical... not so sure (unless you get their permission). Have you tried to contact them to see about syndicating their data?
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

Post by shiznatix »

yes it could be illigal (you steal their hard discovered content).

take a look at:

Code: Select all

echo file_get_contents('http://sitename.com');
and you might find yourself something interesting
Post Reply