Draft Management and Version Control to Steem Posts via git in a Docker Container

in #utopian-io8 years ago (edited)

image.png

About

Features and git

git-steem-bot allows a steemian to post to the Steem community using a version control tool called git. git for posting allows steemians to make use of inherent features of git and apply them to posts. Among these are:

  1. Drafts allows a user to manage drafts in a repository and edit over time without having to lose track of work
  2. Version Control users can now revert to previous version, cherry pick, or merge changes from other users
  3. Collaboration allows user to accept pull requests from other steemians to apply to a post

Docker

Docker is a requirement for using this. It allows us to encapsulate tools, configuration, programs, etc... into a single container that is isolated away from influence or customizations the user may use in their home environment. It also allows us to boil usage down to simple commands.

Stack

What you get

SoftwarePurpose
DockerProvides isolated container for user to run the bot in
gitProvides most of the features we're trying to make use of
nodejsUsed to execute scripts for things like integrating with the steem api

Setup

Setup is really simple

Setup Environment Variables

export GITHUB_USER=<github username>
export GITHUB_TOKEN=<github token>
export STEEM_NAME=<steemit user name>
export STEEM_WIF=<steemit posting private key>
export STEEMIT_GIT_PROJECT=<github project for steemit posts>

Setup Script

Curl the setup script

export GITHUB_USER=r351574nc3
export GITHUB_TOKEN=<your token>
curl  https://raw.githubusercontent.com/r351574nc3/docker-git-steem-bot/master/setup.sh && sh 
source $HOME/.steemgitrc

Run steemgit_setup

~/s/g/r/docker-git-steem-bot git:master ❯❯❯     steemgit_setup steemit-posts                                                                              ⏎ ◼
https://r351574nc3:[email protected]/r351574nc3/steemit-posts
Cloning into bare repository 'steemit-posts.git'...
Cloning into 'steemit-posts'...

Posting

Create a new file

touch new-post.md

Commit change

steemgit add new-post.md
steemgit commit -a -m "Title of Post"

Note The first line of the git commit isn't just the summary. It's also the title of your post

Push commit

~/s/steemit-posts git:master ❯❯❯ steemgit push steem master
remote: 
remote: > [email protected] post /steem/steemit-posts.git/hooks        
remote: > node index.js "steem-post-made-from-git-steem-bot." "This Post Was Created by the Docker git-steem-bot"        
remote: 
remote: { id: 'ae9e9e96b429040553ce8590417fd516f669e947',        
remote:   block_num: 19361977,        
remote:   trx_num: 26,        
remote:   expired: false,        
remote:   ref_block_num: 28839,        
remote:   ref_block_prefix: 528799349,        
remote:   expiration: '2018-01-28T03:05:18',        
remote:   operations: [ [ 'comment', [Object] ] ],        
remote:   extensions: [],        
remote:   signatures:         
remote:    [ '206b2ddeb11f7cdfe9721c51a8ac7f8ccd59397d67e529d5f71804d023fef5daba7ec8cd6c9351a270ed7a0ead2ad4ee57cae767351c2641199d0584494f11168a' ] }        
remote: /steem/steemit-posts.git        
To /steem/steemit-posts.git
   48adba9..7fe7ed7  master -> master

steemgit

This is a wrapper provided that executes git from the docker container. It allows us to in a single command manage the project. It works just like git, so anyone that knows git can use this just the same.

steemgit_setup

This is a setup script that is used initially to get repos setup. You probably only need to ever run this one time.

Roadmap

Image and Media Support

I want to add support for posts that contain videos, images, etc... Right now, you kind of have to edit after-the-fact (eg., post and then edit the post :/)

Posting Options via YAML

Allow configuration of a post via YAML embedded in the commit message. Right now, the git summary represents the title. I'd like it to support other information like:

  • tags
  • schedule (queued or scheduled posts or "post x on this day")
  • payout options (50/50 or otherwise)
  • workflow (notifying bot workflow chain)

C9 Support

Most people don't have markdown editors. I'd like to embed an editor like C9 within the container so everything you need for publishing can be in one place.

Collaboration support

Right now, git hooks are used to kick off the bot. I'd like to find another way, this way changes received via pull can be included. This way users that pull changes or the owner can still post via git.

Contributing

We're open to contributions

r351574nc3#7016 on discord



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Moar like this!

I can't wait for the roadmap features. This thing is gonna kill.

Hey @r351574nc3 I am @utopian-io. I have just upvoted you!

Achievements

  • You have less than 500 followers. Just gave you a gift to help you succeed!
  • Seems like you contribute quite often. AMAZING!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

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

Thank you for the contribution. It has been approved.

I love your idea, it is really cool. Let's see how its development goes.

You can contact us on Discord.
[utopian-moderator]

Coin Marketplace

STEEM 0.04
TRX 0.33
JST 0.101
BTC 64114.90
ETH 1794.49
USDT 1.00
SBD 0.38