No, I take that back. You select the units when you select the mini-stat. So the name for each stat will always be the same. You'd just need as many conditionals as we have mini stats, but it'd be no different with IDs.
After looking through this I guess I could allow the classes to post data to the Fuelly API also however I personally would not have a uses for this so unless someone chimes in that will not be high on the priority list
I just noticed that you have 2 areas in which you can view your fillups. One being the /log page which shows the fuelup information.
The other place is on the actual vehicle page where you use ajax to populate a datatable. However both areas cotntain information that the other area does not contain.
Do you think that in the future you will make both areas contain the same information? I ask because I was parsing the /log page to get the data but Total Miles for the fuel-up is not listed here. It is listed on the ajax page but making 2 requests to combine the data seems redundant.
I'm sorry, we can't rearrange things for one particular niche use of Fuelly. We need to build pages first and foremost for how we feel people are going to use them. Our decisions about what to include where need to come from that.
It's a space issue. Both places have a finite amount of space to display information so we have to make choices about what we display. The Log Book is especially crowded and odometer readings are long numbers.
The two spaces compliment each other. They aren't meant to be copies.
I have done quite a bit of work on this Library and will be writing up a blog post on how to use it for people who are not fluent in PHP.
It's come a long way even from yesterday. I started out by using XPath to fetch most of the data but am now in the process of migrating it to use DOMDocument rather than XPath for most of the cases.
The new library will now return an instance of Fuelly_Response which is a container to hold your user object and vehicle object. The vehicle object holds all of the Fuelup objects ready for manipulation.
I have added some features to this that I personally wanted such as totalMilesToday
You can simply grab the vehicle object and write something as simple as:
echo "I have rode my motorcycle ".$vehicle->getTotalMilesToday()." today." and that will either print 0 or however many miles your fuelups for that day accumulate to.
I understand it's not going to be exact because I might start the day with a quarter tank and drive around for 20 miles before fueling up.
I plan to keep this accurate by topping off my tank every morning on my way to work. This will then be able to calculate properly.
You can now also fetch details only for a specific vehicle by passing the vehicle name to the run method. For instance $scraper->run('2WT'); will return only the fuelups and details for the vehicle labeled 2WT.