Need help with longest-poem-in-the-world?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

134 Stars 23 Forks MIT License 47 Commits 0 Opened issues


A continuous stream of rhyming tweets.

Services available


Need anything else?

Contributors list

# 90,834
38 commits
# 600,377
3 commits
# 258,168
2 commits

Longest Poem in the World

The Longest Poem in the World is a continuous stream of real-time tweets that rhyme.

How it works

  • The Twitter Search API is used to fetch 100 recent English tweets.
  • Out of those tweets it only considers those written in proper English and with a reasonable syllable count.
  • The CMU Pronouncing Dictionary is used to obtain phonetical translations of the tweet. For example,
    has the phonetical translation
    ao1 r ah0 n jh
    . Tweets that rhyme have the same phonetical translation starting with the last accented phoneme.
  • A backlog of tweet candidates is kept. For each tweet ("candidate") fetched from the public search stream, it looks in the backlog to see if it can find one that rhymes with it. If yes, it pushes both tweets into the poem's verse stream. If not, the tweet is saved in the backlog, waiting to be paired with a future candidate.
  • Additional improvements include: ignoring "same word" rhymes, translating numbers into plain text, ignoring smileys, etc.


  • Create a new Google Cloud Platform project
  • Create a PubSub channel named
  • Create 3 cloud functions, one for each of the folders in
    , with the contents of the index.js and the package.json files for each.
    • fetch-tweets
      is triggered through HTTP and uses the Twitter API to fetch tweets, filter to only reasonable candidates, then push each candidate to the
      PubSub channel
    • parse-tweet
      is triggered through the
      PubSub channel for each candidate and tries to pair it with an older rhyming tweet
    • list-verses
      is triggered through HTTP and is used by the website to list the most recent verses of the poem
  • In order for
    to be able to access the Twitter Search API, you need to provide the necessary API access tokens. Go to Twitter's developer portal, sign in with your Twitter account and create a new application. At the bottom of the app page click the "Create my access token" button, then go to the "OAuth tool" tab and copy the 4 OAuth tokens into the
    file in
    . Upload this file into the Google Storage bucket created for your project
  • Set up a cron job to call the
    function however often you like. I use UptimeRobot with a frequency of 5 minutes.


Andrei Gheorghe


  • The "Longest Poem in the World" code is licensed under the MIT License.
  • The CMU Pronouncing Dictionary is Public Domain.
  • Tweets are property of their respective authors

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.