Live data from Hacker News

How F5Bot Slurps All of Reddit

intoli.com

21–30 of 91 posts

Re: How F5Bot Slurps All of Reddit

#21
post #13

"You may think PHP is slow" Why would we think php is slow? PHP is blazing fast certain applications (looking at you sugarcrm) make this into a mockery by rewriting queries and loading unnecessary data into each page request. Nice to see a php related show and tell.

Because for a long time (critically, when PHP was very popular) it was quite slow. It has gotten better, but a lot of people haven't used it since it was slow.

Re: How F5Bot Slurps All of Reddit

#22
post #19

Aho-Corasick is really great. It’s a bit complicated to set up, but once you have the modified true set up it’s really fast. By the way, > Basically I use the selftext, subreddit, permalink, url and title. The other 95% of it is just wasted bandwidth. It’d probably be better for Reddit if they allowed for specifying the fields we care about rather than just returning the whole thing…

Also, imagine the joules saved worldwide if known key names didn't have to be sent each time, or, better yet, data was packed in a format that optimized for size and processing speed rather than readability. I mean, I enjoy the idea of human readability as much as Jon Postel, but at certain scales you have to wonder about the hidden cost of petabytes of human-readable data flying over the wire, never to be seen by an…

Except that the data stream is, I should hope, compressed so that the data is actually packed into a format optimized for size.

Re: How F5Bot Slurps All of Reddit

#23

I made something just like this that worked on forums. Basically any forum that was using the tapatalk plugin (pretty much any busy forum uses it these days) you could subscribe too. It doesn't look like this will handle mispellings of works, or anything like that. I was handling that, however it took a LOT of processing power and quickly realized that the more people used it, the more it wasn't going to scale really…

I run a forum and would be very interested in seeing your code. Can you share?

Re: How F5Bot Slurps All of Reddit

#24
post #6

It is difficult for me to describe just how angry it makes me that reddit doesn't provide a way for users to even do basic things like "see all of my own comments" or "see all of the posts made to the subreddit I moderate". They keep nerfing the search APIs and claim it is so they could make the indexes more efficient, but while that might make sense for a full-text search interface, that is entirely unreasonable for…

Yeah, Reddit's search is unusable. Some of the important features used to be corralled into CloudSearch but I think they killed that too.

I pulled the dumps from Bigquery and am going to load them into PG at some point here, so I can do arbitrary queries without hitting BigQuery every time. Haven't looked at how to do that in realtime though, retrospective queries are mostly what I'm interested in.

If you don't want to do that, there's also https://redditsearch.io/ - if you want to search back farther, be sure to set the toggle to "all" instead of "day"!

Re: How F5Bot Slurps All of Reddit

#25
post #14

> I mean do you really want subreddit name and subreddit_name_prefixed? They’re the same, one just has an “r/” in front of it. This is (unfortunately) not quite true. Since Reddit introduced "profile posts," there can be a post where the subreddit name is something like "u_Shitty_Watercolour" but the subreddit_name_prefixed is actually "u/Shitty_Watercolour", rather than "r/u_Shitty_Watercolour". Example: https://www…

I'm not sure that's true. I think they both work, see: https://www.reddit.com/r/u_Shitty_Watercolour/

Maybe one is just an alias though? I wonder if you can make a r/u_$unused_username and then later register $unused_username

edit: nope, you can't make a sub that starts with "u_"

Re: How F5Bot Slurps All of Reddit

#26
post #25
post #14

> I mean do you really want subreddit name and subreddit_name_prefixed? They’re the same, one just has an “r/” in front of it. This is (unfortunately) not quite true. Since Reddit introduced "profile posts," there can be a post where the subreddit name is something like "u_Shitty_Watercolour" but the subreddit_name_prefixed is actually "u/Shitty_Watercolour", rather than "r/u_Shitty_Watercolour". Example: https://www…

I'm not sure that's true. I think they both work, see: https://www.reddit.com/r/u_Shitty_Watercolour/ Maybe one is just an alias though? I wonder if you can make a r/u_$unused_username and then later register $unused_username edit: nope, you can't make a sub that starts with "u_"

They do both work, you're correct.

However the point of subreddit_name_prefixed (I assume) is to display something in a user-facing way. For this purpose, r/u_something is correct but not proper.

Re: How F5Bot Slurps All of Reddit

#27

Aho-Corasick is really great. It’s a bit complicated to set up, but once you have the modified true set up it’s really fast. By the way, > Basically I use the selftext, subreddit, permalink, url and title. The other 95% of it is just wasted bandwidth. It’d probably be better for Reddit if they allowed for specifying the fields we care about rather than just returning the whole thing…

I only took a quick skim, but it doesn't look like they do the optimization to aho-corasick where you store connections directly to "leaf" nodes (ie: nodes where you can have a finished match).

If I'm right, that would probably speed things up significantly.

Re: How F5Bot Slurps All of Reddit

#28

Earlier quoted context omitted.

PHP used to be very slow, it got better with v7.0. It's still quite slow compared to C/C++/Rust/Go, more than 10x slower: https://benchmarksgame-team.pages.debian.net/benchmarksgame/...

An interpreted language is slower than a compiled binary? Color me shocked.

> An interpreted language is slower than a compiled binary? Color me shocked.

That same benchmark shows JS code that’s 6x faster than PHP.

Re: How F5Bot Slurps All of Reddit

#29
> The other 95% of it is just wasted bandwidth.

You can save a lot of bandwith by requesting compressed responses:

  $ curl -s --user-agent moo/1 -H 'Accept-Encoding: gzip' "$pretty_long_url" > test.gz
  $ wc -c 
(OK, that's 85% saved, not 95%, but hey.)

Re: How F5Bot Slurps All of Reddit

#30
post #19

Earlier quoted context omitted.

Also, imagine the joules saved worldwide if known key names didn't have to be sent each time, or, better yet, data was packed in a format that optimized for size and processing speed rather than readability. I mean, I enjoy the idea of human readability as much as Jon Postel, but at certain scales you have to wonder about the hidden cost of petabytes of human-readable data flying over the wire, never to be seen by an…

Except that the data stream is, I should hope, compressed so that the data is actually packed into a format optimized for size.

Not necessarily, and even so not for free.

(Client must specify compression support)

Post reply on HN