sob.rb - Automatically Post OpenBazaar Listings on STEEM #openbazaar

in #radiator7 years ago

Overview

This script (sob.rb) allows you to automatically post and update OpenBazaar listings on the STEEM blockchain.


Install

To use this Radiator script:

Linux
$ sudo apt-get install ruby-full git openssl libssl1.0.0 libssl-dev
$ gem install bundler
macOS
$ gem install bundler

I've tested it on various versions of ruby. The oldest one I got it to work was:

ruby 2.2.5, with native extensions

First, clone this gist and install the dependencies:

$ git clone https://gist.github.com/95ff25885035e6c9eae6e97ef84ba591.git sob
$ cd sob
$ bundle install

Edit the file sob.yml and set your store API information. Also set the account you want to post with. You must use the posting-wif.


Upgrade

Typically, you can upgrade to the latest version by this command, from the original directory you cloned into:

$ git pull

Usually, this works fine as long as you haven't modified anything. If you get an error, try this:

$ git stash --all
$ git pull --rebase
$ git stash pop

If you're still having problems, I suggest starting a new clone.


Usage

To do the actual post/update (this will post all contracts):

$ ruby sob.rb contract:all broadcast:true

The sob.rb script will now post all contracts on your store. If you update any of your contracts, you can run the same script again to update the blockchain. When updating, in order to avoid blockchain bloat, this script will automatically send a diff patch of changes.

To only post/update a single contract, pass the GUID:

$ ruby sob.rb contract:<contract guid> broadcast:true

Check here to see an updated version of this script:


Troubleshooting

Problem: What does this error mean?
sob.yml:1: syntax error, unexpected ':', expecting end-of-input
Solution: You ran ruby sob.yml but you should run ruby sob.rb.



See my previous Ruby How To posts in: #radiator #ruby

Get in touch!

If you're using sob, I'd love to hear from you. Drop me a line and tell me what you think! I'm @inertia on STEEM and SteemSpeak.

License

I don't believe in intellectual "property". If you do, consider sob as licensed under a Creative Commons CC0 License.

Sort:  

Thank you. Steem and OpenBazaar are good match.

That's badass! Thanks for the tip~:D

Wow, good job!

Wow! This is great. Upvoted and re-steemed. Can't wait to try this :)

Wow now this is a great app idea

I wish I could understand this but one day maybe ill have someone employed who can
I would love to see a steem open bazaar button on the open bazaar app in the future if it ever happens

Wow what a great tool. Now open bazaar products can earn Steem if they post it to the Steem Blockchain. In a way something like dstors tries to acomplish but without the need of an own platform, awesome!!!

Posted using Partiko Android