Integration of 1UP voting rules

View this thread on: d.buzz | hive.blog | peakd.com | ecency.com
·@stoodkev·
0.000 HBD
Integration of 1UP voting rules
![image.png](https://res.cloudinary.com/hpiynhbhq/image/upload/v1515515505/z5q318j61cnpqhity5je.png)

I ve integrated the rules for the 1UP button usage as discussed by @flauwy in [here](https://steemit.com/utopian-io/@flauwy/the-1up-button-and-ranking-page-explained). The merged pull request can be found in [here](https://github.com/therealFlauwy/1UP/pull/7).

# The rules
<br>


Once the button implemented via SteemPlus, these rules will assure that: 

## Users cannot upvote themselves
<br>

If you check the following example, you can see  by looking at the `from` and `url` that @steem-plus is trying to vote for one of its posts. Bad bad SteemPlus! Thus, the server returns an error saying :
"You cannot vote for yourself!"

![image.png](https://res.cloudinary.com/hpiynhbhq/image/upload/v1515516524/tzyejjb9baktt5brxafj.png)

## Users cannot vote more than ten times a day
<br>

That is an additional feature that I discussed by DM with @flauwy. For the sake of simplicity during the test I set it to 2 posts maximum, but changed it to 10 before upload. This number will be easily changeable in the future.

![image.png](https://res.cloudinary.com/hpiynhbhq/image/upload/v1515516756/hcg4tgkcigelmhquym3n.png)

As you can see, after sending more than 2 votes using `cURL`, the server refused to save my vote and told me to try again tomorrow.

## Users cannot vote more than once a day for the same user
<br>

Another great rule to prevent abuses. I tested it in a similar manner by sending two cURLs for @stoodkev to vote a @steem-plus contribution. The first time went well, but at the second one:

 ![image.png](https://res.cloudinary.com/hpiynhbhq/image/upload/v1515516936/rlce4pcbp9fsulfnhn5w.png)

As expected, the server rejects my vote.

## Other rules
<br>

- The minimum reputation of 45 will be checked directly in the front end since it doesnt make sense to display the button at all if users cannot use it.
- More rules to be discussed in the future.

## Future work
<br>

- Getting SteemConnect to work on the backend for verification purpose only (to make sure that users vote only using the SteemPlus extension)
- Once user identity is verified, take into account their vote into the post list.
- Implement the button on SteemPlus for Utopian
- Adding button information
- 1UP button for other platforms

One step closer!

@stoodkev 


<br /><hr/><em>Posted on <a href="https://utopian.io/utopian-io/@stoodkev/integration-of-1up-voting-rules">Utopian.io -  Rewarding Open Source Contributors</a></em><hr/>
👍 , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,