Michael Wolf
Projects and thoughts from Cincinnati San Jose Oakland an undisclosed location in Grass Valley
Home Projects Photos Github Mastodon Nullbrook RSS
Rolling Out RSS in 2017 | How Feature Creep Rebuilt My Workflow
Last edited - 28/04/17

Seizing upon a free evening, I consulted my big list of little projects to work on. Given a big stack of new films to write up for Nullbrook, I decided that I would implement a solution to speed up the penning of new entries and an automatic distribution of the posts.

Why RSS? Well despite the fact that RSS is old and hardly shiny, I adopted it recently as an alternative to pulling down the HackerNews feed for hours and found that it would supplement my existing web content well. Even if no one would follow my RSS feed (preferring the resource-intensive, closed-source ease of Tumblr), the feed would provide an easy project and a way in which I could justify writing about archive entries without too much overhead time. Furthermore, if I ever wanted to do analysis on my writing, the XML feed would be easy enough to parse.

Doing It
I had a couple requirements setting out:

  1. Free as in beer and as in freedom
  2. Posts to a feed locally without needing internet access (no shady online services)
  3. Headless (GUI's are clunky and awful for this use case)
  4. Post to normie web (if possible?)

Maybe it was my poor web searching skills or maybe just the fact that RSS is only used by nerds, but I couldn't find anything that fit these parameters. So? I wrote my own!. "This couldn't be too difficult", I remember thinking. "It'll be like three lines." Well... then came the feature creep. As I started coding, I started realizing I wanted to flex my fledging might at scripting a sensible program. So, I stopped, deleted everything and started over. I decided to define my project a little better.

What would I want my script to look like? Well to start, what does it need? I wanted, simply, a program to create a feed and then be able to append entries to it intelligently. That could probably be a couple lines, but let's make it something I'm proud of. I listed out the needed parameters of RSS. Feed title, feed description, and feed link. Entry title, entry description, and entry link. Finally, I'd need to know the file to write and the file to append to.

Now how would I implement it? How about a simple, but familiar command structure? I sketched out something like this [PICTURE].

As I dug through the documentation of argparse, I found it was pretty easy to put all of this together. In the end, my code was like 60% argparse and 40% actually manipulating input. I think that's a pretty decent model for this simple problem.

usage: write-feed-item.py [-h] {feedgen,entry} ...

Play with some RSS stuff.

positional arguments:

{feedgen,entry} sub-command help
feedgen feedgen [-t, --title TITLE][-d, --description DESC][-o,
--output OUTPUT]
entry entry [-t, --title TITLE] [-d, --description DESC][-l,
--link LINK][-i, --input_file INPUT_FILE]

optional arguments:
-h, --help show this help message and exit

Getting Useful

Now, I found this little script to be pretty useful and energizing, but I set out to see if I could make it rather useful. Two new ideas came up. Could I use this to post to Tumblr? Could input my blog post as a parameter and have the rss generate through parsing the HTML? Hmmm well let's see.

  1. Tumblr Integration:
    "Hi Tumblr, do you allow for posting via RSS?"
    "...well, we used to..."
    "Oh, fantastic. A platform that manages to eliminate useful features rather than create them. You really are owned by Yahoo!"

    Indeed it looks like Tumblr removed a useful feature along with controls over blog protections in 2011. Excellent, a great justification for the development of this self-written blogging platform. So that's a hurdle. But Tumblr is a sensible company, they have an API, right? Yeah, they do! And it isn't that awful. All I had to do was register my application and add some parameters to each of my requests. Now the fact that they don't support uploading images from FTP makes this process a little more cumbersome, but no worry. Simply providing the path of the file worked. Since implementing this script, I have saved myself a ton of menial clicks while keeping up the quality of the blog.

  2. Auto RSS Writer:
    I decided against developing an auto RSS/entry writer due to the control I desired over the layout of the content. Despite choosing a pretty standard format for entries on Nullbrook, it seemed manually writing these pages and calling the rss generator script would be easy enough to make posting updates trivial.

This is nice and helpful, but what impacted my workflow most from this project was the implementation of source control. I'm used to using git for projects both at work and for personal projects, however up to this point my websites had been entirely housed in my web server's html directory. For better or worse, during the setup phase of this RSS + Tumblr post project, I started a privately hosted git repo that allowed me to commit and publish content and script changes from my PCs without rsyncing! Lt took me a couple days of miscontiguration before I finally got the repo/flow to a usable place, but it has made a huge impact on ease of publishing. I still move big files via USB sticks, but that's out of respect for my roommates. I do hope that these scripts coupled with source control will help reduce the complexity of my web endeavors.

Limitations and Next Steps
While I achieved many of the productivity advancements I was seeking, I have come across some issues that I may sort out.

This project, despite frustrations and a never-ending flow of half-baked ideas, has been extremely helpful. I hope it serves as a sound foundation for more technically challenging projects to come!

Next up: Unlearning Bad QWERTY Habits (via Colemak)