Download the PHP package dg/twitter-php without Composer

On this page you can find all versions of the php package dg/twitter-php. 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 twitter-php

Twitter for PHP Buy me a coffee

Downloads this Month

Twitter for PHP is a very small and easy-to-use library for sending messages to Twitter and receiving status updates.

It requires PHP 5.4 or newer with CURL extension and is licensed under the New BSD License. You can obtain the latest version from our GitHub repository or install it via Composer:

composer require dg/twitter-php

Support Me

Do you like Nette DI? Are you looking forward to the new features?

Buy me a coffee

Thank you!

Usage

Sign in to the https://twitter.com and register an application from the https://apps.twitter.com page. Remember to never reveal your consumer secrets. Click on My Access Token link from the sidebar and retrieve your own access token. Now you have consumer key, consumer secret, access token and access token secret.

Create object using application and request/access keys

The send() method updates your status. The message must be encoded in UTF-8:

The load() method returns the 20 most recent status updates posted by you:

or posted by you and your friends:

or most recent mentions for you:

Extracting the information from the channel is easy:

The static method Twitter::clickable() makes links, mentions and hash tags in status clickable.

The authenticate() method tests if user credentials are valid:

The search() method provides searching in twitter statuses:

The returned result is a again array of statuses.

Error handling

All methods throw a DG\Twitter\Exception on error:

Additional features

The authenticate() method tests if user credentials are valid:

Other commands

You can use all commands defined by Twitter API 1.1. For example GET statuses/retweets_of_me returns the array of most recent tweets authored by the authenticating user:

Changelog

v4.1 (11/2019)

v4.0 (2/2019)

v3.8 (2/2019)

v3.7 (3/2018)

v3.6 (8/2016)

v3.5 (12/2014)

v3.4 (11/2014)

v3.3 (3/2014)

v3.2 (1/2014)

v3.1 (3/2013)

v3.0 (12/2012)

v2.0 (8/2012)

v1.0 (7/2008)


(c) David Grudl, 2008, 2016 (https://davidgrudl.com)


All versions of twitter-php with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1
ext-curl Version *
ext-json Version *
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 dg/twitter-php contains the following files

Loading the files please wait ....