New release - utopian-cli 0.2.1
I released utopian-cli yesterday, and I've been hard at work today adding some new commands, improving already existing ones and making it compatible with Python2.7.
Features overview
The "moderator" and "contributions" command were both updated slightly, and the two new commands "sponsors" and "points" were added. Everything should now also work with Python2.7 (I only tested it briefly).
I will go over all the changes one by one below! You can also check out the usage of all commands on the README (also updated for version 0.2.1).
Improved features
Moderators
I added the --j
flag that allows the user to print the moderator in JSON format instead of just the moderator's name. I also added the --account
option that allows the user to specify a moderator's name and only print information about that moderator
Contributions
I changed it so that it prints an actual URL you can click instead of just the title of a post. This way the user can directly go to a contribution instead of having to manually go there
New features
Sponsors
This is very similar to the moderators command. It currently has the options --account
, which lets the user specify an account, and the flag --j
, which lets the user print the supervisor in JSON format
Points
This command has the arguments (not options) date
, which lets the user specify how far to go back when retrieving contributions, and the argument account
, which lets the user specify which moderator they want to check.
What this command does is retrieve all reviewed contributions by the given moderator since the given date, so for example a week ago. It then prints information about the amount of contributions the moderator has approved / rejected, and how many points they managed to get. It also has some error checking; it makes sure the given account is actually a moderator and that the date isn't a date in the future.
In the future I will probably add some more options to this, like e.g. checking between two given dates instead of between the current date and the given date.
When I started implementing this today I didn't know there was a way to get all posts that were reviewed by a moderator directly from the API. Because of this I started implementing this in a very hacky way, which also took ages to load. After talking to @roj (thanks for the help!) and finding out there's an actual page with some documentation for the Utopian.io API, I figured out a much better way to implement it. So I then scrapped everything I had built for the command so far and rebuilt everything from scratch, and I must say it works nicely!
How was it implemented?
Everything was implemented using the same packages as the previous version, except I needed a way to parse the date from the terminal, and for this I used the Python package dateutil.
To make it compatitible with Python2.7 all I had to do was add the following code
try:
from urllib import urlencode
except ImportError:
from urllib.parse import urlencode
and then change the use of urlencode()
. Very simple!
Roadmap
Currently I don't have that many plans, except that I want to expand the "points" command and add new options. I think I will just check out the Utopian.io API documentation and see what pops into my mind.
How to contribute?
- Fork the repository
- Create a feature branch with
git checkout -b your-feature
- Code and document your feature
- Commit your changes with
git commit -m "add my features"
- Push to your branch with
git push origin your-feature
- Create a new pull request
Anything you can add to the project is valuable to me, be it bug reports, suggestions etc. so please don't hesitate!
Posted on Utopian.io - Rewarding Open Source Contributors
Thank you for the contribution. It has been approved.
You can contact us on Discord.
[utopian-moderator]
Thanks!
Works like a charm! Good job!
Hey @amosbastian I am @utopian-io. I have just upvoted you!
Achievements
Community-Driven Witness!
I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!
Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x