Skip to content
Kevin Patel

How one AI tool reads 30 days of Reddit, YouTube, TikTok and X, and decides what matters

How open-source last30days searches 15+ apps at once and ranks posts by relevance, real engagement and freshness, with its real formulas explained.

Get the TABS guide (opens in a new tab)
A man sitting cross-legged on a pink floor with a laptop, covered head to toe in colourful sticky notes

Spotify Wrapped came out on 2 December. It knows your whole year of music down to the minute. Meanwhile, most of us still "research" what our audience wants with 41 open tabs: a Reddit thread, a YouTube review, a TikTok, a competitor's page, a blog post from 2021.

The people we want to reach are already saying what they want, in public, every day. The hard part isn't finding it. It's reading all of it and knowing which posts matter.

An open-source tool called last30days (opens in a new tab) does exactly that. It has over 80,000 stars on GitHub and an MIT licence. You ask one question, and it reads the last 30 days of Reddit, YouTube, TikTok, X, Hacker News and more, then hands you one short brief with sources.

I wanted to know how it decides which posts matter, so I read its ranking code. This post follows one question through the whole machine, step by step, with the real formulas in plain words.

The whole process in one picture

Your question“best standing desk for a small office”1PlanAn AI planner splits it into a few weighted searches2SearchEvery search runs on every app at the same time3ScoreEach post is scored for relevance, engagement and age4MergeAll lists become one; posts found twice add up5Final scoreAn AI judge scores relevance, then penalties apply6BriefSimilar posts become stories, each with its sources
Six steps from one question to one brief. Each step is explained below.

We'll follow one example question all the way through: "best standing desk for a small office".

Step 1: Turn one question into a few searches

First, an AI planner reads your question and works out what kind of question it is: news, a comparison, a how-to, a product question and so on. That matters later. For breaking news, only very new posts count. For a how-to, a good post from three weeks ago is still fine.

Then it splits your question into 1 to 5 smaller searches, each with a weight. A product question like ours might become standing desk, small office and desk reviews.

It also cleans up the words. Little words like "the", "for" and "a" are ignored. Generic words like best, review, tips and vs are kept but count for less, because almost every post contains them. They don't tell you what the post is about.

Step 2: Search every app at the same time

This is the part that replaces your tabs. Each small search runs on each app as its own job, and the jobs run in parallel.

QUESTIONbest standing desk for a small officeSEARCHREDDITYOUTUBETIKTOKXHNstanding desksmall officedesk reviews
3 searches x 5 apps = 15 searches, all at once. Each one returns its own ranked list.

Some apps work with no setup at all: Reddit, Hacker News, Polymarket and GitHub. A setup wizard adds YouTube (with full video transcripts). TikTok, Instagram and X need your own key or login.

For Reddit, it reads each thread's real upvotes and comment count, and for the most promising threads it opens the thread and reads the top comments too. The engagement numbers are real counts, not an AI's guess.

Each of the 15 searches gives back its own list of posts. Now every post needs scores.

Step 3: Score every post three ways

Is it actually about my question? (relevance)

The tool compares the words in your question with the words in the post. The score runs from 0 to 1 and has four parts:

  • 55%: how many of your words appear. Raised to a power, so missing words hurt more than you'd expect.
  • 25%: how many of the important words appear. "best" doesn't count here.
  • 20%: how focused the post is. A post stuffed with unrelated words scores a bit lower.
  • A bonus if your exact phrase appears word for word.

And one hard rule: if a post matches only generic words, its score is capped just below the cut-off, so it can't pass.

Here is the real code, trimmed:

Python
# trimmed from lib/relevance.py
coverage = overlap / len(q_tokens)
informative_overlap = len(informative_q_tokens & t_tokens) / len(informative_q_tokens)
precision = overlap / min(len(t_tokens), len(q_tokens) + 4)

