]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - plugins/TwitterBridge/README
Merge branch 'testing' of gitorious.org:statusnet/mainline into testing
[quix0rs-gnu-social.git] / plugins / TwitterBridge / README
1 This Twitter "bridge" plugin allows you to integrate your StatusNet
2 instance with Twitter.  Installing it will allow your users to:
3
4     - automatically post notices to their Twitter accounts
5     - automatically subscribe to other Twitter users who are also using
6       your StatusNet install, if possible (requires running a daemon)
7     - import their Twitter friends' tweets (requires running a daemon)
8
9 Installation
10 ------------
11
12 OAuth (http://oauth.net) is used to to access protected resources on
13 Twitter (as opposed to HTTP Basic Auth)*.  To use Twitter bridging you
14 will need to register your instance of StatusNet as an application on
15 Twitter (http://twitter.com/apps). During the application registration
16 process your application will be assigned a "consumer" key and secret,
17 which the plugin will use to make OAuth requests to Twitter.  You can
18 either pass the consumer key and secret in when you enable the plugin,
19 or set it using the Twitter administration panel.
20
21 When registering your application with Twitter set the type to "Browser"
22 and your Callback URL to:
23
24     http://example.org/mublog/twitter/authorization
25
26 The default access type should be, "Read & Write".
27
28 To enable the plugin, add the following to your config.php:
29
30     addPlugin(
31         'TwitterBridge',
32         array(
33             'consumer_key'    => 'YOUR_CONSUMER_KEY',
34             'consumer_secret' => 'YOUR_CONSUMER_SECRET'
35         )
36     );
37
38 * Note: The plugin will still push notices to Twitter for users who
39   have previously setup the Twitter bridge using their Twitter name and
40   password under an older versions of StatusNet, but all new Twitter
41   bridge connections will use OAuth.
42
43 Deamons
44 -------
45
46 For friend syncing and importing notices running two additional daemon
47 scripts is necessary (synctwitterfriends.php and
48 twitterstatusfetcher.php).
49
50 In the daemons subidrectory of the plugin are three scripts:
51
52 * Twitter Friends Syncing (daemons/synctwitterfriends.php)
53
54 Users may set a flag in their settings ("Subscribe to my Twitter friends
55 here" under the Twitter tab) to have StatusNet attempt to locate and
56 subscribe to "friends" (people they "follow") on Twitter who also have
57 accounts on your StatusNet system, and who have previously set up a link
58 for automatically posting notices to Twitter.
59
60 The plugin will try to start this daemon when you run
61 scripts/startdaemons.sh.
62
63 * Importing statuses from Twitter (daemons/twitterstatusfetcher.php)
64
65 To allow your users to import their friends' Twitter statuses, you will
66 need to enable the bidirectional Twitter bridge in your config.php:
67
68     $config['twitterimport']['enabled'] = true;
69
70 The plugin will then start the TwitterStatusFetcher daemon along with the
71 other daemons when you run scripts/startdaemons.sh.
72
73 Additionally, you will want to set the integration source variable,
74 which will keep notices posted to Twitter via StatusNet from looping
75 back.  The integration source should be set to the name of your
76 application, exactly as you specified it on the settings page for your
77 StatusNet application on Twitter, e.g.:
78
79     $config['integration']['source'] = 'YourApp';
80
81 * TwitterQueueHandler (daemons/twitterqueuehandler.php)
82
83 This script sends queued notices to Twitter for user who have opted to
84 set up Twitter bridging.
85
86 It's not strictly necessary to run this queue handler, and sites that
87 haven't enabled queuing are still able to push notices to Twitter, but
88 for larger sites and sites that wish to improve performance, this
89 script allows notices to be sent "offline" via a separate process.
90
91 The plugin will start this script when you run scripts/startdaemons.sh.