Download the PHP package craftpulse/craft-tweet-feed without Composer

On this page you can find all versions of the php package craftpulse/craft-tweet-feed. 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 craft-tweet-feed

Tweet Feed plugin for Craft CMS 4.x

Get the latest tweets from a Twitter handle with your own design

Requirements

This plugin requires Craft CMS 3.5.0 or later. We utilise Guzzle 6 and up (7 included) and Twitter v2.0.

Installation

To install the plugin, follow these instructions.

  1. Open your terminal and go to your Craft project:

    cd /path/to/project
  2. Tell Composer to load the plugin:

    composer require percipiolondon/craft-tweet-feed
  3. In the Control Panel, go to Settings → Plugins and click the “Install” button for Tweet.

Tweet Feed Overview

This plugin provides a Twitter feed from a specific Twitter handle.

Configuring Tweet Feed

To make this happen, you need to make an app in the Developers Portal. Make sure it's not a standalone app because we use the Twitter API 2.0.

Create your keys and tokens and paste them into the plugin settings page. Make sure you create an OAuth 1.0a and generate the access tokens.

Besides the keys and tokens, we also require the Twitter user id to provide the tweets from a specific handle. If you don't know the id, you can look it op on this site.

You can provide all of this inside of your environment file.

Using Tweet Feed

To make use of Tweet Feed, we created a Craft variable to fetch.

The craft.tweetfeed.tweets() function can have 3 parameters.

First param: amount of results (default: 100)

The first one will ask for the number of results you want to receive. There's a maximum of 100 results that can be fetched. Here's a list of all the Twitter API v2 rate limits.

example: 3

Second param: types of fields (default: null)

The types of fields are the data you want to receive from Twitter. By default, the id and text are provided. We also add the entities so you can already use the tweet url. To know all the options, you can visit the Tweet object page.

Always provide the list with a comma as separation.

example: author_id,context_annotations

Third param: extra parameters (default: '')

If you want to extend the query, you can add extra parameters to the url. The max_results and tweet.fields are already used in the previously shown parameters. To know which kind of parameters excists, you can visit the GET /2/users/:id/tweets page and scroll to 'Query parameters'.

To provide these parameters for our plugin, use the following example. You can tie parameters to each other by using &.

example: &exclude=retweets,replies&user.fields=id

Twig example

urlify twig extension filter

If you want to parse the URLs and hashtags into clickable urls, you can use the | urlify filter. You need to pass down the full object to get the filtered tweet text back.

Use cache tag to reduce calls

There is a limit on API calls per day. If you have a high traffic site, we recommend using the cache tag from CraftCMS to reduce calls.

For example:

Tweet Feed Roadmap

Some updates to do and ideas for potential features:

Brought to you by percipiolondon


All versions of craft-tweet-feed with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0.2
craftcms/cms Version ^4.0.0-beta.1
guzzlehttp/oauth-subscriber Version ^0.6.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 craftpulse/craft-tweet-feed contains the following files

Loading the files please wait ....