Create a post that explains the getDiscussions method and earn 25 SBD or more.
Hello Steemians!
The development of the next SteemJ version is still ongoing and consumes a lot of my time. To speed this process up, I thought about asking for some help in the community. So if you ever wanted to contribute to SteemJ, here is your chance to do so and to get paid for it on top.
The database_api provided by a Steem Node has several methods to receive posts (aka discussions) based on the provided conditions. Sadly, I wasn’t able to find documentation for those methods and how they act in detail. The only way to finger this out seems to be testing it on my own.
The task itself is to write a tutorial here on Steemit that fulfills the following requirements:
The idea is to reuse your post to:
Due to that your post should be written in English and should have a good quality in general :) - Thanks!
I really appropriate any help I can get, but I guess that this may not be enough motivation :P – Therefore I thought about the following reward for the first post that fulfills the requirements described above:
To make the task a little bit easier, here are some useful information.
As a look at the original Steem source code will be really helpful for sure, here is the link to the “database_api” which contains the “get_discussions_by*” methods: https://github.com/steemit/steem/blob/master/libraries/app/database_api.cpp
Beside that, here is the original code of the “discussion_query” struct:
/**
* Defines the arguments to a query as a struct so it can be easily extended
*/
struct discussion_query {
void validate()const{
FC_ASSERT( filter_tags.find(tag) == filter_tags.end() );
FC_ASSERT( limit <= 100 );
}
string tag;
uint32_t limit = 0;
set<string> filter_tags;
set<string> select_authors; ///< list of authors to include, posts not by this author are filtered
set<string> select_tags; ///< list of tags to include, posts without these tags are filtered
uint32_t truncate_body = 0; ///< the number of bytes of the post body to return, 0 for all
optional<string> start_author;
optional<string> start_permlink;
optional<string> parent_author;
optional<string> parent_permlink;
};
For your tests and for creating the snippets you need the latest version of SteemJ (a pre release of version 0.4.0) which can be downloaded here: https://oss.sonatype.org/content/repositories/releases/eu/bittrade/libs/steemj-core/0.4.0pr1/
Or added as a dependency to a Maven project using:
<dependency>
<groupId>eu.bittrade.libs</groupId>
<artifactId>steemj-core</artifactId>
<version>0.4.0pr1</version>
</dependency>
In SteemJ all “get_discussions_by” methods are aggregated in a single method:
getDiscussionsBy(DiscussionQuery discussionQuery, DiscussionSortType sortBy)
As described above, please provide snippets for all 12 DiscussionSortTypes.
SteemJ is a project that allows you to communicate with a Steem node using Java. So far, the project supports most of the API calls and is also able to broadcast most of the common operation types. Further information can be found on GitHub.
SteemJ binaries are pushed into the maven central repository and can be integrated with a bunch of build management tools like Maven. The Wiki provides a lot of examples for the most common build tools. If you do not use a build management tool you can download the binaries as described here.
The project became quite big and there is still a lot to do. If you want to support the project simply clone the git repository and submit a pull request. I would really appreciate it =).
git clone https://github.com/marvin-we/steem-java-api-wrapper.git
Most of my projects are pretty time consuming and I always try to provide some useful stuff to the community. What keeps me going for that is your feedback and your support. For that reason I would love to get some Feedback from you <3. Just contact me here on Steemit or ping me on GitHub.
Follow me | Follow @dez1337 |
---|---|
Thanks for reading and best regards,
@dez1337