定制 mikke/twitter 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mikke/twitter

Composer 安装命令:

composer require mikke/twitter

包简介

Small TW Connector

README 文档

README

A Basic & Light Twitter Connector for Laravel 4.1

Please contribute!

I know there are a lot of packages for this, or library to do it, just i feel it is too much to include, to much process for the goal i had. Just simple as that, Connect, Authorize, Get User Data, my application does not need to push to tw, in the near future, i'll add more things!

Installation

Using Composer composer.

You need to add the repo for the project first in your composer.json:

	"repositories": [
        {
            "type":"vcs",
            "url": "https://github.com/mikkezavala/twitter.git"
        }
    ]

In the same require the package:

	{
	    "require": {
			"mikke/twitter": ">=0.0.4",
	    }
	}

Then just run a composer update

	$ composer update	

You can add the alias in your app/config/app.php

		'Twitter'  		  => 'Mikke\Twitter\Twitter',

Usage

It can be called in your controller wherever you want, just this a quick example, conecting and getting back basic information

You can create a config file, use existent one, or whatever you want to manage the keys, in my case i created a file called app/config/api.php and it looks like:

File: app/config/api.php

	return array(
		'twitter' => array(
			'api_key' => 'XXXXXXXXXXXXXXX',
			'api_secret' => 'XXXXXXXXXXXXXXXXXXXX',
			'api_callback' => 'http://some.com/callback',
			'api_token' => '',
			'api_token_secret' => '',
		)
	);

File: app/routes.php

	Route::get('/', function(){
		$twitter = new TwitterConnect(Config::get('api.twitter'));
		$twitter->authorize();
	});
	Route::get('twitter/validate', function(){
		
		Config::set('api.twitter.api_token', Input::get('oauth_token'));
		$twitter = new TwitterConnect(Config::get('api.twitter'));
		
		if($twitter->access_token(Input::get('oauth_verifier'))){
			$data = $twitter->user_data();
			print_r($data);
		}
		
		
	});

Contribute

This is just a simple connector, you can fork me, or contribute to this, the idea is this to make it easier, and collaborative, in the next week i'll be releasing more connectors

统计信息

  • 总下载量: 15
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2014-05-17

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固