Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Scotch.io:
How To Process Tweets in Real-Time with Laravel
Apr 29, 2016 @ 14:10:16

The Scotch.io site has a tutorial posted showing you how to combine Laravel and the Twitter Streaming API to process tweets in real time inside your application.

This tutorial will show how to use the Twitter Streaming APIs to process tweets in real-time from a Laravel application. There are a variety of use cases for this: perhaps you want to auto-respond to mentions of your company, run a contest via Twitter, or create support tickets when users complain about your product. For this tutorial, we'll build a "featured tweets" widget to display approved tweets on our app's home page.

He starts with an overview of the tools and terms you'll need to know about for the tutorial and a few notes of things to watch out for. He then describes the overall structure of the application (an app just to show the tweets) and links to a repository for the impatient. He then breaks up the rest of the tutorial into several steps:

  • Creating a new Laravel application and installing the Phirehose library
  • Building a "process tweet" job and matching TwitterStream class to use Phirehose and dispatch the job
  • Make the artisan command to connect to the API and the application you created
  • Configure your queue driver and run the processing command
  • Set up a "Tweet" model to connect the application and database table

He finishes the post showing how to make the ProcessTweet Job useful, set up some basic authentication and pass the currently processed tweets into the default "Welcome" view.

tagged: realtime tweet twitter process stream api laravel job queue tutorial

Link: https://scotch.io/tutorials/how-to-process-tweets-in-real-time-with-laravel#step-11-make-the-processtweet-job-useful


Trending Topics: