Scripts to generate HTML for a photo gallery of Steemit postssteemCreated with Sketch.

in #utopian-io7 years ago (edited)

Steemit tools

  • Technology Stack
    Python 2.7, javascript, Selenium, BeautifulSoup, requests, steem.js

  • Roadmap
    Will be adding code that runs as a server side component that generates the html using a web interface. I will add other tools that help make posts. I want to make a script that will output the date a follower starts following me and the country they list on their profile. I also need a tool that shows a report on the number of views per post. Another idea is a website that will generate a report on all transactions by date with conversions to dollars at the time of conversion.

  • How to setup and use?

It will filter out any resteems you have done and any images from @steemitboard.

But you have to install Python and some Python packages to get it to work. I am still using Python 2.7

Install Python on a Macintosh

Macintosh
Install Brew with the directions at https://brew.sh/
brew install python or sudo easy_install pip

Install Python on Windows:

https://github.com/BurntSushi/nfldb/wiki/Python-&-pip-Windows-installation
https://matthewhorne.me/how-to-install-python-and-pip-on-windows-10/

Install Python on Linux

https://www.tecmint.com/install-pip-in-linux/

sudo apt-get install python2
sudo apt-get install python-pip python-dev build-essential 
sudo pip install --upgrade pip 
sudo pip install --upgrade virtualenv 

Specific Packages Needed for the Script

sudo pip install BeautifulSoup4
sudo pip install selenium
sudo pip install requests

Chrome and Chromedriver Install

I am using Selenium to read the list of posts from a page I created at http://wowak.com/blog.html?user=bardionson. This page will show a list of your blog posts if you put your username after user= .

The script uses Chrome in way that you will not see the browser startup. (headless) So you need to install Chrome and the Chromedriver.

On Macintosh use this commands

brew install chromedriver
alias chrome="/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome"

On Windows see these directions and down load the software.

The Output

The "Make Photo Post" script will output a list of html links. The links will point at the original post the image came from. Inside the link is the html image tag that will display the image on the page. Copy the list of html links called "<a href" from the output and paste into the Steemit blog post editor. You need to add your own title and heading and any text you want.

The Script

I have placed the most up to date script at my github repository. https://github.com/bardionson/steemit-tools If I need to make a change to the code it will show up there. Shown below is a static version of that code.

The command to run this code is

python make_photo_gallery.py [your username] > [the file you want the links in]
python make_photo_gallery.py bardionson > my_photo_gallery_post.html



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Coin Marketplace

STEEM 0.26
TRX 0.20
JST 0.037
BTC 94320.05
ETH 3419.91
USDT 1.00
SBD 3.88