How I Built a Twitter Bot to Recover My Lost Stroller—and Got Paid

A programmer shares how he turned a lost stroller incident into a successful Twitter‑bot project, detailing the creation of a Cloud9 environment, Node.js bot, API configuration, and the surprising compensation he received, inspiring developers to apply coding skills to real‑world problems.

21CTO
21CTO
21CTO
How I Built a Twitter Bot to Recover My Lost Stroller—and Got Paid

A developer recounts a personal story: after an airline lost his child's stroller during a trip from Hungary to California, he used his programming skills to build a Twitter bot that pressured the airline and ultimately secured compensation.

Steps to Build the Twitter Bot

Create a new Cloud9 IDE workspace.

Set up a dedicated Twitter account and register a new Twitter application to obtain the four OAuth keys (API Key, API Secret, Access Token, Access Secret).

Clone the bot source code from GitHub: git clone https://github.com/krizsoo/twitterbot Install the required Node.js package: npm install --save twitter Configure the bot by editing config.js with your own OAuth keys and setting search parameters in app.js :

var params = {
  q: '@freecodecamp',
  count: 1,
  result_type: 'recent',
  lang: 'en'
};

Define an array of reply tweets to avoid sending the same message repeatedly:

var TWEETS_TO_REPLY = [
  "This is my first version of the tweet",
  "Second tweet, airline boss",
  "Where is my stroller?"
];

Set the posting interval (once per hour):

var INTERVAL = 1 * 60 * 60 * 1000;
BotStart();
setInterval(BotStart, INTERVAL);

Start the bot: npm run serve Within 24 hours of launching the bot, the airline’s customer service contacted the author and initiated a payment, demonstrating how a simple automation script can have real‑world impact.

The experience taught the author that even modest programming projects can solve everyday problems and provide tangible rewards, encouraging other developers to look for opportunities to apply their coding skills beyond traditional work tasks.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Backend DevelopmentNode.jsCloud9Twitter API
21CTO
Written by

21CTO

21CTO (21CTO.com) offers developers community, training, and services, making it your go‑to learning and service platform.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.