How it works
Using the Twitter API, we pull in a list of the Twitter accounts you follow, with your permission. With that list, we see which of the accounts you follow are connected to ChallengePost. We display the matching ChallengePost accounts to you, so you can easily follow and visit their profiles.
Challenges I ran into
- Rate limiting: The Twitter API only allows 15 requests per 15 minutes per user.
- OAuth 2.0. Let's just leave it at that.
Accomplishments that I'm proud of
I completed this feature in a week. In the process, I refactored a lot of code and improved the underlying infrastructure, making Find Friends even more easily extensible and maintainable.
What I learned
Authentication for Twitter's API can be quite strange, compared with that for Facebook and GitHub. While Facebook and GitHub require only the user's OAuth tokens, Twitter requires both the user's and the app's OAuth tokens, which is more secure.
Twitter's OAuth dance for each request is interesting. Even though sferik's Twitter gem simplifies everything, we still had to test API requests using FakeWeb, and so we still had to learn which OAuth requests to stub.
What's next for Twitter Find Friends
Some small improvements are on the way.