]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - plugins/TwitterBridge/README
Merge branch 'testing' of git@gitorious.org:statusnet/mainline into testing
[quix0rs-gnu-social.git] / plugins / TwitterBridge / README
1 Twitter Bridge Plugin
2 =====================
3
4 This Twitter "bridge" plugin allows you to integrate your StatusNet
5 instance with Twitter.  Installing it will allow your users to:
6
7     - automatically post notices to their Twitter accounts
8     - automatically subscribe to other Twitter users who are also using
9       your StatusNet install, if possible (requires running a daemon)
10     - import their Twitter friends' tweets (requires running a daemon)
11     - allow users to authenticate using Twitter ('Sign in with Twitter')
12
13 Installation
14 ------------
15
16 OAuth 1.0a (http://oauth.net) is used to to access protected resources
17 on Twitter (as opposed to HTTP Basic Auth)*.  To use Twitter bridging
18 you will need to register your instance of StatusNet as an application
19 on Twitter (http://twitter.com/apps).  During the application
20 registration process your application will be assigned a "consumer" key
21 and secret, which the plugin will use to make OAuth requests to Twitter.
22 You can either pass the consumer key and secret in when you enable the
23 plugin, or set it using the Twitter administration panel.
24
25 When registering your application with Twitter set the type to "Browser"
26 and your Callback URL to:
27
28     http://example.org/mublog/twitter/authorization
29
30 (Change "example.org" to your site domain and "mublog" to your site
31 path.)
32
33 The default access type should be "Read & Write".
34
35 To enable the plugin, add the following to your config.php:
36
37     addPlugin(
38         'TwitterBridge',
39         array(
40             'consumer_key'    => 'YOUR_CONSUMER_KEY',
41             'consumer_secret' => 'YOUR_CONSUMER_SECRET'
42         )
43     );
44
45 * Note: The plugin will still push notices to Twitter for users who
46   have previously set up the Twitter bridge using their Twitter name and
47   password under an older version of StatusNet, but all new Twitter
48   bridge connections will use OAuth.
49
50 Administration panel
51 --------------------
52
53 As of StatusNet 0.9.0 there is a new administration panel that allows
54 you to configure Twitter bridge settings within StatusNet itself,
55 instead of having to specify them manually in your config.php.  To enable
56 the administration panel, you will need to add it to the list of active
57 administration panels.  You can do this via your config.php. E.g.:
58
59     $config['admin']['panels'][] = 'twitter';
60
61 And to access it, you'll need to use a user with the "administrator"
62 role (see: scripts/userrole.php).
63
64 Sign in with Twitter
65 --------------------
66
67 With 0.9.0, StatusNet optionally allows users to register and
68 authenticate using their Twitter credentials via the "Sign in with
69 Twitter" pattern described here:
70
71     http://apiwiki.twitter.com/Sign-in-with-Twitter
72
73 The option is _on_ by default when you install the plugin, but it can
74 disabled via the Twitter bridge administration panel, or by adding the
75 following line to your config.php:
76
77     $config['twitter']['signin'] = false;
78
79 Daemons
80 -------
81
82 For friend syncing and importing Twitter tweets, running two
83 additional daemon scripts is necessary: synctwitterfriends.php and
84 twitterstatusfetcher.php.
85
86 In the daemons subdirectory of the plugin are three scripts:
87
88 * Twitter Friends Syncing (daemons/synctwitterfriends.php)
89
90 Users may set a flag in their settings ("Subscribe to my Twitter friends
91 here" under the Twitter tab) to have StatusNet attempt to locate and
92 subscribe to "friends" (people they "follow") on Twitter who also have
93 accounts on your StatusNet system, and who have previously set up a link
94 for automatically posting notices to Twitter.
95
96 The plugin will start this daemon when you run scripts/startdaemons.sh.
97
98 * Importing statuses from Twitter (daemons/twitterstatusfetcher.php)
99
100 You can allow uses to enable importing of your friends' Twitter
101 timelines either in the Twitter bridge administration panel or in your
102 config.php using the following configuration line:
103
104     $config['twitterimport']['enabled'] = true;
105
106 The plugin will then start the TwitterStatusFetcher daemon along with the
107 other daemons when you run scripts/startdaemons.sh.
108
109 Additionally, you will want to set the integration source variable,
110 which will keep notices posted to Twitter via StatusNet from looping
111 back.  You can do this in the Twitter bridge administration panel, or
112 via config.php. The integration source should be set to the name of your
113 application _exactly_ as you specified it on the settings page for your
114 StatusNet application on Twitter, e.g.:
115
116     $config['integration']['source'] = 'YourApp';
117
118 * TwitterQueueHandler (daemons/twitterqueuehandler.php)
119
120 This script sends queued notices to Twitter for user who have opted to
121 set up Twitter bridging.
122
123 It's not strictly necessary to run this queue handler, and sites that
124 haven't enabled queuing are still able to push notices to Twitter, but
125 for larger sites and sites that wish to improve performance the script
126 allows notices to be sent "offline" via a separate process.
127
128 StatusNet will automatically use the TwitterQueueHandler if you have
129 enabled the queuing subsystem.  See the "Queues and daemons" section of
130 the main README file for more information about how to do that.