Forums

RS-Linkify Thread is sticky

Quick find code: 261-262-33-65181208

AoDude

AoDude

Posts: 1,694 Mithril Posts by user Forum Profile RuneMetrics Profile
https://github.com/reddit/reddit/blob/master/r2/r2/models/link.py

Lines 445-469

They are converting an integer id into a base 36 number with a function similar to :

Original message details are unavailable.
def to36(q):
"""
Converts an integer to base 36 (a useful scheme for human-sayable IDs).

>>> to36(35)
'z'
>>> to36(119292)
'2k1o'
>>> int(to36(939387374), 36)
939387374
>>> to36(0)
'0'
>>> to36(-393)
Traceback (most recent call last):
...
ValueError: must supply a positive integer

"""
if q < 0: raise ValueError, "must supply a positive integer"
letters = "0123456789abcdefghijklmnopqrstuvwxyz"
converted = []
while q != 0:
q, r = divmod(q, 36)
converted.insert(0, letters[r])
return "".join(converted) or '0'


So technically it appears that the min chars is 1 and the max is +&#8734;, given no url max char limits. Conversely a 7 char base 36 number relates to 78 billion ids, adding one character bumps that up to 2.8 trillion ids.
AO
Deputy-Owner :
The Nexus CC

23-Mar-2016 14:41:44 - Last edited on 23-Mar-2016 14:56:39 by AoDude

Indecent Act

Indecent Act

Posts: 7,456 Rune Posts by user Forum Profile RuneMetrics Profile
Wow that's some research, thank you so much!

From my understanding it looks like...

- Any length within reason (most browsers won't allow 2000+ characters)

- All lowercase (that's very handy to know and I'll use that in my regex)

- 0-9 digits (was safe to assume that)

- No non-alphanumeric characters (I thought maybe underscore as it's a word character)
wouldn't have been surprised if hyphens were allowed but that's not case.

So off the top of my head allowing for 8 characters (future proofing)

/ht tps:\/\/www.reddit.com\/r\/(runescape|2007scape|RSChronicle)\/comments\/[a-z0-9]{1,8}\/\w+\/[a-z0-9]{1,8}$/;


Untested, but I'll give it a try tomorrow and see how it goes.

Big thanks again, AoDude. You totally blew me away with that reply. Glad I asked :)

23-Mar-2016 16:16:36

AoDude

AoDude

Posts: 1,694 Mithril Posts by user Forum Profile RuneMetrics Profile
Anyway, since you know what I am working on now. (Thanks for your help, btw) I wonder what you thought about Sound Cloud.

The idea originated by the GWS2 Medley: https://soundcloud.com/runescapesoundtrack/godwars-2-music-medley As I figured many forumers hadn't probably heard it. (and I ­<3 it) I see many people share youtube music videos (game music mostly) on the chat lounges rather frequently.

Although, in the earlier stages of the project I came across a few things that bug me in the terms of service (and obtaining a client id/app registration to make their widget work). Things like tracking the number of requests, possibly capping you, reserving the right to start charging you at any time, and reserving the right to attempt to copy your app. Ofcourse I made a throw away account to do so, registered the title of the app as "TestChrome", and they never asked for any code or billing info. So for the little test/project I did, likely nothing will come of it.

All in all, it was a fun little project. But I am not sure that I would recommend it for linkify. But then again, this may be something you have seen before and it doesn't bug you like it does me.


Edit: All that, and you already had support for sound cloud... Lmao, ghostry why do you block these widgets...

Edit2: Facepalm incoming, you even told me before:
Indecent Act said :
Other - Twitter, Giphy, Gfycat, Vine, SoundCloud, Blasty's HLF Poll
AO
Deputy-Owner :
The Nexus CC

24-Mar-2016 13:59:51 - Last edited on 24-Mar-2016 14:11:59 by AoDude

Indecent Act

Indecent Act

Posts: 7,456 Rune Posts by user Forum Profile RuneMetrics Profile
^I had to giggle sorry :)

Hmmm, got me thinking. I can see how twitter was blocked by another plugin as there is a widget loaded then api calls made. Very easy to block a http request to a particular domain.

But the way I embed soundcloud is really no different youtube and all other HTML5 video. So I'm surprised soundcloud was blocked. Almost tempted to install ghostry and see what's going on.

24-Mar-2016 14:51:51 - Last edited on 24-Mar-2016 14:52:24 by Indecent Act

AoDude

AoDude

Posts: 1,694 Mithril Posts by user Forum Profile RuneMetrics Profile
On this current page:

http://puu.sh/nSgEX/a861974b5f.jpg

Ghostry has been fairly good at keeping advertisements and malicious code from running in websites. Things like when wikia was hacked, and a few of my friends got phished from the malicious adverts, my account was safe/computer clean. But as you can see, sometimes it is overly protective.
AO
Deputy-Owner :
The Nexus CC

24-Mar-2016 14:59:29 - Last edited on 24-Mar-2016 15:03:02 by AoDude

Indecent Act

Indecent Act

Posts: 7,456 Rune Posts by user Forum Profile RuneMetrics Profile
I just read a little about it. I can now see how it can mess with things. Not all tracking is bad and not all trackers track you, sadly these things are not differentiated and I'm not even sure they can be.

If everyone blocked analytics the web would be 10 years behind. Just like if everyone blocked javascript. If everyone blocked ads, all we'd have left is sites like amazon and no little guys at all, there'd be no google of any kind.

I could go on but my opinions aren't pretty and I tend to go off on different tangents with this subject, so I'll spare us all from that :)

24-Mar-2016 15:29:23 - Last edited on 24-Mar-2016 15:31:35 by Indecent Act

AoDude

AoDude

Posts: 1,694 Mithril Posts by user Forum Profile RuneMetrics Profile
Fair enough, and I know that not everyone has the worst intentions. But then again, I prefer to be protected from those who do. And I am afraid it is hard to tell at face value who is who. Call it a personal preference to be protected from those with malicious code and those overly obnoxious adverts. If everyone were honest, there would be no need for it, but unfortunately that isn't the case.

And we are now way off topic, so I am sorry for that...
AO
Deputy-Owner :
The Nexus CC

24-Mar-2016 15:46:09

Indecent Act

Indecent Act

Posts: 7,456 Rune Posts by user Forum Profile RuneMetrics Profile
AoDude said :
And we are now way off topic, so I am sorry for that...

Nah, that's what this thread is for :)

I understand what you're saying. The way I see it is all users (the good, the bad, the ugly) shape the web though action or reaction.

My site and thus RS Linkify are a hole I toss money into and never see again. I expect the day will come when I feel my money can be better spent elsewhere. I will feel sad about it, and maybe even a little used (ad impressions is not a big ask when that's your only revenue), even so, I don't judge.

Put it this way, next month I'll be paying out over $350 dollars (renew SSL, renew my site subscription, renew domain names, and some other site related costs). If I don't pay it my site and RS Linkify stop.

24-Mar-2016 16:48:54

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