ULOG: Scripting a Small Program to Help Writing My Shop Posts

Salam (Peace) to You All

This post is part #ulog part #programming. I considered writing it for #utopian-io as a blog, but I think it's not deep enough for them (not to mention I haven't uploaded it to GitHub.) Also the post is about me, more than it is about the code... So, here we go:

If you don't already know I run a games shop here on steemit as weekly posts, here's this week at the time of writing, and you can see the latest one resteemed by @ahmadgameslist.

FiftyWords_ScriptingASmallProgram.jpg

So,

Yesterday I felt too lazy to write my weekly Steam games shop. I said so in @opgaming discord group and talked a bit with @rainite. I casually said to him "Maybe I should write a program to ease the job for me."

I didn't mean to actually make the program. It was just a thought, but after a short while I decided to try coding it. There are two things I wanted automate creation:

  • Featured Games Section.
  • Bundled Games Section.

I haven't started working on Bundled game section yet, but I finished the featured games section.

Featured Games Section

Every week I feature 4 games @ahmadgameslist and write about them. The pretty look of it needs a combination of markdown and HTML. My goal of this program is to automate creating this markdown:

Featured Games

Featured #1
Game Maker Studio 2
Original price: $99.99

My Price: $33.99

One of the best Programs ever

Here's how it looks in markdown:

| <center><h2>Featured Games</h2></center> |
| - |
| <center>Featured #1</center> |
| [Game Maker Studio 2](https://store.steampowered.com/app/585410/GameMaker_Studio_2_Desktop/) |
| <div class="pull-left">https://steamcdn-a.akamaihd.net/steam/apps/585410/header.jpg</div><div class="pull-right"><strike>Original price: $99.99</strike><h2>My Price: $33.99</h2></div> |
| One of the best Programs ever |

Hard to edit isn't it?

I created a HTML5/Javascript application where I put the game's name, price, Steam link and description. The program automates the markdown for me. It might not be big but I felt a great sense of achievement as I wrote it? Here's how the app looks like:

screenshot.1541307076.jpg

Coding in Atom

Before yesterday I used Notepad++ for editing codes. This time I downloaded Atom code editor, because it was praised and because it can be easily integrated with Git/Github.

So I wrote the code using Atom, for the featured games section automation, here's what the code looked like:

screenshot.1541273700.jpg

To Do Next

Next I'll work on Bundled Game Section, and maybe optimize the code I wrote yesterday too. I faced many errors and fixed them without thinking of optimization.

The way I'm thinking of coding the other section is by putting the games data list in google sheets, export it a * .CSV file then automate them into Markdown.

I haven't worked CSV or Excel file before so I don't know how hard making this would be.

Time to look up tutorials


Game Maker Studio 2 image is taken from its Steam page. All other images in are screenshots taken by me.

This post was made from https://ulogs.org

H2
H3
H4
Upload from PC
Video gallery
3 columns
2 columns
1 column
7 Comments