Download the PHP package carloscgo/laravel-twitter-streaming without Composer

On this page you can find all versions of the php package carloscgo/laravel-twitter-streaming. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-twitter-streaming

Easily work with the Twitter Streaming API in a Laravel app

Latest Version on Packagist Build Status Quality Score Total Downloads

Twitter provides a streaming API with which you can do interesting things such as listening for tweets that contain specific strings or actions a user might take (e.g. liking a tweet, following someone,...). This package makes it very easy to work with the API.

Here's an example Laravel application with the package pre-installed. It contains an artisan command to kick off the listening process.

Installation

You can install the package via composer:

You must install this service provider.

This package also comes with a facade, which provides an easy way to call the class.

The config file must be published with this command:

It will be published in config/laravel-twitter-streaming.php

Getting credentials

In order to use this package you'll need to get some credentials from Twitter. Head over to the Application management on Twitter to create an application.

Once you've created your application, click on the Keys and access tokens tab to retrieve your consumer_key, consumer_secret, access_token and access_token_secret.

Keys and access tokens tab on Twitter

Usage

Currently, this package works with the public stream and the user stream. Both the PublicStream and UserStream classes provide a startListening function that kicks of the listening process. Unless you cancel it your PHP process will execute that function forever. No code after the function will be run.

In the example below a facade is used. If you don't like facades you can replace them with

The public stream

The public stream can be used to listen for specific words that are being tweeted.

The first parameter of whenHears must be a string or an array containing the word or words you want to listen for. The second parameter should be a callable that will be executed when one of your words is used on Twitter.

The user stream

Suggestion on how to run in a production environment

When using this in production you could opt to create an artisan command to listen for incoming events from Twitter. You can use Supervisord to make sure that command is running all the time.

A word to the wise

These APIs work in realtime, so they could report a lot of activity. If you need to do some heavy work processing that activity it's best to put that work in a queue to keep your listening process fast.

Changelog

Please see CHANGELOG for more information what has changed recently.

Testing

Contributing

Please see CONTRIBUTING for details.

License

The MIT License (MIT). Please see License File for more information.


All versions of laravel-twitter-streaming with dependencies

PHP Build Version
Package Version
Requires php Version ^7.0
illuminate/support Version ^5.3
spatie/twitter-streaming-api Version ^1.0.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package carloscgo/laravel-twitter-streaming contains the following files

Loading the files please wait ....