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_dev2017-11-16 11:35 pm
Entry tags:

Question thread #58

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.
bytebuster: (StarTrek-Spock1-Approach)

[personal profile] bytebuster 2017-11-17 04:20 am (UTC)(link)
Is there a way to retrieve cut-tag end-markers in an HTML-rendered post?

Background. I'm writing a small browser script to enable the "Repost" functionality, similar to what the LJ has.
Since this uses no LJ API, I'm solely relying on rendered HTML pages for DW posts.

Problem. I'm having trouble detecting cut-tag markers, when my script is run on the post page (it works fine in journal entries page). Here's the difference:

In Journal entries page it looks like:
<div class="entry-content">
  <!-- (pre-cut body) -->
  <span class="cuttag_container">
    <!-- (expand button) -->
    <div style="display: none;" id="div-cuttag_bytebuster_9782148_1" aria-live="assertive">
      <!-- (here goes the cut body if expanded) -->
    </div>
  </span>
  <!-- (post-cut body) -->
</div>
On a page for specific entry:
<div class="entry-content">
  <!-- (pre-cut body) -->
  <a name="cutid1">
  <!-- (here goes the cut body) -->
  <!-- (post-cut body) -->
</div>
Most obviously, in 2nd case I can't determine where the cut ends.

Question. Is there any way to work this around? What if the DW engine were placed some named anchor element at the cut end?
Edited 2017-11-17 04:24 (UTC)
momijizukamori: Grey tabby cat with paws on keyboard and mouse. The text reads 'code cat is on the job', lolcats-style (CODE CAT)

[personal profile] momijizukamori 2017-11-18 05:12 am (UTC)(link)
I don't think it'd be a huge change - it'd probably take more time just to track down where that bit is generated from.

Which I may end up doing anyway because this thread made me go 'oh, posts pulled via the API should probably also contain information about where cut start and end too'
octorok: (Default)

[personal profile] octorok 2017-12-01 01:19 am (UTC)(link)
Heya! I'm new here and have a fresh install of DW up and going on Linode. I've run make_system.pl once already to create the account and assigned it a random password, but now I want to change it. This is what I get when I try to run make_system.pl a second time:



And as a result I cannot log into the system account on the site at all with either password. I checked every dw_dev community I could find and consulted Google and couldn't find any answers. I hope someone here can help me because I've been trying to figure this out for two days straight. I'm relatively new to dev work so it's probably something really silly/minor but I cannot for the life of me figure it out on my own. Help? :(
Edited (fixed typo) 2017-12-01 01:44 (UTC)
octorok: (Default)

[personal profile] octorok 2017-12-01 04:19 am (UTC)(link)
Thank you for the welcome, and for replying so quickly! And thanks for correcting me on my rookie mistake. I ran make_system.pl again (not as root) and did as you said, and still can't login. I copied and pasted it and everything and still no go.
octorok: (Default)

[personal profile] octorok 2017-12-02 01:33 am (UTC)(link)
Here we go. I went ahead and changed it to 'password'.

octorok: (Default)

[personal profile] octorok 2017-12-02 04:24 am (UTC)(link)
Oh no, I'm sorry, I forgot to mention that. Yeah, I tried logging in and it still tells me the password is incorrect.
octorok: (Default)

[personal profile] octorok 2017-12-08 02:22 am (UTC)(link)
Sorry for the delay! Life is a hell of a thing. Anyway, here's what I get:

octorok: (Default)

[personal profile] octorok 2017-12-08 04:28 am (UTC)(link)
I do not! Should I go set that up now?
octorok: (Default)

[personal profile] octorok 2017-12-08 04:55 am (UTC)(link)
Unfortunately, I only have basic knowledge of git. I'm a quick learner though! :)
octorok: (Default)

[personal profile] octorok 2017-12-11 02:26 am (UTC)(link)
I went ahead and just disabled all of my plugins, reloaded chrome, tried to log in and still no go. :(
octorok: (Default)

[personal profile] octorok 2017-12-11 04:24 am (UTC)(link)
That didn't seem to work either. Same thing, says it's wrong password.
octorok: (Default)

[personal profile] octorok 2017-12-15 02:21 am (UTC)(link)
I got to #4 and get this:



I'm not really sure what to do here.
octorok: (Default)

[personal profile] octorok 2017-12-15 03:16 am (UTC)(link)
Okie dokie! Did all of that, here's what I got :)

octorok: (Default)

[personal profile] octorok 2017-12-16 12:59 am (UTC)(link)
I'm learning quite a bit here, thank you for being patient with me. :) Here's the output:



edit: I FORGOT TO WHITE OUT MY PASSWORD IN THE LAST COMMENT!! Eek. Will change it later, lol.
octorok: (Default)

[personal profile] octorok 2017-12-16 05:49 am (UTC)(link)
I'm using Ubuntu 17.10 on Linode. Second, here's the output of perl -v:



The third step doesn't look like it did anything, sadly.

octorok: (Default)

[personal profile] octorok 2017-12-17 03:15 am (UTC)(link)
Okay cool! Here's the output after following your steps:

octorok: (Default)

[personal profile] octorok 2017-12-18 12:07 am (UTC)(link)
Interesting. Here's the output this time:

octorok: (Default)

[personal profile] octorok 2017-12-18 02:15 am (UTC)(link)
Here we go:

octorok: (Default)

[personal profile] octorok 2017-12-18 02:39 am (UTC)(link)
It was already there. I accidentally hit a key while searching for it is all. :)
octorok: (Default)

[personal profile] octorok 2017-12-18 07:50 am (UTC)(link)
Hey! I think you may have found the problem? I created a new disk and installed 16.04 on it and am able to login! So maybe that was the issue? Either way thank you so much for your help!