A Microblog in Plain HTML

Avatar Likho

Hobby writer and internet wanderer. I like writing fanfiction. Sometimes, I branch out to random subjects.

If you like this page, check out the script that generates it for yourself.

12 posts

index webring json (webring)

Tags

#programming(12) #neocities(3) #surf(17) #politics(6) #microfic(1) #__pages__(4) #test(6) #metalocalypse(7) #wallstreetsilver(5) #fanfic(9) #original-work(2) #ainokusabi(6) #invidious(8) #fandom(8) #fediverse(5) #monnaielibre(1)

Pages

[no pages]

23 Aug 09 (#56)

#programming

Pushed a new commit to the microblog generator. Previously, it required pycurl (to upload to neocities) and urllib.request (to fetch json). Now it just has pycurl to do both.

In the process, I was reading

https://pycurl.io/docs/latest/quickstart.html#examining-response-headers

But instead of writing a function to discern encoding, this post following the same variable names as the documented example. I basically invoked buffer.getvalue() to satisfy a parameter for json.loads() and save effort.

Wonder if that breaks in other cases, but it hasn't yet for me. (Not merging the branch to master yet either.)

23 Jul 23 (#55)

#neocities #programming

I read Qualities of Good Software by sundee

https://sundee.neocities.org/qualitysoftware/index.html

https://neocities.org/site/sundee?event_id=2771917

One thing this page reminds me of is that it's easier to get feedback on fanfiction than it is to get feedback on a program. So what's good for user experience isn't as obvious as what's good in writing.

There are many points I agree on. A really good example is how Photoshop (and GIMP) toolbox icons are grey when it would be much easier to pick tools if they had distinct colors. Though I think if followed it 100% e.g "As many options as possible", my code is going to get real unreadable and ugly; I write lots of if-else statements for configuration.

23 May 29 (#50)

#microfic #programming

"I got an idea to package my microblog generator on PyPi."

https://pypi.org/

I said that to my friend over an instant messenger.

The chat client I used had event notifications, and so the bottom of the terminal reported he was typing a response. But he took an extra minute of contemplation before he entered.

"lol

"how would you like 200 issues on your repository?

"from confused people who never read your instructions or documentation"

23 May 08 (#48)

#__pages__ #programming

title: Likho's microblog.py

https://likho.neocities.org/pages/likhos-microblog-py.html

I wrote about the microblog generation script I've been writing on-and-off. I hope someone finds it useful.

23 Apr 30 (#47)

#test #programming

I added a new feature to the microblog which was to mimic followers/following lists. But I called it a webring.

https://likho.neocities.org/microblog/webring.html

23 Mar 07 (#40)

#programming #test

New update for microblog.py: image thumbnails.

For the entire time I've been posting screenshots of cartoons. Usually, the file sizes are small as is. For photographs and video game screenshots, however, posting too many images on one page will impact loading times (not good). So now, the mini-galleries in each post can now support paths to thumbnails.

microblog.py remains as a page generator and doesn't manage images, so I use another program to resize. Example:

https://imagemagick.org/Usage/resize/#percent

23 Jan 07 (#33)

#programming

Going to test a branch of the microblog generator for a week or two before merging to master. (New feature: a configuration file.)

22 Oct 13 (#27)

#programming

I've been quietly working on my microblog page generator. The most recent feature I have in the works is configuration by .toml file.

https://toml.io/en/

The flexibility of a configuration file gave me the idea for syndication to emulate following another users.

In the process, I noticed it isn't easy to tell what order the list of posts are just by reading the code even though the code is working as intended.

For instance, is the timeline currently sorted latest to oldest or was it reversed for the ease of putting the earliest post at page 0?

https://notabug.org/likho/microblog.py/src/toml/microblog.py#L305

(The timeline is reversed in the pagination function and stays so after writepage().)

Got the idea to define a class that explicitly returns a subset of the timeline in an expected order. Don't know if I want to write it or leave things as is.

22 Aug 02 (#20)

#programming python

https://notabug.org/likho/microblog.py

I merged the tagline branch to master. The tagline branch will be deleted later.

22 Jul 20 (#19)

#programming curl python pycurl

I decided to write a script to make page updates easier. I don't use cURL often, so I closely followed the example on neocities API documentation. It worked, but when I tried scripting it, I kept getting "file not found errors" such as:

cURL Error 26: Failed to open/read local data from file/application

Explanation: https://github.com/curl/curl/blob/master/include/curl/curl.h#L527

I was uploading files like:

curl -F "/apitest/tags/latest.html=@./tags/test/latest.html" "http‎s://USER:PASS@neocities.org/api/upload"

The proper way to upload files in other directories is:

curl -F "/apitest/tags/latest.html=@tags/test/latest.html" "http‎s://USER:PASS@neocities.org/api/upload"

Most examples of using curl don't involve files in other directories.

What a funny thing to get stuck on.

22 Jul 17 (#17)

#programming microblog.py

The microblog is a fun experiment. Some flaws to using it for Neocities are becoming apparent however.

Every time I tag a post or update any information on the sidebar, I have to update every page. Currently, I only have an index and one page per tag. If this was real social media and not just a page generator, it would be easy to accrue a few hundred posts. With 20 posts per page, (500/20) = at least 25 pages must be generated per update.

Generating 25 pages is still lighter than running a database and a server application; instead of execution per site visit (cgi), I run page generation when I write new entries. Officially, I think I am being more economical doing things this way. But I can't just drag and drop 25 pages into my browser every time I want to update my microblog.

I should automate uploads. But when I update only the sidebar for my older pages, Neocities is going to automatically post a status with screenshots. The "big", primary screenshot can turn out to be some random page, not my latest status.

22 Jun 26 (#15)

#programming python

https://notabug.org/likho/microblog.py

I recently added two new features to this microblog: pagination and taglines. This is also the first post about the script that generates these pages.

When I first uploaded this (the page) microblog, microblog.py was around 100 lines of code (LOC), and I mainly wrote it for myself. With pagination and taglines, the LOC is 300. As of this post, the master branch is the older version and not reflective of this page. So the 'tagline' branch should be checked out like this:

git checkout tagline

To use microblog.py, the user writes to a plain text file. The script will apply content to an html template. The README file has extra information, and an example can be found in the Makefile.

microblog.py