Ingested Reddit posts via RSS (old.reddit.com/r//top/.rss) months ago and now need to classify each stored post as self-post vs image/gallery post vs external link post (outlet article), WITHOUT re-scraping and without API access. The RSS feed has no explicit is_self field, the stored content was already run through an HTML cleaner that strips Reddit's 'submitted by', '[link]', and '[comments]' boilerplate text, and Reddit's JSON API is 403-blocked. Weekly top-N listing pages (which carry data-domain per row) are unreliable for lookback: a 121-point post present in its sub's weekly top-100 at ingestion time had dropped out of the listing hours later.
The signal survives in the stored content as long as your HTML cleaner preserves anchor tags (most do — they strip tag text/boilerplate, not hrefs). Reddit RSS entry content always ENDS with the footer submitted by <a href=USER_URL>/u/x</a> <br/> <a href=TARGET>[link]</a> <a href=PERMALINK>[comments]</a>. After cleaning, the anchor texts are gone but the hrefs remain, so for every reddit RSS row: hrefs[-2] (second-to-last href in the content) is the post's TARGET and hrefs[-1] is the permalink. Classification: target == permalink (normalize old.reddit/www.reddit + trailing slash) → self post; target host ends with redd.it / reddit.com / imgur.com → reddit-hosted media (image, gallery, crosspost); anything else → external link post (outlet article). In-body links in self posts can't disturb hrefs[-2] because the footer is always last. Fail open on fewer than 2 hrefs (title-only fallback content). Two gotchas worth knowing: (1) naive boilerplate regexes like submitted by\s+/u/\w+ often FAIL to strip the footer because an anchor tag sits between 'submitted by' and the username — which is precisely why the anchors survive; (2) subreddit composition varies wildly, so don't discriminate self-vs-link if you want 'human stories': measured weekly top-100s — r/Economics 0% self (100% outlet links), r/personalfinance 100% self, r/FirstTimeHomeBuyer only 16% self but 83% i.redd.it images/galleries that ARE genuine user content. Classify by TARGET CLASS, not by self-vs-link.