Imagebot setup.py and Installation

I developed this scraper about 10 years ago. Since then, a lot of things must have changed. Going through the file, ‘setup.py’, I analyzed the code in there. There are plenty of actions in the file. I need to revisit those, and, probably need to look up documentation related to the functions/python concepts I have used in the file.

I chose to install the package.

pip3 install imagebot-1.2.1.tar.gz

This command emitted an error, ‘externally-managed-environment’. I tried another approach.

pip3 install imagebot

This command emitted the same error. Probably, I need to find out something related to Mac python environment, virtual environment, etc.

Prompt to Generate a Wiki Based Document App

Make a browser based application to edit documents. The document is like a wiki. The editor should be there to edit text. Save and new buttons should be there. When a word or words in the document are selected, it should open a new empty editor, to edit a new part for the document. With the selected word or words shown as a link in the previous part. When save button is clicked, all the parts of the document should be saved in the order in which they are added.

Result

This prompt worked. It has generated an HTML file based app. I modified the prompt to save text in a text file. Perhaps, AI/ChatGPT cannot handle more complex recursion.

Prompt for a Wiki Based Document Editor App

Make an application based on a browser. The app is to edit text, it can have multiple documents open. The editor should have a vertical scrollbar and a word wrap feature. Font size should be configurable. When one opens a new document, the app should ask for a title and this title should be displayed in the title bar of the window. The app is based on the concept of a wiki.

In the editor, when one selects a word or a group of words, there should be a button to open a new part of the document, the app should save the current text in the editor, in the browser storage. Then, the app should display an empty editor, with the title which should be the selected text in the previous part, this title should be displayed in the title bar. The user can then edit this part. Thus, now, there are 2 parts of the document. The first part should display a link where the selected text was, link should bring up the second part when clicked.

The second part can be edited. Again, if one selects a word or a group of words, a new part should be added to the document as described above.

A new document can be started as well, while the current document is being edited. There should be a button for a new document and there should be one for a new part, the new part logic is as described above. The document(s) and part(s) should be auto-saved in the browser, every 30 seconds.

A navigation must be provided to navigate into the parts and out of them to reach the root part of the document. A home button should be present to navigate straight to the root part.

Finally, a save as button should be present, to save the document or more than one of them. They all should be saved one by one, by showing user the save as dialog, with the default save name as the title of the root part of the document. The parts of the document should be stored in the order in which they were added to the document. A single document, saved as a text file, should have all the parts, in the order in which they were added.

Result

“Something went wrong”.

WordPress API

Today, I searched for the WordPress API and found out that there was one. It seems to me that it is quite useful, one can get ‘json’ of posts, tags, etc., I guess that ‘admin’ functionality is also possible using the API.

Tkinter

import tkinter as tk
root = tk.Tk()
label = tk.Label(root, text="Hello", font="Arial")
label.pack(padx=100, pady=100)
root.mainloop()

I am new to tkinter Python library. I watched a video, https://youtu.be/ibf5cx221hk?si=9vhyS2KEzq806KGV, and, wrote some starter code.

WordPress Application for Windows

I generated a WordPress application for Windows, using ChatGPT. Before using it, I decided to go through the code to see if it was okay. I think, one must consider the possibility of malicious code, before using the code generated by a tool which may be referencing some public code site. I checked the code for any security related hints, I also checked the logic.

I did not see any security related risks, I am new to this, so, I might be wrong. Otherwise, the application seems to contain all the logic that I wanted, as instructed in the prompt.

ChatGPT Generated Application for WordPress

ChatGPT has generated an application per prompt, the prompt is part of the previous post. ChatGPT has instructed me to run a batch file.

Prompt to Generate a WordPress publishing Application for Windows

I think, today, it was the time, to stop making small prompts to edit images and it was the time, to generate a full blow tool, using a prompt. I use ChatGPT. So, I wrote up a complete prompt to generate an application for Windows, to publish WordPress posts. The prompt covers UI, authentication, publishing. It needs to be seen whether ChatGPT will generate a functioning application.

Prompt

Design an application for Windows. It is to be used for publishing posts to WordPress blog. The application must have a UI and a window. The application will have a toolbar with buttons for selecting a blog, which would be one of the following: amol9.blog, code9.blog, game9.blog and amol9.io. The buttons should be on top, in the toolbar, the buttons should be on left. On right hand side of the toolbar, there must be a button for publishing the post, the button should change color upon publishing successfully.

The necessary permissions, or login, or tokens should be obtained by the application to post on the WordPress blog. If it is WordPress password, then it should be stored in a file in “user\documents\wpapp” folder. If it is a token, it should be stored in the same location. The application should obtain the necessary permissions when it runs. If permissions have been already obtained, it should not ask again.

The application UI must have two text boxes, one, on the top, for post title, which would be one line and, second, below it, for editing the post text. Inside the post edit section, facility to add code should be there. To the left of the publish button, there must be an image button, to add an image to the post, this image must come before the post text. The width of the image should be minimum of 1000 px in width, if the image has less width than that, then, it should be padded on both sides. The image should be center aligned in the post.

The categories and tags should be fetched from the WordPress blog site. Two buttons, below the image and publish buttons, should provide a facility to select/add new categories and tags. These should be 2 different pop up windows.

All the content created should be stored locally, and upon successful publishing, it should be deleted. A button to the left of image button, named view blog should open a default browser window with the current blog url, to view the post.

Installed ImageMagick on Windows

It is needed to pad images for the blog, so installed it via the ‘choco’ package manager for Windows.

Virtual Machines

Virtual machines are an interesting area to investigate in the field of computer technology. It is a pursuit worthy of doing, to understand how VM’s work and how they are built.

I have started with this particular YouTube video: https://youtu.be/BNXP0w4Ppto?si=imnVqQVmkuttVmhj

A lot of ideas have come to my mind as I watch this video. First, the answer to a basic question, how does one make an OS virtual? I think, that, we can load the devices, like, CD drive, HDD, etc., as a file and execute their content as instructions for the CPU. There may be some processing required here, that would form a lesson in VM making. Next, the question of a display comes in, how does one show the OS in a window? The answer, I think, might be to somehow trap an interrupt or more than one of them to grab the screen data, then, render it in a buffer and then resize it before showing it in a window. The video gave a start to an idea of how one manages the RAM for a VM, it may be a vector of 32 bit data items.