Forums

RS-Linkify Thread is sticky

Quick find code: 261-262-33-65181208

Lil Indecent

Lil Indecent

Posts: 447 Silver Posts by user Forum Profile RuneMetrics Profile
Message to Morgan and anyone else who is interested in quoting a jmod post from a locked thread.

Finding the correct Quote ID is a process of elimination and not guaranteed as you'll see in the following two posts :)

Testing out a method I came up with, first the result from an unquotable post...

Mod Shauny said :

Hey all,

Welcome to the newly created Combat Council section.

We often found that discussions related to Combat would get lost and end up on places spread out throughout Social Media, so with the creation of this section we're hoping to bring it all together in one place.

Feel free to check out Mod Ramen's post on Combat Feedback and Issues to get you started, or if you wish create your own post to generate discussion on that topic.

We hope you enjoy this new addition, and it's one the Combat Council will be watching each day! :)
^Yay, It worked! :)

The basic structure of quotes...

[qu ote id=
26 1-2 6 2-3 3-65181208
-
10723
-
340569722
]RS Linkify[/quote]

Key:
QFC
post#
Quote ID



The limitations...

Locked Jmod posts don't contain post# and Quote ID. This makes quoting them very difficult. However all Quote IDs are chronological and are incremented by 1. This is easily proven when we look at quote ID's from double posts or when 2 different posts are made at close to the same time.

So in theory if a quote ID is missing, looking at posts made (on any threads) around the same time means we can work backwards or forwards adding or reducing the quote ID by increments of 1 until will find it.

To verify it's been found a preview of the quote must be made and the "original message details unavailable" must not be present (see image in last post).

The beauty of this method is its simplicity (see below)....

12-Mar-2017 13:59:05 - Last edited on 12-Mar-2017 15:13:00 by Lil Indecent

Lil Indecent

Lil Indecent

Posts: 447 Silver Posts by user Forum Profile RuneMetrics Profile
Here's how it works...


• Get the time and date from the locked post to be quoted.

• Get the QFC of the thread and the post position (0-999999... zero is 1st post, 9 is 10th post)

• Make a copy of the text.

• Use Google's advanced search to search runescape.com for any pages that contain the date and the hour the post was made. See 1st pic in the next post.

• Find a match to the nearest minute, but not an exact match else we have the same post and that's not helpful.

• If the match is > than the original time of the post and the match is not a locked jmod post, reverse loop the quote id until the result does not contain "original message details unavailable"

• If the match is < than the original time of post and the match is not a locked jmod post, loop the quote id until the result does not contain "original message details unavailable"

• A limit is set on the loop based on the duration between the original post and the nearest match found. Eg: 10 sec difference small loop, 1 hour difference longer loop.

• Use ajax to emulate a preview of quotes (2000 char limit applies) using the ids from the loop (this means you must be logged in for this to work else it can't be cross referenced)

• If "original message details unavailable" is not found then yay RS Linkify cracked it. Now build a quote link using the original qfc and tack on the post position + the number from where the loop break occurred.

• Insert the copied text between the newly formed quote tags.

• Since the original thread was locked no text area exists so the only option is to copy the newly made quote to the clipboard.

• If a nearest match never found anything other than "original message details" then give up.

• Feedback needs to be given to the user because without a textarea there will be no indication of success or fail.


Wow that was a convoluted method to get that done. The steps I used are not really viable though. Maybe some steps can be refined but I'm not sure if that will help.

12-Mar-2017 13:59:22 - Last edited on 12-Mar-2017 15:38:47 by Lil Indecent

Lil Indecent

Lil Indecent

Posts: 447 Silver Posts by user Forum Profile RuneMetrics Profile
Some issues are the time it takes, the example I used could take a few seconds, so a lil spinning icon thingy needs to be displayed somewhere.

But a bigger issue for me is cross domain stuff, meaning RS Linkify needs to query google and needs extra permissions to do that. That's not something I'm comfortable with as currently RS Linkify is sandboxed and can't do anything outside of RSOF. I really want to keep things the way they are, I need to look into this some more as I'm not familiar with search APIs.

Why use google? Because we can't search by specific time periods on the RSOF.

Another issue is it simply may not work in all cases, I feel there already enough stuff that doesn't work as well as it could in RSOF and I don't want to add to that.

Also this is a lot of work for something that may not get much use, I haven't even begun to think about text selection quoting and that must be done since jmod quotes can exceed 2000 character limit.

Quotes over 2000 characters will need to be truncated.

Not all forums pages are indexed by google, HLF is a good example of that. This might create bigger holes and require more iterations to find a nearest match.

There will no doubt be other issues too, I haven't written all the code as yet. For example I didn't run a loop with an ajax preview (I just copy/pasted a string and hit preview), who knows what I'll find when I try that.

I haven't mentioned some other things, like verify that the nearest match is not a jmod post, there is quite a bit more going on, I have only outlined the basics.


Pic showing google search with nearest match by date/time

HTTP://i.imgur.com/EcFTFhW.png Google found a post made 10 min after Mod Shauny's. That means their quote IDs will be close-ish. By going to the thread in google result and using that post's quote ID as a starting point, is how I found the final quote ID.


The process of elimination using the post preview. Notice the ascending Quote IDs.
HTTP://i.imgur.com/ycQW5J7.png

12-Mar-2017 14:11:38 - Last edited on 12-Mar-2017 15:48:13 by Lil Indecent

Lil Indecent

Lil Indecent

Posts: 447 Silver Posts by user Forum Profile RuneMetrics Profile
Hiya Erehk :)

