pauamma: Cartooney crab wearing hot pink and acid green facemask holding drink with straw (Default)
Res facta quae tamen fingi potuit ([personal profile] pauamma) wrote in [site community profile] dw_dev2018-03-18 08:25 pm
Entry tags:

Question thread #62

It's time for another question thread!

The rules:

- You may ask any dev-related question you have in a comment. (It doesn't even need to be about Dreamwidth, although if it involves a language/library/framework/database Dreamwidth doesn't use, you will probably get answers pointing that out and suggesting a better place to ask.)
- You may also answer any question, using the guidelines given in To Answer, Or Not To Answer and in this comment thread.

enhanced Livejounal import

[personal profile] steve98052 2018-03-20 07:01 pm (UTC)(link)

I don't know how to ask this question without a really long introduction, but if you want to save some reading, skip to the final paragraph once you get the idea.

I have a Livejournal with almost 8000 entries, over 1000 pictures, and 5000 comments received. Frequently I link one entry to another when referring to things I wrote about in past messages (and sometimes I even revise past messages to link later messages).

For example:

My first impressions of <a href="http://steve98052.livejournal.com/999.html"><i>Film Title</i></a> were kind of lukewarm, but having seen it again, . . .

Those intra-journal links are a mess for importing from Livejournal to Dreamwidth, because message serial numbers (the "999" in "999.html" above, in case that's not the standard term for those numbers) aren't necessarily going to be the same on different journal hosts.

The simple answer is that the intra-journal links stay as-is, linking the original journal rather than within the new journal, but that sends readers off to Russia. Not ideal.

My thought about how to make it work was to build a tool that opens an entry, finds intra-journal links, and inserts an HTML data-link-conversion="(value)" attribute into the <a href="(URL)"> tag. Then, after an import, the tool could find the data-link-conversion attributes, and modify the URL to match the new host of the impoted journal.

Note: the data-link-conversion tag is a user-defined attribute; search data-* attribute if it's unfamiliar.

My thought is that the attribute value of the data-link-conversion attribute could be either the year-month-date-hour:minute or the year-month-date-serial of the destination journal entry, or maybe even year-month-date-hour:minute-serial for error checking.

Of course, using a message's position in the calendar breaks if an edit to a message changes its calendar position without correcting all data-link-conversion attributes that point to it, which is messy business. Best answer there is, "Don't do that!" More precisely, it's probably best to strip the data-link-conversion attributes from both source and destination journal versions once the import and link conversion is finished.

So, finally, my questions are: 1. Is this a problem that anyone else sees as a problem? 2. Does my solution outline look like a good way to re-link intra-journal links? 3. Is anyone else interested in teaming up on such a tool? 4. Where should I look for code to use as a starting point for such a tool?

SVG images

[personal profile] steve98052 2018-03-26 03:39 pm (UTC)(link)
Sometimes it's nice to be able to include a vector diagram instead of a pixel image. Would it be complicated to be able to insert vector images into a Dreamwidth journal, instead of a pixel image?
bytebuster: (Keaton-Chase)

[personal profile] bytebuster 2018-03-28 07:56 am (UTC)(link)
Is there a guideline for programmatic populating the fields within the DreamWidth's "Create Entries" page?

I'm still writing a small browser script to enable the "Repost" functionality, similar to what the LJ has.

It is a simple GreaseMonkey/TamperMonkey Javascript tool, no LJ API is used.

At the moment, I have managed to populate Subject and Entry Text, but I seem to be stuck populating "to Community" dropdown, Tags, and "Icon" fields. These fields are apparently JS-rich and heavily depend on user interaction (mouse clicks etc).

Is there a tutorial of how to fill these fields programmatically?
octorok: (Default)

[personal profile] octorok 2018-04-08 02:43 am (UTC)(link)
Hi guys! I have another issue for y'all. I've got a problem with userpics that I can't figure out on my own. Here's what's happening:



Icons either a) duplicate somehow, replacing other icons, b) load after refreshing the page 3-4 times, or c) won't load at all. Is there something wrong with my databases or mogile, I wonder?