TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

How F5Bot Slurps All of Reddit

255 pointsby foobalmost 7 years ago

16 comments

jwilkalmost 7 years ago
&gt; The other 95% of it is just wasted bandwidth.<p>You can save a lot of bandwith by requesting compressed responses:<p><pre><code> $ curl -s --user-agent moo&#x2F;1 -H &#x27;Accept-Encoding: gzip&#x27; &quot;$pretty_long_url&quot; &gt; test.gz $ wc -c &lt; test.gz 63507 $ gzip -d &lt; test.gz | wc -c 426941 </code></pre> (OK, that&#x27;s 85% saved, not 95%, but hey.)
评论 #17648974 未加载
333calmost 7 years ago
&gt; I mean do you really want subreddit name and subreddit_name_prefixed? They’re the same, one just has an “r&#x2F;” in front of it.<p>This is (unfortunately) not quite true. Since Reddit introduced &quot;profile posts,&quot; there can be a post where the subreddit name is something like &quot;u_Shitty_Watercolour&quot; but the subreddit_name_prefixed is actually &quot;u&#x2F;Shitty_Watercolour&quot;, rather than &quot;r&#x2F;u_Shitty_Watercolour&quot;.<p>Example: <a href="https:&#x2F;&#x2F;www.reddit.com&#x2F;user&#x2F;Shitty_Watercolour&#x2F;comments&#x2F;84nhwi&#x2F;here_is_my_patreon_if_you_would_like_to_support&#x2F;.json" rel="nofollow">https:&#x2F;&#x2F;www.reddit.com&#x2F;user&#x2F;Shitty_Watercolour&#x2F;comments&#x2F;84nh...</a>
评论 #17648208 未加载
saurikalmost 7 years ago
It is difficult for me to describe just how angry it makes me that reddit doesn&#x27;t provide a way for users to even do basic things like &quot;see all of my own comments&quot; or &quot;see all of the posts made to the subreddit I moderate&quot;. 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 basic functionality like &quot;I&#x27;m scrolling back through time on my own user page&quot; (where the efficient index is pretty obvious). Both of &quot;see all of the content I posted&quot; and &quot;see all of the content I&#x27;m supposedly responsible for&quot; seems like it should be basic, if not required, functionality for any website.<p><a href="https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;changelog&#x2F;comments&#x2F;7tus5f&#x2F;update_to_search_api&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;changelog&#x2F;comments&#x2F;7tus5f&#x2F;update_to...</a><p><a href="https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;redditdev&#x2F;comments&#x2F;7qpn0h&#x2F;how_to_retrieve_all_removed_posts_via_api&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;redditdev&#x2F;comments&#x2F;7qpn0h&#x2F;how_to_re...</a><p><a href="https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;help&#x2F;comments&#x2F;1u0scj&#x2F;get_full_post_history&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;help&#x2F;comments&#x2F;1u0scj&#x2F;get_full_post_...</a>
评论 #17648624 未加载
评论 #17647915 未加载
评论 #17648488 未加载
评论 #17647990 未加载
评论 #17648201 未加载
wolcoalmost 7 years ago
&quot;You may think PHP is slow&quot;<p>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.<p>Nice to see a php related show and tell.
评论 #17647948 未加载
评论 #17648095 未加载
allenzalmost 7 years ago
Related: Jason Baumgartner has maintained a Reddit scraping pipeline for a few years now, and wrote up some notes about making it robust: <a href="https:&#x2F;&#x2F;pushshift.io" rel="nofollow">https:&#x2F;&#x2F;pushshift.io</a>
评论 #17647872 未加载
saagarjhaalmost 7 years ago
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,<p>&gt; Basically I use the selftext, subreddit, permalink, url and title. The other 95% of it is just wasted bandwidth.<p>It’d probably be better for Reddit if they allowed for specifying the fields we care about rather than just returning the whole thing…
评论 #17648081 未加载
评论 #17652741 未加载
评论 #17648251 未加载
stevebmarkalmost 7 years ago
This is just scraping JSON, I&#x27;m surprised it made it to the front page. The only thing worth noting is that Reddit is is able to <i>serve</i> that much JSON
评论 #17661747 未加载
JeremiahMNalmost 7 years ago
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&#x27;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&#x27;t going to scale really well. Good luck with your project.
评论 #17648185 未加载
dev_dullalmost 7 years ago
&gt; <i>So here’s the approach I ended up using, which worked much better: request each post by its ID. That’s right, instead of asking for posts in batches of 100, we’re going to need to ask for each post individually by its post ID. We’ll do the same for comments.</i><p>Seems a bit over the top imho. Maybe a better approach is to ask for a 1,000 and look for any missing — which you can grab individually.<p>I’d be a little annoyed at people not using batch mode and making so many request but that’s just me.
评论 #17648999 未加载
评论 #17649519 未加载
visargaalmost 7 years ago
There&#x27;s a reddit database dump including the interval 2005 - 05&#x2F;2018 at:<p><a href="https:&#x2F;&#x2F;bigquery.cloud.google.com&#x2F;table&#x2F;fh-bigquery:reddit_comments.2015_05" rel="nofollow">https:&#x2F;&#x2F;bigquery.cloud.google.com&#x2F;table&#x2F;fh-bigquery:reddit_c...</a>
testplzignorealmost 7 years ago
Which API do most Reddit bots use? Do they use the Reddit APIs directly, or do they use one of the third-party services (F5Bot, pushshift)? And are there any other options for getting a firehose of new Reddit posts&#x2F;comments?
评论 #17652125 未加载
kierenjalmost 7 years ago
Do the social share buttons literally cover the first few paragraphs of content for anyone else?
wingerlangalmost 7 years ago
For the service itself, I&#x27;ve been using it for a long time and it works really well.
评论 #17652756 未加载
textmodealmost 7 years ago
&quot;Turns out that Reddit [API] has a limit. It&#x27;ll only show you 100 posts at a time.&quot;<p>100 sounds like a typical &quot;max-requests&quot; pipelining limit.<p>He does not mention CURLMOPT_PIPELINING.<p>Does this mean he makes 100 TCP connections in order to make 100 HTTP requests?
评论 #17648663 未加载
RSZCalmost 7 years ago
edit: cool
评论 #17649547 未加载
评论 #17647846 未加载
评论 #17647860 未加载
prolikewh0aalmost 7 years ago
This is mostly why I left Reddit. The API allows far too much control and I started questioning what was even real. Being able to quickly find keywords and then have a network of bots that creates replies&#x2F;upvotes&#x2F;downvotes is very disturbing thought to me. I can&#x27;t even imagine something like that on a large scale to change opinions.
评论 #17648879 未加载
评论 #17650416 未加载
评论 #17651731 未加载
评论 #17649426 未加载