Download the PHP package miladrahimi/twitter-bot without Composer

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

Latest Stable Version Total Downloads License

Twitter Bot

This package is a basic Twitter bot that handles authentication, HTTP requests and responses, and other primitive requirements. It doesn't focus on any specific Twitter API. Instead, it provides a tool that makes calling Twitter APIs much simpler.

Installation

Install Composer and run the following command in your project's root directory:

Documentation

Getting Started

The snippet below demonstrates how to create an instance of Twitter Bot. It requires your consumer key (API Key) and consumer secret (API Key Secret). You can get them from your Twitter Developer Portal.

Public Endpoints

Public endpoints work without authentication and user tokens. You can call public endpoints like the following sample. This sample shows how to call the search API. It searches for tweets that contain the given hashtag.

Authenticated Endpoints

Authenticated endpoints work only with authenticated user tokens. A user token includes a user token and a user token secret.

If you want to call Twitter APIs on behalf of yourself, you can get your token and token secret from your Twitter Developer Portal. If you need to call Twitter APIs on behalf of other users, you must authorize them before, as mentioned later in this documentation.

This sample shows how to call the update status API and tweet the given text.

JSON APIs

The example below demonstrates how to call APIs with JSON body (like the direct message API). This sample shows how to call sending direct message API and send the given message to the given user.

Uploading Media

You might need to upload media. For example, if you want to tweet a photo, you need to upload it first. The following example illustrates how to upload a photo and tweet it.

Authorize Users (Login with Twitter)

This section explains how to authorize users to get their tokens and token secrets. It's an implementation of "Login with Twitter" indeed.

Request for Token and Redirection Link

First, you must request a user token and confirm your callback URL implicitly (Consider setting your callback URL in your Twitter Developer Portal). Then you can redirect the user to the Twitter website to approve your request (token).

Twitter Callback

When a user approves your request (token) on the Twitter website, Twitter redirects him to your callback URL. In the callback URL, you can verify the token. Then you can use the token for calling Twitter APIs on behalf of the user.

Timeout

In default, the HTTP (cURL) timeout is 10 seconds. You can set your desired timeout (in seconds) like the following example.

License

PhpRouter is initially created by Milad Rahimi and released under the MIT License.


All versions of twitter-bot with dependencies

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

Loading the files please wait ....