base = (
    0.55 * (coverage ** 1.35) +
    0.25 * informative_overlap +
    0.20 * precision
)

# Only generic words matched: stay below the 0.10 floor.
if informative_q_tokens and not (informative_q_tokens & t_tokens):
    return round(min(GENERIC_ONLY_CAP, base), 2)

I ran three example posts through that exact function:

QUESTIONbest standing desk for a small officePOSTRELEVANCE, 0 TO 1Finally found a standing deskthat fits my small office4 of 5 words, all the important ones0.77Standing desk vs sitting: whatmy back says after 30 days2 of 5 words0.33Best gaming chair dealsthis weekonly “best” matched, so it is capped0.0901cut-off 0.10
Same question, three posts. Post B shares a word with the question, but only a generic one.

Post B is the interesting one. A keyword search would happily return it, because it contains "best". This rule throws it out.

How many people cared? (engagement)

Next, how much did people engage with it? The tool doesn't use raw numbers. It uses a log scale, which means it counts zeros, not totals. 10 upvotes to 100 is one step. 100 to 1,000 is one more step, worth about the same.

Why? Because on a raw scale, one viral post would flatten everything else. 10,000 upvotes isn't 1,000 times more useful than 10. It's just a lot more people.

Each app has its own recipe:

AppWhat counts
Reddit50% upvotes, 35% comments, 10% top comment, 5% upvote ratio
YouTube45% views, 32% likes, 13% comments, 10% top comment
TikTok, Instagram45% views, 27% likes, 18% comments, 10% top comment

Then every app's result is put on the same 0 to 100 scale, so a Reddit thread and a YouTube video can be compared fairly.

REDDIT THREADENGAGEMENT, 0 TO 10010 upvotes30100 upvotes56250 upvotesPost A681,000 upvotes8510,000 upvotes100050100
Example threads, with comments at about a third of upvotes. The gold bar is Post A from earlier.

Is it recent? (freshness)

The last score is simple. For most questions, a post from today scores 90, a post from 15 days ago scores 50, and anything 30 days or older scores 10. Breaking-news questions use a stricter scale. How-to questions use a gentler one.

Step 4: Merge 15 lists into one

Now there are 15 separate ranked lists, and the same post often shows up in more than one. The tool merges them with a standard method called reciprocal rank fusion, first published in 2009 and now common in search systems.

The rule: in each list, a post gets 1 ÷ (60 + its position) points. Position 1 gets 1/61, position 2 gets 1/62, and so on. If a post appears in several lists, its points add up.

SEARCH 1 · REDDIT1Another post2Post A1/623Another post4Another post5Another postSEARCH 3 · REDDIT1Another post2Another post3Another post4Another post5Post A1/65MERGED SCOREPost A1/62 + 1/650.0315#1 in one list only0.0164
Agreement beats a single win. Post A was never #1, but two searches found it, so it scores almost double.

This is my favourite part of the design. A post that several different searches agree on beats a post that topped just one list. The "+60" keeps any single #1 from running away with it.

Copies of the same post are matched by their web address, and the tool keeps whichever copy carries more detail (for example, the one with comments loaded).

Step 5: The final score

Before the final score, an AI judge reads the top posts and rates each one from 0 to 100 for "is this really about the question?". If you haven't set up an AI key, it falls back to the word-matching score from Step 3.

Then everything is combined. This is the real recipe:

Python
# trimmed from lib/rerank.py
score = (
    0.60 * judge_relevance        # the AI judge, 0-100
    + 0.20 * merged_rank_score    # Step 4, scaled to 0-100
    + 0.10 * freshness            # Step 3
    + 0.05 * app_trust * 100      # how much it trusts the app
    + 0.15 * engagement           # Step 3, 0-100
)

"App trust" is a fixed number per app: YouTube 0.85, Hacker News 0.8, X 0.68, Reddit 0.6, TikTok 0.58. Long-form sources get a little more credit than fast social feeds.

