Job search is a tedious and time-consuming task. Last year, when I was on a job hunt, I looked for opportunities everywhere - LinkedIn, Facebook groups, Slack channels, Twitter, Indeed, Glassdoor, and sometimes Instagram.
Given that there's a huge tech community on Twitter, I found it easier to look for jobs there. To reach out directly to the people who posted the job and get a response from them, positive or negative, made the job search less tiresome. There was no cold messaging, awkward introductions, or long wait as to whether a real person had read my resume or not.
I'd search on Twitter for keywords like looking for frontend
and hiring frontend
. I'd scroll through all the results and open the compelling opportunities in new tabs. And before I knew it, I had several tabs open for review.
Combing through Twitter became a daily practice, and then, one day, I realized I could automate this process. Instead of searching for tweets manually, I created a script that would search recent tweets for specific keywords and create a .csv file with all the information I need.
Prerequisites
The script saved me a lot of time and got me a few interviews. Let's walk through the script and see how you can customize it according to your needs. Throughout this article, you’ll use the following tools:
- Node.js installed on your machine
- Twitter access key
- Twilio credentials and a Twilio phone number
- Objects-to-csv - This package converts objects into a CSV format
- Twit - Twit is a Twitter API Client for Node, making it easier to interact with Twitter API
- dotenv - You will use dotenv to load your access keys and tokens
Twitter
To make any request to the Twitter API, you must first have a developer account. For detailed instructions, you can read the Getting Started documentation.
Create your developer account here. Once you land on the page, Twitter will ask the reason behind accessing their API. There are a couple of options to choose from, but you will go with Exploring the API.
On the next page, Twitter will ask a few questions to verify your identity. Once you have confirmed your identity, you will answer some questions about your intended use.
Click Next to submit. Follow the instructions on the next page, and then you’ll be asked to name your application. The name could be anything, but it should be unique.
And that's it. Once you give your application a name, you will be provided with your API key and API secret key.
On your dashboard, you should see your application under Projects & Apps. Select your application and go to the Keys and Token tab. You already have your API key and API secret key, but you still need your Access Token and Secret. Generate them; you will need these for your next step.
Installation and Code
Instead of directly accessing Twitter’s API, you will use Twit - an npm package to simplify your interactions.
First, create a project directory called AutomateJobSearch. Open your terminal and execute the following command: