Jump to content

Leaderboards


Jay Hanke

Recommended Posts

9 hours ago, Jay Hanke said:

What do you guys think about mileage and supercharger leader boards for the club?

Flesh this out further.

Do you mean trying to figure out how many mile someone is driving and putting that up?

Do you mean how many superchargers are tickled along the way?

 

What we are doing with the CO2 item is super easy - it's an API query that requires no authentication that provides data from Tesla.

Link to comment
Share on other sites

Both are interesting idea's but at least at this point most of it would have to be user reported. We are steering away from anything that uses an authenticated API to gather data currently because it's just too much of a mess to deal with and the potential security issues that can come along with it. I wouldn't be opposed to a self reported mileage leaderboard but I would guess this would either end up being filled with mostly old or made up data.

Link to comment
Share on other sites

Oh ho that's an idea maker right there:

 

Could make a script that uses the generated token from TeslaFi (and maybe others later) that can pull in data and update a field in the database. Perhaps even be smart and display something like this:

 

  1. Jay Hanke *0571 62,917
  2. mike *1819 51,971
  3. Dan Holtz *1225 37,421
  4. Jay Hanke *7317 36,192
  5. ...

Could make it even more fun by doing car query directly and walk people through creating a token but then it would have to be refreshed all the time, etc. For many of us that would be a good solution but for the normals out there it would be hard and the TeslaFi (and others) idea would work the better.

 

could be as simple as:

#!/bin/sh

# and go ahead and have fun with tearing it down to last 4 VIN number - for later - this is an example!

MEMBER_ID=$1
INPUT_TOKEN=$2

OUTPUT_TOKENS=`curl -o- -s https://api.teslafi.com/ ... /${INPUT_TOKEN} | jq '.vin|.odometer'`

TOKEN_1=`echo ${OUTPUT_TOKENS} | awk '{print $2}'`
TOKEN_2=`echo ${OUTPUT_TOKENS} | awk '{print $4}'`

echo "update xxx set miles ..." | mysql ...

Wouldn't be too bad at all. This example is off the top of my head and would require some interactive playing around, bounds checking, and all that jazz. And, of course, error checking cause no one wants to get banned from querying an API with bad data all the time, amiright?!

Link to comment
Share on other sites

14 hours ago, mike said:

Oh ho that's an idea maker right there:

 

Could make a script that uses the generated token from TeslaFi (and maybe others later) that can pull in data and update a field in the database. Perhaps even be smart and display something like this:

 

  1. Jay Hanke *0571 62,917
  2. mike *1819 51,971
  3. Dan Holtz *1225 37,421
  4. Jay Hanke *7317 36,192
  5. ...

Could make it even more fun by doing car query directly and walk people through creating a token but then it would have to be refreshed all the time, etc. For many of us that would be a good solution but for the normals out there it would be hard and the TeslaFi (and others) idea would work the better.

 

could be as simple as:


#!/bin/sh

# and go ahead and have fun with tearing it down to last 4 VIN number - for later - this is an example!

MEMBER_ID=$1
INPUT_TOKEN=$2

OUTPUT_TOKENS=`curl -o- -s https://api.teslafi.com/ ... /${INPUT_TOKEN} | jq '.vin|.odometer'`

TOKEN_1=`echo ${OUTPUT_TOKENS} | awk '{print $2}'`
TOKEN_2=`echo ${OUTPUT_TOKENS} | awk '{print $4}'`

echo "update xxx set miles ..." | mysql ...

Wouldn't be too bad at all. This example is off the top of my head and would require some interactive playing around, bounds checking, and all that jazz. And, of course, error checking cause no one wants to get banned from querying an API with bad data all the time, amiright?!

So much of this looks like gibberish to me. I'm just going to smile and nod.

Link to comment
Share on other sites

19 hours ago, Jay Hanke said:

I learned something, I hadn't seen jq before. [feeling bashful]

play enough with JSON and you'll find jq to be quite handy though every time I want to use it I have to review help pages and examples.

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...