Its hard to know where to start with this. I think firstly we need to determine if your browser is displaying the correct time.

Its very easy, just follow these simple steps...

• Copy this gold text:
new Date();


• Press [CTRL] + [SHIFT] + J

• Press [CTRL] + V and hit [ENTER]


You should see something like this...
http://i.imgur.com/lMtQ5mE.png

We need to know if the time displayed in the console is correct.

I'm going to assume the time displayed in your console is correct and it maybe just that RS Linkify hasn't got the got the updated time from your browser yet, but it should happen after an hour has passed since daylight savings has changed.

If there is still a problem by the time you read this please let me know and I'll look deeper into it. I'll probably have more questions to ask too. I'm hoping this is only an issue for the first hour after the time change.

12-Mar-2017 22:45:39 - Last edited on 12-Mar-2017 22:57:26 by Lil Indecent

Morgan

Morgan

Posts: 36,054 Sapphire Posts by user Forum Profile RuneMetrics Profile
Indsy,
Thank you very much for looking into it. Like we talked about yesterday in PM, I appreciate the work you've put into it.

I don't doubt your capabilities for a second, and I know this is on Jagex. There's literally no reason for locked and pinned JMod posts to not contain post number and Quote ID. If anything, it feels like an oversight. Which is why, after reading your explanation, I can understand why you don't want to implement this. Hell, now I don't even want it anymore - seems like it would require a great deal of effort for something that might or might not work and won't be used as often.

So thank you, again, for trying ­<3

Amaethwr said :
"a lazy coder is a good coder" and that he cuts corners wherever possible, and I was wondering what your stance on the matter is?
Not Indsy, but... I agree with this stance, however , it is not something I would tell people that are just starting because there is a high chance that it will be misunderstood or taken out of context. In programming, you want to write the least amount of code required to do a task whilst maintaining readability, and to make it as reusable as possible - or at least that's what he meant by that. " Write code for humans, not machines. " Readability is important, and shouldn't be sacrificed for the sake of laziness.

On top of that, there are certain concepts that must be learnt first before you can make your code highly reusable and "be lazy", and without knowing those concepts, telling people to cut corners and to be lazy might result in errors and might even be counterproductive.

In short, that is not something that I would've told people on their very first programming class :P

13-Mar-2017 11:00:12 - Last edited on 13-Mar-2017 11:15:36 by Morgan

Lil Indecent

Lil Indecent

Posts: 447 Silver Posts by user Forum Profile RuneMetrics Profile
Hiya Morgypie :)

That was a huge read I put you though. There are some things I'll end up using from all this, such as giving us the ability to quote non jmod posts from locked threads. I can do that without all the rigmarole that's needed for jmod posts.

I could actually be lazy and cut corners and push out an update tomorrow that allows us to quote jmods from locked threads (with a degree of success) and most people wouldn't know how sloppy it is.

Okay that was a little cheeky but I couldn't resist. I wont compromise my standards for anyone, rather not have it at all :)

Anyway, I might still keep fiddling around with the un-quotable jmod posts and hopefully keep improving on it. But I'm going to write it as a stand alone script separate form RS Linkify. If I get it to a standard I'm happy with it may eventually end up a part of RS Linkify.

That's the main reason I wrote it all out, to give you and anyone else who reads it a grounding in the issues I'm facing. Maybe even get some different perspectives or approaches. The main thing is to give it shot, that's what I've done. That puts the wheels in motion for a little while. From here things will either develop or not :)

13-Mar-2017 11:37:14 - Last edited on 13-Mar-2017 11:39:42 by Lil Indecent

Amaethwr
Aug Member 2008

Amaethwr

Posts: 14,634 Opal Posts by user Forum Profile RuneMetrics Profile
Haven't read that list of instructions, but that looks like a long process haha

And today the guys teaching the course said "The internet is your friend with learning this kind of stuff", so not all their advice is debatable :P
Selective Completionist

13-Mar-2017 21:07:43

Lil Indecent

Lil Indecent

Posts: 447 Silver Posts by user Forum Profile RuneMetrics Profile
Amaethwr said :
"The internet is your friend with learning this kind of stuff"

So true, there's some great resources out there. It would be a cruel irony if the web sucked for learning how to code for the internet though.

It's not so much if advice is debatable. It's good to question things. It also pays to take it all on board because everyone will have different opinions. More often than not there is no single 'right' way to do something.

When you've gained some skills and a little knowledge, you'll know what's right for you and it wont take long at all :)

13-Mar-2017 22:33:13

Quick find code: 261-262-33-65181208 Back to Top