Programming Diary #1: The Programming Environment, Steem Links, and SteemJ

in #steemexclusive3 years ago (edited)

For some reason, I was motivated to spend my days off from work on some Steem programming. Here's what I did with my time off this week.


Introduction

image.png

Pixabay license: source

The thing I hate about programming is choosing the environment. What language, editor,and compiler do I want to use? Basically, I'm lazy, so I just want to turn it on and get going.

Unfortunately, modern programming usually doesn't work that way. The languages with the lowest barriers to entry for me are Python and shell languages like bash, ksh, and zsh, and for those languages, I still write code in "vi". This week, however, my goal was to create an interface for SteemLinks. That goal requires a GUI, and I have no experience (i.e. zero) in that arena.

So my work this week involved choosing a language, choosing a programming environment, learning how to make graphical forms, and learning how to interface with the Steem blockchain (in that language). After I gained that basic familiarity, I moved on to actually creating a semi-functional form for creating HTML/Markdown code for the Steem Links community.

Here are some of the highlights!

Choosing a Programming Language

Basically, my arbitrary starting choices were java, Python, or shell scripting. The experimental @penny4thoughts application is done mostly in shell scripting, and my voting bots are done in Python. It had been 15+ years since I had done anything in Java - and even then I hadn't done much, so that would have been almost like starting from scratch. Also, as noted above, I've never done much of anything with graphics in any language.

I was able to rule out shell scripting quickly, even though that's what I know best. Unfortunately, it's not really suitable if I want to create a graphical user interface (GUI).

At first, I was leaning toward Python, but I wanted to read about how to do GUI development in Python and Java. After reading about that, I decided that java would be better because it can also be useful with development for mobile devices. So.... Java it was.

I want to avoid licensing headaches, so I'm making use of openjdk17

The Programming Environment

I already had Eclipse installed on my PC, so that was the early front-runner. But...

After several hours of updating to the latest version, watching tutorial videos, and otherwise playing around, I still couldn't see a path to creating a GUI in Eclipse, so I bailed out on that and tried Netbeans instead. In contrast to Eclipse, I was able to find a GUI form designer in a matter of minutes in Netbeans, so that's the solution that I settled on.

I also looked, briefly, at IntelliJ, but I didn't see a compelling reason to burn time on it. Maybe I'll take another look at it in the future.

The goal with the GUI is to streamline the process of creating a post in the Steem Links community. To that end, step 1 is to create a form where data can be entered and converted into markdown; step 2 is to auto-populate some of the information from the web; and step 3 is to enable posting it on the Stem blockchain. At this point, I've completed basic versions of steps 1 & 2.

Form Creation

Form design with Java/Swing in Netbeans is fairly easy -- a lot of it is just "drag and drop". So, I had a rudimentary form created in a matter of minutes and spent some additional time expanding it. Here's what the form looks like now.

image.png

Autopopulating the form and generating HTML/Markdown

In order to autopopulate the form, I was thinking that I would use the Open Graph information from the web site, so the user (ME) can simply paste a URL and get some of the other fields automatically. Here's what the form looks like when that's working. (I entered the URL and clicked the "AutoPopulate" button. The other fields were pulled from the web site.)

image.png

To do this, I used the jSoup libraries. I chose this because @cmp2020 mentioned that he had used "Beautiful Soup" for web scraping with Python. I am assuming (based on the "Soup" part) that the two are related.

Once the autopopulation is done, there are some other fields to be filled out by the Steem Linker. These include the date the article was published, an excerpt from the article, and additional author commentary. After filling out the form, the user can autogenerate HTML/Markdown code to create an attractive looking post. After generating markdown, the form looks like this:

image.png

Interacting with Steem

Next up is to actually post the auto-generated HTML/Markdown onto the Steem blockchain, and I haven't made it this far. Right now, a person using this form would have to copy/paste from the output window into a Steem post. Here's a Sample Post after copy/paste from the java app into a Steemit post in the browser.

In order to connect the form to the blockchain, I'm planning to use the @steemj libraries from @dez1337. So far, I have downloaded this from the github site, updated it to use to the latest versions of log4j and slf4j and created a couple of rudimentary input operations to verify that I can connect to the blockchain.

Now here's the part where I call for help. This code has not been heavily maintained in the last couple years, so if there are any Java developers reading this, let's work together and get it up to date! Not sure if we'll need to fork it or if @dez1337 is still around to respond to pull requests.

Conclusion

So that's my progress this week. It's back to work after the holiday, so I don't know how soon I'll be moving forward again, but it has been a good learning experience. Hopefully, I can find some time to move forward slowly and surely.

If there are any java developers who are interested in modernizing SteemJ, I'd be willing to set up a SteemJ community on Steem where we can collaborate on the effort. It would be good to get some other community moderators, too! As they say, "Many hands make light work." Who's in?


Thank you for your time and attention.

As a general rule, I up-vote comments that demonstrate "proof of reading".




Steve Palmer is an IT professional with three decades of professional experience in data communications and information systems. He holds a bachelor's degree in mathematics, a master's degree in computer science, and a master's degree in information systems and technology management. He has been awarded 3 US patents.

Sort:  

Could this information help you with what you plan to do?

https://steemit.com/witnesses/@boylikegirl.wit/i-created-a-new-steem-api-server

It might. This is good to know about. Thank you very much!

If there are any java developers who are interested in modernizing SteemJ, I'd be willing to set up a SteemJ community on Steem where we can collaborate on the effort.

I could be wrong, but my guess is that the current universe of developers interested in Steem isn't big enough to support language- or tool-specific communities.

You may be right. We could also use the Steemit Dev community, at least in the short term - but I'm not sure if the admin & mod are still around.

Theoretically there is also the DEVLOG community.

Even though I'm not a programmer, but I'm always interested to know the development of programs that make it easier for us to publish here. Honestly, I could spend almost an hour setting the markdown for this article.
If there is a tool that makes it easier, of course I want to use it, thank you for opening my horizons about this.

Btw, Setting markdown works really well.

Screenshot_20220103-150634~2.png

Very good initiative, it is good to see that your free time is being used for productive things for the steemlinks community, I would like to use the application very soon.

And I hope that @steemchiller will give you a hand with the updates since he is one of the best programmers that steemit has.

I think it takes a professional to do programming like the way you shown here.

The nice thing about Open Source and permissionless blockchain is that people at all levels can find their own unique ways to participate.

You are right.

I have included this post in the 30th issue of Steem News Magazine For Steemit Platform | January 02, 2022.

I think java is a programming language that we need to learn, that is, not all people handle java, in relation to creating a community, the last I know is that it is justin who left this panel, well maybe I'm not enough Informed, what I think is that this panel should have a guide and this man left, so we have to wait who assumes that position, conclusion, organize the house as they say and then begin to integrate, another issue is that there are many communities here, and people are grouped into these, well, I see a lot of details to think about and analyze
I wish you a happy year

amazing, you really use your free time for productive things, hopefully what you want for the community will be achieved and we are very happy to see your initiative in building community progress . it was incredible

This post has been featured in the latest edition of Steem News...

Happy to see you produce new programming methods on your time excellent 👍

Coin Marketplace

STEEM 0.21
TRX 0.20
JST 0.034
BTC 98085.38
ETH 3350.61
USDT 1.00
SBD 3.03