From time to time, you may get clients that want share counts to be displayed on their site. There are indeed SAAS (software as a service) services out there that do this for you, but what if a third party isn’t possible? Since Twitter dropped their JSON endpoint for share counts, a lot of people are looking to these services, and most are commercial, offer a lot of bloat, and just do MORE than what you want. Instead, learn how to use the Twitter REST API to your advantage when counting your tweets. Getting Started To get going, you’re going to need two things at minimum. First and foremost, I’m not going to go into detail about how OAuth works, so for that we’ll use Abraham’s Oauth Library. If you don’t use composer, click the Manual Installation tab, and download it from his GitHub. Secondly, you’ll need a Twitter app. For this DIY, we’re going to be bending the REST API to do our bidding, and for that, you need an app. If you want to wing it and think you’ll be okay without instructions, here’s a handy link to get you there. If you’re not entirely sure how to register an app with Twitter, follow this blog post on iag.me which shows you how to register a Twitter app. Once you make
Share This