On pipelink walls

The problem
I want to display a series of links in my homenode, pointing to all I’ve done here, either in alphabetical or random order.
The limitation
I’m lazy
The solution
Write code
You will need
Python. This was written with 3.x (c’mon, this is easy to install and I promise you don’t need anything else by default)
A proper Node Backup. Put all your html files in a single directory.
The result
A pretty wall like the one below

000: [???][???][???][???][???][???][???][???][???][???]
010: [???][???][???][???][???][???][???][???][???][???]
020: [???][???][???][???][???][???][???][???][???][???]
030: [???][???][???][???][???][???][???][???][???][???]
040: [???][???][???][???][???][???][???][???][???][???]
050: [???][???][???][???][???][???][???][???][???][???]
060: [???][???][???][???][???][???][???][???][???][???]
070: [???][???][???][???][???][???][???][???][???][???]
080: [???][???][???][???][???][???][???][???][???][???]
090: [???][???][???][???][???][???][???][???][???][???]
100: [???][???][???][???][???][???][???][???][???][???]
110: [???][???][???][???][???][???][???][???][???][???]
120: [???][???][???][???][???][???][???][???][???][???]
130: [???][???][???][???][???][???][???][???][???][???]
140: [???][???][???][???][???][???][???][???][???][???]
150: [???]

Limitations
The links are made based on the filenames of the html files. As such, some special characters (like semicolons or commas) might not appear in the final product. These will have to be cleaned by hand... if you can be bothered.

1 How-to

  1. Perform a Node Backup and put all your .html files in a single directory
  2. Look below for the line that says path = 'REDACTED' and put the path to the directory where you have all the files between the quote marks.
  3. Look a bit further for the line that says username = 'YOUR-NAME-HERE' and put your username between the quote marks
  4. By default, you don’t need to do anything else. Save this in a text document called e2wall.pyTell python to execute this script and you’ll end up with a small file called e2wall.txt. Copy and paste its contents in your homenode or whenever.

2 Advanced usage

You may change these to further customize the wall. Remember to put strings of characters between single or double quotes.

  • ignored is the list of nodetypes that the script will ignore, of course
  • character is the actual list of characters that will get displayed. Default is three question marks between square brackets, but you can change that easily
  • sep is what will separate one link from another. If you want to leave it blank, put ''
  • width is how many links per line you’ll have. Default is 10
  • chaos is just a variable controlling whether the links are shuffled. If set to False they will be displayed alphabetically.

3 Advanced advanced usage

Fine, you can go to the last few lines to further customize the line start, the links and whatnot. Look for the lines called f.write(). If you’re not smart enough to figure this out on your own, you shouldn’t be doing it.

4 Result

Copy and paste the results in your homenode, or a daylog, or wherever. Note that if you use very basic editors (Like the regular notepad) you might not see the line breaks. Please upgrade your software.

Send me any and all questions and suggestions. I may improve this toy in the future, watch this space.

5 The code

import os
#import markdown  # <-- could be useful later on for more powerful conversions
import re
import random

# original functions do not steal
def trim_extension(filename):
    '''
    Trims the html extension.
    '''
    return filename[:-5]

def get_title_and_type(filename):
    '''
    Returns (approximate) title and type of node.

    Assumes the filename is formatted like so:

        This is my node title (nodetype)

    If the filename cannot be parsed, it will return the strings
    "NONETYPE" and "unparseable"

    Parameters
    ----------
    filename : Path
         Path to a single file without extension.

    Returns
    -------
    TITLE
        String of the node title.
    TYPE
        String of the node type.

    '''
    regex = r"^(.+) \((.+)\)$"
    match = re.search(regex, filename)
    if match:
        return match.group(1), match.group(2)
    else:
        return "NONETYPE", "unparseable"

# -------------------------------------------------------------------------
# Most customization happens here!
# Edit these!

# Your path to the directory where all your html files live.
# This tool assumes the directory contains only your html 
# files as they are given after performing a node backup.

# Also, the filename limitations means your final links
# won't have semicolons, commas or other special characters.
# You might want to clear those in the final product.

# If you're on Windows, the double \\ are needed
path = 'REDACTED'

# Your username for inserting on the pipelinks
username = 'YOUR-NAME-HERE'

# If you want to filter out certain nodetypes, put them here
ignored = ['draft', 'log']

# The character(s) that will adorn the wall
character = '&#91;???&#93;'

# How do you want to separate these links? just write '' if you want no separation
sep = '&mdash;'

# How many of the above characters per line?
width = 10

# Want a randomized list?
chaos = True

# Most customization ends here.
# -------------------------------------------------------------------------

# Pay no attention to the man behind the curtain
final_titles = []
final_types = []
for root, dirs, files in os.walk(path):
    for filename in files:
        name = trim_extension(filename)
        title, nodetype = get_title_and_type(name)
        if nodetype not in ignored:
            final_titles.append(title)
            final_types.append(nodetype)

order = [i for i in range(len(final_titles))]
if chaos:
    random.shuffle(order)

# Ok maybe you can play around here

