Brief background
I recently saw this ArXiv twitter bot, and I thought it was pretty cool. There are hundreds of new papers appearing on ArXiv every day that can be hundreds of pages long, which it makes it almost impossible to keep up with all the latest research.
My co-founder Ivan and I are building the RCS API for developers, and as part of that, we started doing Monday hackathons, and so I thought it'd be cool to hack together something like the ArXiv twitter bot but for text message updates about trending AI papers.
Here's a guide on how I did it
The Plan
Getting & sending the data
- Get the daily released AI papers
- Rank them
- Send out texts at a daily specified time
Opting in / out
- Have people opt in at a subdomain of Pinnacle
- Allow them to opt out / opt back in via RCS buttons
Deploying
- Deploy backend
- Deploy frontend signup
Getting & sending the data
Getting the daily released AI papers
ArXiv (pronounced "Archive") is an open-access repository of papers, mainly in STEM fields, and allows researches to release their work before it's published in traditional journals. A ton of amazing AI research ends up coming through ArXiv / getting cross published to ArXiv, so I thought this would be a good source to learn from.
To get the papers, I wrote a simple script using ArXiv's RSS feeds:
python
along with defining a ArxivPaper
object
python
There's an issue though. Even though we have all the papers, we don't have a great way to track how these papers are being recieved.
Ranking the papers
For that, we'll use Mendeley's API. The reason we're using Mendeley's API is because saves by academics (just called views in our case) tend to be a decent predictor of paper success.[^1] You can get an API key from Mendeley here. From there, just create an application and get the CLIENT_SECRET
and CLIENT_ID
("ID" in the console / the generate secret w/ the Elsevier flow).
python
From there, I just upload the papers to a Supabase database (although you could use whatever database you like).
python
Sending out texts at a daily specified time
Now that we have the papers and their saves to rank them, we can send out the 3 most popular papers that were released that day. Ideally, we also track Mendeley saves over time so we can track what's trending aside from its initial launch but we're doing this in a couple hours so that's for the future.
To do this, we're going to write a simple function with Pinnacle's RCS API
python
The buttons are particular to each paper sent, but the quick replies are shared by our carousel.

When we deploy, we can deploy a cron job that runs the ArXiv RSS feed checker (since it only refreshes daily) and can then send out the trending papers as well.
Now that we have the backend flow, we need to allow people to signup.
Opting in / out
Have people opt in at ArXiv.trypinnacle.app
Before we message people, we need to get consent. For this, I setup a simple server action flow with an API endpoint with Next.js and Vercel that listens for tapbacks from the user to opt in (e.g., the opt out button on the text message thread in the former picture).
import { NextResponse } from "next/server"