Fuelly API - Page 2 - Fuelly Forums

Click here to see important news regarding the aCar App

Reply
 
Thread Tools Display Modes
 
Old 10-12-2011, 09:11 AM   #11
pb
Senior Member
 
Join Date: Jul 2008
Posts: 1,588
Country: United States
Location: Corvallis, OR
No, it's not multi-lingual. But folks can change their viewing units. So the stat names could be different variations based on their current viewing units.
__________________

pb is offline   Reply With Quote
Old 10-12-2011, 09:15 AM   #12
pb
Senior Member
 
Join Date: Jul 2008
Posts: 1,588
Country: United States
Location: Corvallis, OR
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.
__________________

pb is offline   Reply With Quote
Old 10-12-2011, 01:36 PM   #13
Junior Member
 
Join Date: Jul 2011
Posts: 15
Country: United States
Location: Lynn, MA
thanks for that information, I will include that in the next release.
jcrawford27 is offline   Reply With Quote
Old 10-13-2011, 08:28 AM   #14
Junior Member
 
Join Date: Jul 2011
Posts: 15
Country: United States
Location: Lynn, MA
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
jcrawford27 is offline   Reply With Quote
Old 10-13-2011, 08:28 AM   #15
Junior Member
 
Join Date: Jul 2011
Posts: 15
Country: United States
Location: Lynn, MA
Woops I referenced Fuelly API which does not exist, I meant post data to Fuelly itself
jcrawford27 is offline   Reply With Quote
Old 10-14-2011, 02:08 AM   #16
Junior Member
 
Join Date: Jul 2011
Posts: 15
Country: United States
Location: Lynn, MA
Hello pb,

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.
jcrawford27 is offline   Reply With Quote
Old 10-14-2011, 02:33 AM   #17
pb
Senior Member
 
Join Date: Jul 2008
Posts: 1,588
Country: United States
Location: Corvallis, OR
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.
pb is offline   Reply With Quote
Old 10-14-2011, 08:26 AM   #18
Junior Member
 
Join Date: Jul 2011
Posts: 15
Country: United States
Location: Lynn, MA
I understand that though I am not sure why you have them in 2 different places, the only thing missing from the /log page is the miles traveled.

and in the data table you don't have the odometer.

I thought maybe it was an error on a developers part that the 2 sections were each missing a column.
jcrawford27 is offline   Reply With Quote
Old 10-14-2011, 08:58 AM   #19
pb
Senior Member
 
Join Date: Jul 2008
Posts: 1,588
Country: United States
Location: Corvallis, OR
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.
pb is offline   Reply With Quote
Old 10-14-2011, 10:32 AM   #20
Junior Member
 
Join Date: Oct 2011
Posts: 3
Country: United States
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.

Here is some sample output from the library

object(Fuelly_Response)#3 (1) {

["_properties"rotected]=>

array(6) {

["searchByVehicleName"]=>

bool(false)

["searchVehicleFound"]=>

bool(false)

["searchVehicleString"]=>

string(0) ""

["totalVehiclesFound"]=>

int(1)

["user"]=>

object(Fuelly_User)#1 (1) {

["_properties"rotected]=>

array(4) {

["email"]=>

string(19) "test@mailinator.com"

["password"]=>

string(4) "test"

["displayName"]=>

string(6) "test27"

["isLoggedIn"]=>

bool(true)

}

}

["vehicles"]=>

array(1) {

["2WT"]=>

object(Fuelly_Vehicle)#11 (1) {

["_properties"rotected]=>

array(15) {

["id"]=>

string(5) "93749"

["name"]=>

string(3) "2WT"

["displayName"]=>

string(3) "2WT"

["avgMilesPerGallon"]=>

string(4) "47.5"

["lastMilesPerGallon"]=>

string(4) "64.5"

["bestMilesPerGallon"]=>

string(4) "64.5"

["avgPricePerGallon"]=>

string(5) "$3.92"

["avgPricePerFuelUp"]=>

string(6) "$12.14"

["avgPricePerMile"]=>

string(6) "$0.082"

["totalFuelups"]=>

int(5)

["totalSpent"]=>

string(6) "$60.71"

["totalMilesTracked"]=>

string(3) "589"

["totalMilesToday"]=>

int(0)

["hasFirstFuelupOfTheDayBeenCompleted"]=>

bool(false)

["fuelups"]=>

array(5) {

[0]=>

object(Fuelly_Fuelup)#19 (1) {

["_properties"rotected]=>

array(9) {

["timestamp"]=>

int(1318365120)

["odometer"]=>

string(3) "590"

["miles"]=>

int(200)

["gallons"]=>

string(3) "3.1"

["milesPerGallon"]=>

float(64.5)

["pricePerGallon"]=>

string(6) "$3.899"

["note"]=>

string(16) "Cumberland Farms"

["addedBy"]=>

string(6) "test27"

["total"]=>

string(6) "$12.09"

}

}

[1]=>

object(Fuelly_Fuelup)#18 (1) {

["_properties"rotected]=>

array(9) {

["timestamp"]=>

int(1317663120)

["odometer"]=>

string(3) "390"

["miles"]=>

int(109)

["gallons"]=>

string(3) "3.1"

["milesPerGallon"]=>

float(35.2)

["pricePerGallon"]=>

string(6) "$3.999"

["note"]=>

string(5) "Mobil"

["addedBy"]=>

string(6) "test27"

["total"]=>

string(6) "$12.40"

}

}

[2]=>

object(Fuelly_Fuelup)#22 (1) {

["_properties"rotected]=>

array(9) {

["timestamp"]=>

int(1317576660)

["odometer"]=>

string(3) "281"

["miles"]=>

int(140)

["gallons"]=>

string(3) "3.1"

["milesPerGallon"]=>

float(45.2)

["pricePerGallon"]=>

string(6) "$3.799"

["note"]=>

string(0) ""

["addedBy"]=>

string(6) "test27"

["total"]=>

string(6) "$11.78"

}

}

[3]=>

object(Fuelly_Fuelup)#23 (1) {

["_properties"rotected]=>

array(9) {

["timestamp"]=>

int(1317490200)

["odometer"]=>

string(3) "141"

["miles"]=>

int(140)

["gallons"]=>

string(3) "3.1"

["milesPerGallon"]=>

float(45.2)

["pricePerGallon"]=>

string(6) "$3.899"

["note"]=>

string(0) ""

["addedBy"]=>

string(6) "test27"

["total"]=>

string(6) "$12.09"

}

}

[4]=>

object(Fuelly_Fuelup)#24 (1) {

["_properties"rotected]=>

array(9) {

["timestamp"]=>

int(1317490140)

["odometer"]=>

string(1) "1"

["miles"]=>

int(0)

["gallons"]=>

string(3) "3.1"

["milesPerGallon"]=>

float(0)

["pricePerGallon"]=>

string(6) "$3.989"

["note"]=>

string(0) ""

["addedBy"]=>

string(6) "test27"

["total"]=>

string(6) "$12.37"

}

}

}

}

}

}

}

}

You can download the new one at http://www.josephcrawford.com/wp-con...-0.2-alpha.zip

Please let me know your thoughts and what features you think you might want to see in this codebase.

I plan to write up a tutorial about this library to give users an insight into how to use it. and will post here when that's done.
__________________

test27 is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


» Fuelly iOS Apps
» Fuelly Android Apps
Powered by vBadvanced CMPS v3.2.3


All times are GMT -8. The time now is 10:32 AM.


Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2024, vBulletin Solutions, Inc.