Skip to content

Yet another Twitter plugin, was just easier to add one using my APIs plugin

Notifications You must be signed in to change notification settings

CakePHP-Copula/Twitter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

NOTE:

When you register your app with Twitter, make sure you create create a placeholder callback in your app settings, or you will be locked to OOB auth. The callback can be anything, it's simply a placeholder.

Installation

Step 1: Download / clone the following plugins:

Step 2: Setup your database.php

var $twitter = array(
	'datasource' => 'Twitter.Twitter',
	'login' => '<twitter api key>',
	'password' => '<twitter api secret>',
);

Step 3: Install the Apis-OAuth Component for authentication

MyController extends AppController {
	var $components = array(
		'Apis.Oauth' => 'twitter',
	);
	
	function connect() {
		$this->Oauth->connect();
	}
	
	function twitter_callback() {
		$this->Oauth->callback();
	}
}

Step 4: Use the datasource normally

Check the config file for a list of available 'sections' and the parameters they take

Class MyModel extends AppModel {
	
	public function afterSave($created) {
		if ($created) {
			// Auto Tweet
			$this->setDataSource('twitter');
			$data = array(
				'section' => 'tweets',
				'status' => $this->data['Bookmark']['name'] . ' ' . $this->data['Bookmark']['url']
			);
			$this->create();
			$this->save($data);
			$this->setDataSource('default');
		}
	}
}

About

Yet another Twitter plugin, was just easier to add one using my APIs plugin

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages