]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - plugins/TwitterBridge/README
d7dfe20de5922e5ce4f88c06c1b81f0fada20972
[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 or just:
46
47    addPlugin('TwitterBridge');
48
49 if you want to set the consumer key and secret from the Twitter bridge
50 administration panel.  (The Twitter bridge wont work at all
51 unless you configure it with a consumer key and secret.)
52
53 * Note: The plugin will still push notices to Twitter for users who
54   have previously set up the Twitter bridge using their Twitter name and
55   password under an older version of StatusNet, but all new Twitter
56   bridge connections will use OAuth.
57
58 ** For multi-site setups you can also set a global consumer key and
59    secret.  The Twitter bridge will fall back on the global key pair if
60    it can't find a local pair, e.g.:
61
62    $config['twitter']['global_consumer_key']    = 'YOUR_CONSUMER_KEY';
63    $config['twitter']['global_consumer_secret'] = 'YOUR_CONSUMER_SECRET';
64
65 Administration panel
66 --------------------
67
68 As of StatusNet 0.9.0 there is a new administration panel that allows
69 you to configure Twitter bridge settings within StatusNet itself,
70 instead of having to specify them manually in your config.php.  To enable
71 the administration panel, you will need to add it to the list of active
72 administration panels.  You can do this via your config.php. E.g.:
73
74     $config['admin']['panels'][] = 'twitter';
75
76 And to access it, you'll need to use a user with the "administrator"
77 role (see: scripts/userrole.php).
78
79 Sign in with Twitter
80 --------------------
81
82 With 0.9.0, StatusNet optionally allows users to register and
83 authenticate using their Twitter credentials via the "Sign in with
84 Twitter" pattern described here:
85
86     http://apiwiki.twitter.com/Sign-in-with-Twitter
87
88 The option is _on_ by default when you install the plugin, but it can
89 disabled via the Twitter bridge administration panel, or by adding the
90 following line to your config.php:
91
92     $config['twitter']['signin'] = false;
93
94 Daemons
95 -------
96
97 For friend syncing and importing Twitter tweets, running two
98 additional daemon scripts is necessary: synctwitterfriends.php and
99 twitterstatusfetcher.php.
100
101 In the daemons subdirectory of the plugin are three scripts:
102
103 * Twitter Friends Syncing (daemons/synctwitterfriends.php)
104
105 Users may set a flag in their settings ("Subscribe to my Twitter friends
106 here" under the Twitter tab) to have StatusNet attempt to locate and
107 subscribe to "friends" (people they "follow") on Twitter who also have
108 accounts on your StatusNet system, and who have previously set up a link
109 for automatically posting notices to Twitter.
110
111 The plugin will start this daemon when you run scripts/startdaemons.sh.
112
113 * Importing statuses from Twitter (daemons/twitterstatusfetcher.php)
114
115 You can allow uses to enable importing of your friends' Twitter
116 timelines either in the Twitter bridge administration panel or in your
117 config.php using the following configuration line:
118
119     $config['twitterimport']['enabled'] = true;
120
121 The plugin will then start the TwitterStatusFetcher daemon along with the
122 other daemons when you run scripts/startdaemons.sh.
123
124 Additionally, you will want to set the integration source variable,
125 which will keep notices posted to Twitter via StatusNet from looping
126 back.  You can do this in the Twitter bridge administration panel, or
127 via config.php. The integration source should be set to the name of your
128 application _exactly_ as you specified it on the settings page for your
129 StatusNet application on Twitter, e.g.:
130
131     $config['integration']['source'] = 'YourApp';
132
133 * TwitterQueueHandler (daemons/twitterqueuehandler.php)
134
135 This script sends queued notices to Twitter for user who have opted to
136 set up Twitter bridging.
137
138 It's not strictly necessary to run this queue handler, and sites that
139 haven't enabled queuing are still able to push notices to Twitter, but
140 for larger sites and sites that wish to improve performance the script
141 allows notices to be sent "offline" via a separate process.
142
143 StatusNet will automatically use the TwitterQueueHandler if you have
144 enabled the queuing subsystem.  See the "Queues and daemons" section of
145 the main README file for more information about how to do that.