Then come the penalties. They're what keep the brief honest:

  • The judge says it's off-topic (under 20): the score is multiplied by 0.3.
  • It never mentions your subject: the judge is told to score it 30 at most, and without a judge it loses points directly, so engagement can't rescue it.
  • It's older than 30 days: multiplied by 0.35. It can still appear, but never above recent posts.
  • One author can't flood it: at most 3 posts from any one account.

Here are three example posts through the full recipe:

AI judge, 60%Agreement, 20%Engagement, 15%Freshness, 10%App trust, 5%Post AReddit · on topic · 4 days old79.9Post B3,000 upvotes · off topic11.036.5judge scored it under 20: × 0.3Post CYouTube · 42 days old22.163.0older than 30 days: × 0.35
Post B has the most upvotes of the three and still finishes last. That's the point.

Post B has almost perfect engagement, 99 out of 100. On a "most popular" list it would be #1. Here it finishes last, because it isn't about standing desks.

Step 6: Group into stories, then write the brief

The same story often appears on several apps: a Reddit thread, a YouTube video and an X post about one new desk. The tool groups posts whose wording overlaps by about half or more into one story, even across apps. Your brief then says "this came up on Reddit, YouTube and X" instead of repeating it three times.

Finally, the AI you're already using (Claude, Cursor, Codex and others) reads the top stories and writes the short brief, with a link to every source so you can check it yourself.

Why this design works

  • Agreement beats volume. Rank fusion rewards posts that several searches find.
  • Logs beat raw counts. One viral post can't drown out everything else.
  • Penalties beat popularity. Off-topic or old posts are pushed down, however many likes they have.
  • Real numbers, not guesses. Engagement comes from the apps themselves.

Honest limits

  • Loud isn't always right. It ranks by engagement, and the most upvoted opinion isn't always what your buyers think. Read 2 or 3 sources before you act.
  • Some apps need keys or logins, and some cost money after a free allowance. The guide lists each one.
  • Your topic leaves your computer. It goes to the search sources, and to an AI provider if you've set an AI key.
  • Follow each platform's rules. Use your own logins, and learn from other people's posts rather than copying them.

Try it

  1. Install it. In Claude Code, run /plugin marketplace add mvanhorn/last30days-skill, then install last30days. For Codex, Cursor, Copilot or Gemini CLI, run npx skills add mvanhorn/last30days-skill -g.
  2. Run it once with /last30days. A setup wizard (about 30 seconds) unlocks extra sources like YouTube.
  3. Ask a real question instead of opening tabs:
Output
/last30days what are people complaining about in [your niche]?
/last30days [competitor name]
/last30days [your product type] what do buyers wish existed?

No coding background? The guide button at the top walks through the easiest setup (claude.ai in your browser), every source and what it costs, 10 prompts to copy, and how to turn one brief into a week of posts.

Quick answers

How does last30days decide which posts matter?

It scores every post for relevance to your question, real engagement on a log scale, and freshness. It merges the results from every search with reciprocal rank fusion, then an AI judge sets the final score. Posts that are off-topic or older than 30 days get heavy penalties.

Is last30days free?

Yes. It's open source under the MIT licence. Reddit, Hacker News, Polymarket and GitHub work with no keys. Some sources, like TikTok, Instagram and X, need your own key or login, and some of those cost money after a free allowance.

Which apps can it read?

Reddit, YouTube, TikTok, X, Instagram, Threads, Pinterest, LinkedIn, Hacker News, Polymarket, GitHub, StockTwits and more, over 15 sources in total.

Why does a viral post sometimes rank low?

Because relevance comes first. A post that doesn't mention your subject, or that the AI judge rates as off-topic, is pushed down however many likes it has.

What is reciprocal rank fusion?

A way to merge several ranked lists. In each list, a result gets 1 ÷ (60 + its position) points, and the points add up across lists. Results that several lists agree on rise to the top.

All posts