Download the PHP package mfrost503/wheedle without Composer

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

Wheedle

A PHP Twitter library

Scrutinizer Code Quality Build Status

This library is currently a work in progress, more examples to follow as they get built out!

Wheedle provides a common sense way to interacting with the Twitter API. Built using Guzzle and Snaggle, you'll never have to worry about those pesky OAuth 1 signatures. Getting started is as simple as passing in your tokens.

Here's an example of how easy is it to get started!

Table of Contents:

The Basics

This library is a balance of convenience methods and an intuitive HTTP Client built on Guzzle. By utilizing Guzzle and Snaggle, we're able to minimize the amount of setup required to start making Authenticated API requests against the Twitter API. Nearly every endpoint in the Twitter API is going to have additional options that are available to you. If there is a convenience method for that particular endpoint, the options will be provided, however it may be necessary to consult Twitter API Docs for more information on your particular endpoint.

The aim is to take the pain out of dealing with the Twitter API and other wrappers and libraries that don't give you what you need. We aim to provide as much convenience and ease of use as possible. If you see something that doesn't seem right or could be done better, contributions (issues, pull requests, feature requests) are always welcome.

Convenience Classes Methods

Tweet

The Tweet class will allow you to retrieve and post tweets (or statuses).

Retrieve

To retrieve a tweet, you'll need to know the ID of the tweet and pass it as a parameter to the retrieve method:

Optionally you can pass an array of parameters to give you back what you need, for retrieve the parameters are:

These parameters are completely optional, so you can include all or none of them

Mentions

To retrieve a collection of tweets in which the authenticated user was mentioned (@yourhandle), you can use the retrieveMentions method:

The optional parameters for this method are:

Home Timeline

To retrieve a collection of tweets from all the users you follow:

The optional parameters for this method are:

User Timeline

To retrieve a timeline of all your tweets:

The optional parameters for this method are:

My Tweets - Retweeted by others

Retrieve a list of tweets that were retweeted by other users

The optional parameters for this method are:

Retieve Retweets

Retrieve all the retweeting accounts for a single tweet.

The optional parameters for this method are:

Send a Tweet

Create a new Tweet and post it to your timeline

The optional parameters for this method are:

Retweet an existing tweet

Retweet a tweet to your timeline

The optional parameters for this method are:

Delete an existing tweet

We all make mistakes right? Here's how'd you delete one of those mistakes...

The optional parameters for this method are:

Direct Client Usage

The convenience methods are great, they take a little bit extra to get set up, but certainly can make acceesing the API much easier. The reality is that every endpoint isn't going to be covered by a convenience method, so what this section is going to detail is how to use to make all the calls you require.

If we look at a simple example it should be pretty easy to see how these calls are made. Let's say we want to retrieve the tweet with the identifier of . Obviously with the convenience class and methods, we'd just instaniate a new instance and call the retrieve method with the id. With the client, it's almost as simple.

Of course we still have the ability to add the optional parameters to this call, so if we take the call to above, we can demonstrate how easy it is to add these parameters.

Optionally, you could also build out the query string yourself using however, the and interfaces were built to be used the same way. It's also important to note, the convenience methods will remove any options that endpoint doesn't support. Using the client directly, you will have to ensure that all the optional params that you are using are available for that endpoint.

Using the client requires a little bit of knowledge on how the Twitter API endpoints works, but a read through the documentation should make everything pretty easy to understand. Using this method will throw exceptions the same way the convenience methods do, so you get the same targeted exceptions regardless of the method you choose to go with.

Exceptions

Wheedle has a couple different exception types that can be thrown. These exceptions will indicate that a specific call was unable to complete correctly. There are a number of reasons for a call to fail, for example: bad tokens, rate limit exceeded or an attempt to make a call to a resource that doesn't exist. Below is a description of all the Exceptions that can be thrown.

RateLimitExceededException

A RateLimitExceededException is thrown when a particular access token has exceeded the number of calls allowed during the specified duration. It is important to note that the number of calls and durations are set and maintained by Twitter. This exception generally relates to the HTTP status code .

UnauthorizedRequestException

An UnauthorizedRequestException is thrown when an attempt is made to access a resource that the current credentials that don't belong to that Access Token/Secret. The most common reason for this exception would be a mistyped token or token secret, but this is also used to indicate that an authenticated user doesn't have access to the resource they are trying to access. This exception generally relates to HTTP Status Code .

MissingResourceException

A MissingResourceException is thrown when a call is made to an endpoint for which there is no resource. This could be due to a mistyped ID, a typo or some other clerical error. It's always important to check and make sure that you typed your endpoint and subsequent optional parameters correctly. This corresponds to HTTP status code .

TooManyCooksException

A TooManyCooksException is mostly just in here for fun. It's not required for use, nor will it ever be thrown directly. It can be used in place of the RateLimitExceededException in a catch block. To be clear, I wouldn't actually recommend using this exception. It's less descriptive and would probably be confusing. I added it because I wanted to and I thought it would be fun. A RateLimitExceededException will also be a TooManyCooksException type. So do with that what you will.


All versions of wheedle with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
guzzlehttp/guzzle Version >=5.0.0
mfrost503/snaggle Version >=0.3.0
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 mfrost503/wheedle contains the following files

Loading the files please wait ....