2017 © Pedro Peláez
 

symfony-bundle twitter-bundle

Twitter login and other functionalities

image

trendix/twitter-bundle

Twitter login and other functionalities

  • Monday, May 22, 2017
  • by Jose
  • Repository
  • 0 Watchers
  • 1 Stars
  • 3 Installations
  • JavaScript
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Trendix Twitter Bundle

Welcome to our brand new Twitter Bundle. With this bundle, you can easily authenticate a user at twitter so your Symfony 2.8 or 3.* application can read and tweet on user's behalf with their authorization., (*1)

This project is still at alpha, but we are going to improve its functionality and documentation soon enough., (*2)

How can I install this bundle?

  1. Install our bundle using composer:
composer require trendix/twitter-bundle
  1. Create and configure a Twitter app, if you don't have one already.
  2. In the app Setting, set the Callback URL to the URL use to login and redirect the user to the app (by default the route is called trendix_twitter_login, look at TwitterController:twitterLogin).
  3. Add to the Kernel our bundle:
$bundles = array(
    new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
    ...
    new Trendix\TwitterBundle\TrendixTwitterBundle(),
);

  1. Add also the routing configuration to your routing.yml:
trendix_twitter:
    resource: "@TrendixTwitterBundle/Resources/config/routing.yml"
    prefix:   /
  1. Add these five parameters to your parameters.yml with your twitter app data:, at "Keys and Access Tokens" tab:
parameters:
    ...
    secret: ThisTokenIsNotSoSecretChangeIt
    twitter_consumer: '' # Consumer Key (API Key)
    twitter_consumer_secret: '' # Consumer Secret (API Secret)
    twitter_access_token: '' # Access Token
    twitter_access_token_secret: '' # Access Token Secret
    twitter_salt: '' # Used for security. Just put a phrase or any string and don't tell it to anyone else.

How can I use this bundle?

Just follow our DefaultController:test example. Just include our twitter_widget and twitter_includes in your template and it should be ready to work., (*3)

You can always use your own css to overwrite its style, (*4)

Custom your widget

Using our controllers as an example, you can easily change the twig template, css, js or even do completely different controllers. The TwitterAPI class is the center of the twitter behaviour, so you can use only that if you want :D, (*5)

EU Warning

Our bundle uses the jquery.cookie plugin to store the user token data so the browser can keep their session when refreshing or changing pages. Disabling this feature is not recommended, but if you work at the EU, yo have to state your Cookies Policy and request the user for their consent before using these cookies., (*6)

We recommend using http://cookiecuttr.com/ in order to avoid any legal issues., (*7)

The Versions

22/05 2017

dev-master

9999999-dev

Twitter login and other functionalities

  Sources   Download

MIT