Getting reputation value on steemit using a javascript function

in #steem-dev7 years ago (edited)

Hi Steemians!,

Here's a small snippet in javascript to getting reputation value about an user, just as steemit and steemd:

Getting the reputation value on Steemit

How to use?

For example, by accessing the following steemit endpoint we can obtain information in json format from my user but we can obtain data from any other replacing 'kastiuz' by the user that we want to consult:

https://steemit.com/@kastiuz.json

In this case, the data that interests us is reputation:

"reputation":"27925202299"

Calling the function in the following ways we would get the reputation without decimals:

getRepValue(27925202299); // result: 38
getRepValue(27925202299,true);  // result: 38

If we wanted the result with two decimals fixed:

getRepValue(27925202299,false);  // result: 38.01

Bye, bye and go on Steemians!

Sort:  

This post has received a 0.20 % upvote from @drotto thanks to: @kastiuz, @banjo.

Congratulations! This post has been upvoted from the communal account, @minnowsupport, by kastiuz from the Minnow Support Project. It's a witness project run by aggroed, ausbitbank, teamsteem, theprophet0, someguy123, neoxian, followbtcnews, and netuoso. The goal is to help Steemit grow by supporting Minnows. Please find us at the Peace, Abundance, and Liberty Network (PALnet) Discord Channel. It's a completely public and open space to all members of the Steemit community who voluntarily choose to be there.

If you would like to delegate to the Minnow Support Project you can do so by clicking on the following links: 50SP, 100SP, 250SP, 500SP, 1000SP, 5000SP.
Be sure to leave at least 50SP undelegated on your account.

This post was upvoted and resteemed by @resteemr!
Thank you for using @resteemr.


@resteemr is a low price resteem service.
Check what @resteemr can do for you. Introduction of resteemr.

Your Post Has Been Featured on @Resteemable!
Feature any Steemit post using resteemit.com!
How It Works:
1. Take Any Steemit URL
2. Erase https://
3. Type re
Get Featured Instantly � Featured Posts are voted every 2.4hrs
Join the Curation Team Here | Vote Resteemable for Witness

¡@kastiuz! Muy bueno el contenido, sigue asi!

Esta publicación es apoyada por la comunidad UNEEVERSO, para que al obtener votos automatizados pueda conseguir PROMOCIÓN GRATUITA y pueda darse a conocer a un público más grande. Este contenido lo merece, considera darle reesteem.

¿Te interesa, obtener upvotos y dar a conocer tu publicación?


Te invitamos a unirte a nuestra comunidad, cada día crece más y tu puedes crecer con nosotros.
¿Te interesa conocer sobre nuestro proyecto?: https://goo.gl/cuFExt
¿Te interesa conocer sobre nosotros y sobre actualizaciones de uneeverso.com?:
* Acceso a Uneeverso : https://www.uneeverso.com/registro
* Uneeverso en discordapp: https://discord.gg/Y5kM5Kj
* Siguenos: @blickyer @yunior.selbor @sweetvenon @arevaloarcadio @baudilio @jnavarrotovar

@kastiuz just got this post resteemed to 4800 followers.

I am not a bot. Upvote this comment if you like this service

Congratulations @kastiuz! You have completed some achievement on Steemit and have been rewarded with new badge(s) :

Award for the number of upvotes
Award for the number of upvotes received

Click on any badge to view your own Board of Honor on SteemitBoard.
For more information about SteemitBoard, click here

If you no longer want to receive notifications, reply to this comment with the word STOP

By upvoting this notification, you can help all Steemit users. Learn how here!

Coin Marketplace

STEEM 0.19
TRX 0.15
JST 0.029
BTC 63968.82
ETH 2633.99
USDT 1.00
SBD 2.84