# Make sure you don't have a file called 'e2wall.txt', this will overwrite it.
with open('e2wall.txt','w+') as f:
    c = 0
    for n in order:
        # If you know how, you can alter this to further customize your wall
        if c % width == 0:
            # These go at the start of a line.
            f.write(f'{c:03}' + ': ')
        # General line. You can also access nodetypes with its appropriate list
        f.write('[%s[by %s]|%s]'%(final_titles[n], username, character))
        if c % width == width - 1:
            f.write('<br>\n') # Do not use regular notepad, use a real text editor.
        else:
            f.write(sep)
        c += 1

🜞⚔️⚔️⚔️⚔️⚔️⚔️⚔️⚔️⚔️

This is more of a chess ramble than it is any other form of log. It's still a daylog though. I've been trying to stuff all my user-subjective rambles in daylogs and keep my non-hidden posts factual, but poetry is difficult not to write. As is fiction. I was going to write Portents of Matrimony Ruin as a way to fill the Iron Noder challenge, but I'm worried IN might make me rush the writing too much. I would prefer it to progress at a natural, organic pace.

I woke up a half-hour late today. I must have been in the deepest layer of sleep when my alarm went off. Usually I wake up easily, but today it was like someone dropped a bowling ball on my stomach. I told my alarm to wake me in half an hour and went right back to sleep. That's one of the problems/benefits of having an Amazon Echo, I suppose — being able to dismiss and set alarms with your voice allows you to shift your alarm forward half an hour while much less alert/awake/lucid than you would have to be to do it on an alarm clock or a phone.

I drank a couple pots of coffee and spent my morning down the E2 rabbit hole. The longer I'm on this website the more time I spend on it. I don't know how I didn't discover E2 sooner. It's probably better that I didn't, though. Anyway, I spent a couple of hours on school stuff. It's for one of my "garbage" courses, I just need the stupid credit. It's considered required but it's legitimately one credit. Anyway, I cleaned a bit, but not much. I also worked on my chess-variant project a small amount, I'm stuck at trying to instantiate the chessboard, which is legitimately step one in a very long list of steps. I don't want to use Python's chess library because it looks non-adaptable, so I'm working from scratch. Right now it's just javascript. Andycyca's recent post reminded me to start rubber-duck programming again, which is a habit I've fallen out of. Which is odd, because I still keep the furby at my desk. Maybe it'll help. Maybe it won't, but it can't hurt to try.

I am an intermediate chess player. I am not good at chess. My chess rating has plateaued at 1200-1400 — sometimes it dips a little lower or a little higher, but I can't seem to get it to stay higher, which I don't like. I played an absolutely sublime chess game yesterday. Made several dumb blunders and still turned the game around brilliantly and won. The guy challenged me to a rematch, and I accepted, and he absolutely pummelled me. Took both my knights and my queen and I only had a knight and a pawn of his. I made three blunders. Two would have been okay, but three? I resigned before I could embarrass myself further. So I suppose we're even. I didn't bother challenging him to a rematch. I've been trying to get my rating up solely by playing more games more often, as well as studying chess puzzles. My goal has been to play six chess games a day; whether against a chess-bot or against a person. Six games seems achieveable, only an hour or less a day. I can set aside an hour a day to play chess, I don't have much to do since I lost my job by way of the pandemic. I didn't manage to get my six games in today, only three. It's too late in the day by now for me to do any form whatsoever of critical thinking.

I've been trying to really, really get my coordinates down. I want to be able to visualize games in my head solely by reading an annotated game. It's a lot easier from white's perspective than it is from black's perspective, just count from left to right and up from the bottom. Right to left and top-down is more confusing and difficult. Once I get them down, though, I'll be able to analyze me games a lot better, as well as visualize the board better.

I came across this writeup today and the guy who wrote it claimed that in 12 months I could get to the point in which I can play with a blindfold. That sounds sick as hell, being able to play with a blindfold. And in as little as twelve months? If I can make progress at such a rate, I'll be a tournament champion in no time. He really seemed like he knew his shit, too. The only downside was that he says I absolutely need a piece of software called Chessmaster 6000, which is evidently from the 90s. I reckon the graphics are a bit dated but the engine is good. It probably doesn't compare to today's engines, but I'm guessing it still plays at a grandmaster level. I could get it on ebay for 5 bucks, but I don't want to spend the money, so I scoured the internet for a free download that didn't look particularly sketchy. The software's been out for 30 years and isn't sold new anymore, I highly doubt the company that made it gives a damn if I download it semi-legally. 

Anyway, I found a free download that didn't look particularly sketchy, downloaded it, virus-scanned the .exe file. It all checked out, so I ran the file and it opened a bunch of windows that I couldn't close that asked me things such as "how many people are in your household?" "How much do you earn in a year?" "Are you over 65?" "Do you qualify for xyz insurance policy?". It also installed a bunch of applications that I didn't ask for onto my system. I killed it all from the task manager and uninstalled the applications from my system. I'll have to do a virus scan tonight and hope I don't have anything malicious on my system. I found another free download and this one seems promising. I haven't opened the zip file yet but I have my fingers crossed that it's actually what it claims to be.

Sigh. Here's to another day that I'll never get back.

Log in or register to write something here or to contact authors.