Posts

scotbot: api update and how the delay was reduced

avatar of @holger80
25
@holger80
·
0 views
·
2 min read

Improved API endpoints

The scotbot API endpoints for get_feed, get_discussions_by_created, get_discussions_by_trending and get_discussions_by_hot have been improved and show also posts which are already paid out. The results when viewing a the trending page of a tag is also improved.

You can check how this works here: https://www.palnet.io/trending/scotbot https://www.palnet.io/hot/scotbot https://www.palnet.io/created/scotbot When you scroll down to the last post, more post will load.

New API Endpoints

Two new api calls were implemented.

Endpoint get_account_votes

This api endpoint can be used to list all votes that a voter has made on a tribe.

GET /get_account_votes

Query Parameters

NameTypeDescriptionRequired
accountstringsaccount nameyes
tokenstringstoken nameyes
limitintlimit results (default 1000)
offsetintskips results (default 0)

Example

Endpoint get_votes

This api endpoint returns the last votes for a specific tribe token.

GET /get_votes

Query Parameters

NameTypeDescriptionRequired
tokenstringstoken nameyes
limitintlimit results (default 1000)
offsetintskips results (default 0)

Example

Speed up scotbot by removing Comment api calls

Comment api calls have been strongly reduced. Before, all comments were parsed from the tags api. This took to long, and the content of a block could not be parsed within 3 seconds. This lead then to an increased delay of scotbot.

As scotbot stores now all votes in the database and the body, title and metadata is also available in the block api call, it was possible to reduce the amount of api calls.

Only when an edited body contains @@, which indicates that the body was edited, a comment api call is needed.

This update is online since a few days now and the delay could be reduced to around 3-9 seconds.