All Projects → CVO-Technologies → cakephp-twitter

CVO-Technologies / cakephp-twitter

Licence: MIT license
Twitter webservice plugin for CakePHP

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to cakephp-twitter

project-template-cakephp
🍰 Template for CakePHP-based projects
Stars: ✭ 22 (+15.79%)
Mutual labels:  cakephp
PHP-Frameworks-Bench
Popular PHP Frameworks Benchmark.
Stars: ✭ 28 (+47.37%)
Mutual labels:  cakephp
ip2location-cakephp
IP2Location CakePHP plugin enables the user to find the country, region, city, coordinates, zip code, time zone, ISP, domain name, connection type, area code, weather, MCC, MNC, mobile brand name, elevation, usage type, IP address type and IAB advertising category from IP address using IP2Location database.
Stars: ✭ 17 (-10.53%)
Mutual labels:  cakephp
elastic-search
Elastic search datasource for CakePHP
Stars: ✭ 85 (+347.37%)
Mutual labels:  cakephp
asset-mix
Provides helpers functions for CakePHP to use Laravel Mix.
Stars: ✭ 27 (+42.11%)
Mutual labels:  cakephp
crud-json-api
Build advanced JSON API Servers with almost no code.
Stars: ✭ 47 (+147.37%)
Mutual labels:  cakephp
cakephp-i18n
A CakePHP plugin with I18n related tools.
Stars: ✭ 40 (+110.53%)
Mutual labels:  cakephp
mongodb-cakephp3
An Mongodb datasource for CakePHP 3.0
Stars: ✭ 29 (+52.63%)
Mutual labels:  cakephp
cakephp-glide
CakePHP plugin for using Glide image manipulation library
Stars: ✭ 34 (+78.95%)
Mutual labels:  cakephp
cakephp-mailgun
Mailgun plugin for CakePHP 3
Stars: ✭ 23 (+21.05%)
Mutual labels:  cakephp
php-orm-benchmark
The benchmark to compare performance of PHP ORM solutions.
Stars: ✭ 82 (+331.58%)
Mutual labels:  cakephp
cakephp-translate
A CakePHP plugin to manage translations of your static content the easy way via web backend.
Stars: ✭ 18 (-5.26%)
Mutual labels:  cakephp
cakephp-sequence
CakePHP plugin for maintaining a contiguous sequence of records
Stars: ✭ 41 (+115.79%)
Mutual labels:  cakephp
webadmin
SophiMail Webadmin and Dashboard
Stars: ✭ 48 (+152.63%)
Mutual labels:  cakephp
CakePHP-Shell-Scripts
Reusable CakePHP project shell scripts.
Stars: ✭ 16 (-15.79%)
Mutual labels:  cakephp
cakephp-swagger-bake
Automatically generate OpenAPI, Swagger, and Redoc documentation from your existing CakePHP code.
Stars: ✭ 48 (+152.63%)
Mutual labels:  cakephp
cakephp-swagger
Swagger plugin for documenting your CakePHP APIs
Stars: ✭ 61 (+221.05%)
Mutual labels:  cakephp
rector-cakephp
Rector upgrades rules for CakePHP
Stars: ✭ 18 (-5.26%)
Mutual labels:  cakephp
cake.vim
Utility for CakePHP developers.
Stars: ✭ 35 (+84.21%)
Mutual labels:  cakephp
foodcoopshop
Open source software for food coops and local shops 🥕🍏 🧀
Stars: ✭ 60 (+215.79%)
Mutual labels:  cakephp

Twitter plugin

Software License Build Status Coverage Status Total Downloads Latest Stable Version

Installation

Using Composer

composer require cvo-technologies/cakephp-twitter

Ensure require is present in composer.json:

{
    "require": {
        "cvo-technologies/cakephp-twitter": "~1.1"
    }
}

Load the plugin

Plugin::load('Muffin/Webservice', ['bootstrap' => true]);
Plugin::load('CvoTechnologies/Twitter');

Configure the Twitter webservice

Add the following to the Datasources section of your application config.

        'twitter' => [
            'className' => 'Muffin\Webservice\Connection',
            'service' => 'CvoTechnologies/Twitter.Twitter',
            'consumerKey' => '',
            'consumerSecret' => '',
            'oauthToken' => '',
            'oauthSecret' => ''
        ]

Usage

Controller

namespace App\Controller;

use Cake\Event\Event;

class StatusesController extends AppController
{
    public function beforeFilter(Event $event)
    {
        $this->loadModel('CvoTechnologies/Twitter.Statuses', 'Endpoint');
    }

    public function index()
    {
        $statuses = $this->Statuses->find()->where([
            'screen_name' => 'CakePHP',
        ]);

        $this->set('statuses', $statuses);
    }
}

Streaming example

This is an example of how to implement the Twitter streaming API.

namespace App\Shell;

use Cake\Console\Shell;

class StreamShell extends Shell
{
    public function initialize()
    {
        $this->modelFactory('Endpoint', ['Muffin\Webservice\Model\EndpointRegistry', 'get']);
        $this->loadModel('CvoTechnologies/Twitter.Statuses', 'Endpoint');
    }

    public function main()
    {
        $statuses = $this->Statuses
            ->find('filterStream', [
                'word' => 'twitter',
            ]);

        foreach ($statuses as $status) {
            echo $status->text . PHP_EOL;
        }
    }
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].