README 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. Twitter Bridge Plugin
  2. =====================
  3. This Twitter "bridge" plugin allows you to integrate your StatusNet
  4. instance with Twitter. Installing it will allow your users to:
  5. - automatically post notices to their Twitter accounts
  6. - automatically subscribe to other Twitter users who are also using
  7. your StatusNet install, if possible (requires running a daemon)
  8. - import their Twitter friends' tweets (requires running a daemon)
  9. - allow users to authenticate using Twitter ('Sign in with Twitter')
  10. Installation
  11. ------------
  12. OAuth 1.0a (http://oauth.net) is used to to access protected resources
  13. on Twitter. To use Twitter bridging you will need to register your
  14. instance of StatusNet as an application on Twitter (http://twitter.com/apps).
  15. During the application registration process your application will be assigned
  16. a "consumer" key and secret, which the plugin will use to make OAuth requests
  17. to Twitter. You can either pass the consumer key and secret in when you
  18. enable the plugin, or set it using the Twitter administration panel.
  19. When registering your application with Twitter set the type to "Browser"
  20. and your Callback URL to:
  21. http://example.org/mublog/twitter/authorization
  22. (Change "example.org" to your site domain and "mublog" to your site
  23. path.)
  24. The default access type should be "Read & Write".
  25. To enable the plugin, add the following to your config.php:
  26. addPlugin(
  27. 'TwitterBridge',
  28. array(
  29. 'consumer_key' => 'YOUR_CONSUMER_KEY',
  30. 'consumer_secret' => 'YOUR_CONSUMER_SECRET'
  31. )
  32. );
  33. or if you want to set the variables from the website's administration panel:
  34. addPlugin('TwitterBridge');
  35. After saving your configuration file, please run 'php scripts/upgrade.php'
  36. and also restart the background daemons if they are active on your instance.
  37. Administration panel
  38. --------------------
  39. To access the administration panel, you'll need to use a user with the
  40. "administrator" role (see: scripts/userrole.php).
  41. Sign in with Twitter
  42. --------------------
  43. GNU social optionally allows users to register and authenticate using their
  44. Twitter credentials via the "Sign in with Twitter" pattern described here:
  45. https://dev.twitter.com/web/sign-in
  46. The option is _on_ by default when you install the plugin, but it can
  47. disabled via the Twitter bridge administration panel, or by adding the
  48. following line to your config.php:
  49. $config['twitter']['signin'] = false;
  50. Daemons
  51. -------
  52. For friend syncing and importing Twitter tweets, running two
  53. additional daemon scripts is necessary: synctwitterfriends.php and
  54. twitterstatusfetcher.php.
  55. In the daemons subdirectory of the plugin are three scripts:
  56. * Twitter Friends Syncing (daemons/synctwitterfriends.php)
  57. Users may set a flag in their settings ("Subscribe to my Twitter friends
  58. here" under the Twitter tab) to have StatusNet attempt to locate and
  59. subscribe to "friends" (people they "follow") on Twitter who also have
  60. accounts on your StatusNet system, and who have previously set up a link
  61. for automatically posting notices to Twitter.
  62. The plugin will start this daemon when you run scripts/startdaemons.sh.
  63. * Importing statuses from Twitter (daemons/twitterstatusfetcher.php)
  64. You can allow uses to enable importing of your friends' Twitter
  65. timelines either in the Twitter bridge administration panel or in your
  66. config.php using the following configuration line:
  67. $config['twitterimport']['enabled'] = true;
  68. The plugin will then start the TwitterStatusFetcher daemon along with the
  69. other daemons when you run scripts/startdaemons.sh.
  70. Additionally, you will want to set the integration source variable,
  71. which will keep notices posted to Twitter via StatusNet from looping
  72. back. You can do this in the Twitter bridge administration panel, or
  73. via config.php. The integration source should be set to the name of your
  74. application _exactly_ as you specified it on the settings page for your
  75. StatusNet application on Twitter, e.g.:
  76. $config['integration']['source'] = 'YourApp';
  77. * TwitterQueueHandler (daemons/twitterqueuehandler.php)
  78. This script sends queued notices to Twitter for user who have opted to
  79. set up Twitter bridging.
  80. It's not strictly necessary to run this queue handler, and sites that
  81. haven't enabled queuing are still able to push notices to Twitter, but
  82. for larger sites and sites that wish to improve performance the script
  83. allows notices to be sent "offline" via a separate process.
  84. StatusNet will automatically use the TwitterQueueHandler if you have
  85. enabled the queuing subsystem. See the "Queues and daemons" section of
  86. the main README file for more information about how to do that.