Index: trunk/extensions/TweetANew/TweetANew.body.php |
— | — | @@ -14,22 +14,25 @@ |
15 | 15 | /** |
16 | 16 | * Function for connecting to and preparing bitly |
17 | 17 | * |
18 | | - * @param $url |
| 18 | + * @param $longurl |
19 | 19 | * @param $login |
20 | 20 | * @param $appkey |
21 | 21 | * @return string |
22 | 22 | */ |
23 | | - public static function make_bitly_url($url,$login,$appkey) { |
| 23 | + public static function make_final_url($longurl,$login,$appkey) { |
24 | 24 | global $wgTweetANewBitly; |
25 | 25 | |
26 | | - # Check setting to enable/disable use of bit.ly |
| 26 | + # Check setting to enable/disable use of bitly |
27 | 27 | if ( $wgTweetANewBitly['Enable'] ) { |
28 | 28 | # Generate url for bitly |
29 | | - $bitly = "https://api-ssl.bitly.com/v3/shorten?longUrl=".urlencode($url)."&login=".$login."&apiKey=".$appkey."&format=txt"; |
| 29 | + $bitly = "https://api-ssl.bitly.com/v3/shorten?longUrl=".urlencode($longurl)."&login=".$login."&apiKey=".$appkey."&format=txt"; |
30 | 30 | # Get the url |
31 | 31 | $response = file_get_contents($bitly); |
32 | | - return $response; |
33 | 32 | } |
| 33 | + else { |
| 34 | + $response = $longurl; |
| 35 | + } |
| 36 | + return $response; |
34 | 37 | } |
35 | 38 | |
36 | 39 | # ToDo - TweetANewNewEditOption function for when auto-tweet is disabled to display checkbox on edit/create page to tweet new/edited pages |
— | — | @@ -49,10 +52,13 @@ |
50 | 53 | * @return bool |
51 | 54 | */ |
52 | 55 | public static function TweetANewNewArticle($article, $user, $text, $summary, $minoredit, $watchthis, $sectionanchor, $flags, $revision){ |
53 | | - global $wgTweetANewBitly,$wgTweetANewTwitter,$wgTweetANewTweet; |
| 56 | + global $wgTweetANewTweet,$wgTweetANewText,$wgTweetANewTwitter; |
54 | 57 | |
55 | 58 | # ToDo - Check if $wgTweetANewTweet['Auto'] is enabled |
56 | 59 | |
| 60 | + # Check if page is in content namespace |
| 61 | + if ( !MWNamespace::isContent( $article->getTitle()->getNamespace() ) ) return true; |
| 62 | + |
57 | 63 | # Make connection to Twitter |
58 | 64 | require_once('lib/tmhOAuth.php'); // include connection |
59 | 65 | $connection = new tmhOAuth(array( |
— | — | @@ -62,24 +68,58 @@ |
63 | 69 | 'user_secret' => $wgTweetANewTwitter['AccessTokenSecret'], |
64 | 70 | )); |
65 | 71 | |
66 | | - # Check setting to enable/disable use of bit.ly |
67 | | - if ( $wgTweetANewBitly['Enable'] ) { |
68 | | - # Shorten URL using bitly |
69 | | - $short = self::make_bitly_url($article->getTitle()->getFullURL(),$wgTweetANewBitly['Login'],$wgTweetANewBitly['API']); |
| 72 | + # Generate final url |
| 73 | + $finalurl = self::make_final_url($article->getTitle()->getFullURL(),$wgTweetANewBitly['Login'],$wgTweetANewBitly['API']); |
| 74 | + |
| 75 | + # Generate $author based on $wgTweetANewText['RealName'] |
| 76 | + if ( $wgTweetANewText['RealName'] ) { |
| 77 | + $author = $user->getRealName(); |
70 | 78 | } |
71 | 79 | else { |
72 | | - # Generate url without use of bitly |
73 | | - $short = $article->getTitle()->getFullURL(); |
| 80 | + $author = $user->getName(); |
74 | 81 | } |
| 82 | + |
| 83 | + # Generate a random tweet texts based if $wgTweetANewText['NewRandom'] is true |
| 84 | + if ( $wgTweetANewText['NewRandom'] ) { |
| 85 | + # Setup switcher using max number set by $wgTweetANewText['NewRandomMax'] |
| 86 | + $switcher = rand( 1, $wgTweetANewText['NewRandomMax'] ); |
| 87 | + # Parse random text |
| 88 | + $tweet_text .= wfMsg( 'tweetanew-new' . $switcher, array ( $article->getTitle()->getText(), $finalurl ) ); |
| 89 | + } |
| 90 | + else { |
| 91 | + # Use default tweet message format |
| 92 | + $tweet_body = wfMsg( 'tweetanew-newdefault', array ( $article->getTitle()->getText(), $finalurl ) ); |
| 93 | + $tweet_text .= $tweet_body; |
| 94 | + } |
| 95 | + |
| 96 | + # Add author info if $wgTweetANewText['NewAuthor'] is true |
| 97 | + if ( $wgTweetANewText['NewAuthor'] ) { |
| 98 | + $tweet_text .= ' '. wfMsg( 'tweetanew-authorcredit' ) .' '. $author; |
| 99 | + } |
| 100 | + |
| 101 | + # Add summary if $wgTweetANewText['NewSummary'] is true and summary text is entered |
| 102 | + if ( $summary && $wgTweetANewText['NewSummary'] ) { |
| 103 | + $tweet_text .= ' - ' . $summary; |
| 104 | + } |
| 105 | + |
| 106 | + # Calculate length of tweet factoring in longURL |
| 107 | + if (strlen($finalurl) > 20) { |
| 108 | + $tweet_text_count = (strlen($finalurl) - 20) + 140; |
| 109 | + } |
| 110 | + else { |
| 111 | + $tweet_text_count = 140; |
| 112 | + } |
| 113 | + |
| 114 | + # Check if length of tweet is beyond 140 characters and shorten if necessary |
| 115 | + if (strlen($tweet_text) > $tweet_text_count) { |
| 116 | + $tweet_text = substr($tweet_text,0, $tweet_text_count); |
| 117 | + } |
| 118 | + |
75 | 119 | # Make tweet message |
76 | | - $tweet_text = "NEW ARTICLE: ".$article->getTitle()->getText()." ".$short; |
77 | | - # Check if page is in content namespace |
78 | | - if ( MWNamespace::isContent( $article->getTitle()->getNamespace() ) ) { |
79 | | - $connection->request('POST', |
80 | | - $connection->url('1/statuses/update'), |
81 | | - array('status' => $tweet_text) |
82 | | - ); |
83 | | - } |
| 120 | + $connection->request('POST', |
| 121 | + $connection->url('1/statuses/update'), |
| 122 | + array('status' => $tweet_text) |
| 123 | + ); |
84 | 124 | return true; |
85 | 125 | } |
86 | 126 | |
— | — | @@ -98,10 +138,13 @@ |
99 | 139 | * @return bool |
100 | 140 | */ |
101 | 141 | public static function TweetANewEditMade(&$article, &$user, $text, $summary, $minoredit, $watchthis, $sectionanchor, &$flags, $revision, &$status, $baseRevId, &$redirect){ |
102 | | - global $wgTweetANewBitly,$wgTweetANewTwitter,$wgTweetANewTweet,$wgArticle; |
| 142 | + global $wgTweetANewTweet,$wgTweetANewText,$wgTweetANewTwitter,$wgArticle; |
103 | 143 | |
104 | 144 | # ToDo - Check if $wgTweetANewTweet['Auto'] is enabled |
105 | 145 | |
| 146 | + # Check if page is in content namespace |
| 147 | + if ( !MWNamespace::isContent( $article->getTitle()->getNamespace() ) ) return true; |
| 148 | + |
106 | 149 | # Determine the time and date of last modification - skip if newer than $wgTweetANewTweet['lessminold'] setting |
107 | 150 | # ToDo - there must be a cleaner way of doing this |
108 | 151 | $dbr = wfGetDB( DB_SLAVE ); |
— | — | @@ -111,45 +154,84 @@ |
112 | 155 | $edittimelast = mktime(substr($edittime[1],8,2),substr($edittime[1],10,2),substr($edittime[1],12),substr($edittime[1],4,2),substr($edittime[1],6,2),substr($edittime[1],0,4)); |
113 | 156 | $edittimediv = $edittimenow - $edittimelast; |
114 | 157 | $mailtext['time_since_last_edit'] = $edittimediv; |
115 | | - if(isset($wgTweetANewTweet['lessminold'])) if ($edittimediv < ($wgTweetANewTweet['lessminold'] * 60)) return true; |
| 158 | + if( isset( $wgTweetANewTweet['LessMinutesOld'] ) ) if ($edittimediv < ($wgTweetANewTweet['LessMinutesOld'] * 60) ) return true; |
116 | 159 | |
117 | 160 | # Only proceed if this is not the first edit to the article, in which case it's new and TweetANewNewArticle is used instead |
118 | | - if ($wgArticle->estimateRevisionCount() == 1 ) return true; |
| 161 | + if ( $wgArticle->estimateRevisionCount() == 1 ) return true; |
119 | 162 | |
120 | 163 | # Check $wgTweetANewTweet['SkipMinor'] setting to see if minor edits should be skipped |
121 | | - if ($minoredit !== 0 && $wgTweetANewTweet['SkipMinor']) return true; |
| 164 | + if ( $minoredit !== 0 && $wgTweetANewTweet['SkipMinor'] ) return true; |
122 | 165 | |
123 | | - # ToDo - If !$wgTweetANewTweet['SkipMinor'] and $wgTweetANewTweet['TagMinor'] add "m" to tweet |
124 | | - |
125 | 166 | # Make connection to Twitter |
126 | 167 | require_once('lib/tmhOAuth.php'); // include connection |
127 | | - $connection = new tmhOAuth(array( |
| 168 | + $connection = new tmhOAuth( array ( |
128 | 169 | 'consumer_key' => $wgTweetANewTwitter['ConsumerKey'], |
129 | 170 | 'consumer_secret' => $wgTweetANewTwitter['ConsumerSecret'], |
130 | 171 | 'user_token' => $wgTweetANewTwitter['AccessToken'], |
131 | 172 | 'user_secret' => $wgTweetANewTwitter['AccessTokenSecret'], |
132 | | - )); |
| 173 | + ) ); |
133 | 174 | |
134 | | - # Check setting to enable/disable use of bitly |
135 | | - if ( $wgTweetANewBitly['Enable'] ) { |
136 | | - # Shorten URL using bitly |
137 | | - $to_shorten = $article->getTitle()->getFullURL(); |
138 | | - $short = self::make_bitly_url($to_shorten,$wgTweetANewBitly['Login'],$wgTweetANewBitly['API']); |
| 175 | + # Generate final url |
| 176 | + $finalurl = self::make_final_url($article->getTitle()->getFullURL(),$wgTweetANewBitly['Login'],$wgTweetANewBitly['API']); |
| 177 | + |
| 178 | + # Generate $author based on $wgTweetANewText['RealName'] |
| 179 | + if ( $wgTweetANewText['RealName'] ) { |
| 180 | + $author = $user->getRealName(); |
139 | 181 | } |
140 | 182 | else { |
141 | | - # Generate url without use of bitly |
142 | | - $short = $article->getTitle()->getFullURL(); |
| 183 | + $author = $user->getName(); |
143 | 184 | } |
| 185 | + |
| 186 | + # Add prefix indication that edit is minor if $wgTweetANewText['Minor'] is true and !$wgTweetANewTweet['SkipMinor'] is false |
| 187 | + if ( $minoredit !== 0 && $wgTweetANewText['Minor'] ) { |
| 188 | + $tweet_text = wfMsg( 'tweetanew-minoredit' ); |
| 189 | + # Add a space after the indicator if $wgTweetANewText['MinorSpace'] is true |
| 190 | + if ( $minoredit !== 0 && $wgTweetANewText['MinorSpace'] ) { |
| 191 | + $tweet_text .= ' '; |
| 192 | + } |
| 193 | + } |
| 194 | + |
| 195 | + # Generate a random tweet texts based if $wgTweetANewText['EditRandom'] is true |
| 196 | + if ( $wgTweetANewText['EditRandom'] ) { |
| 197 | + # Setup switcher using max number set by $wgTweetANewText['EditRandomMax'] |
| 198 | + $switcher = rand( 1, $wgTweetANewText['EditRandomMax'] ); |
| 199 | + # Parse random text |
| 200 | + $tweet_text .= wfMsg( 'tweetanew-edit' . $switcher, array ( $article->getTitle()->getText(), $finalurl ) ); |
| 201 | + } |
| 202 | + else { |
| 203 | + # Use default tweet message format |
| 204 | + $tweet_body = wfMsg( 'tweetanew-editdefault', array ( $article->getTitle()->getText(), $finalurl ) ); |
| 205 | + $tweet_text .= $tweet_body; |
| 206 | + } |
| 207 | + |
| 208 | + # Add author info if $wgTweetANewText['EditAuthor'] is true |
| 209 | + if ( $wgTweetANewText['EditAuthor'] ) { |
| 210 | + $tweet_text .= ' '. wfMsg( 'tweetanew-authorcredit' ) .' '. $author; |
| 211 | + } |
| 212 | + |
| 213 | + # Add summary if $wgTweetANewText['EditSummary'] is true and summary text is entered |
| 214 | + if ( $summary && $wgTweetANewText['EditSummary'] ) { |
| 215 | + $tweet_text .= ' - ' . $summary; |
| 216 | + } |
| 217 | + |
| 218 | + # Calculate length of tweet factoring in longURL |
| 219 | + if (strlen($finalurl) > 20) { |
| 220 | + $tweet_text_count = (strlen($finalurl) - 20) + 140; |
| 221 | + } |
| 222 | + else { |
| 223 | + $tweet_text_count = 140; |
| 224 | + } |
| 225 | + |
| 226 | + # Check if length of tweet is beyond 140 characters and shorten if necessary |
| 227 | + if (strlen($tweet_text) > $tweet_text_count) { |
| 228 | + $tweet_text = substr($tweet_text,0, $tweet_text_count); |
| 229 | + } |
| 230 | + |
144 | 231 | # Make tweet message |
145 | | - # ToDo - localisation integration - pick between various defaults, a rotator and LocalSettings.php overrifde |
146 | | - $tweet_text = "UPDATED ARTICLE: ".$article->getTitle()->getText()." ".$short; |
147 | | - # Check if page is in content namespace |
148 | | - if ( MWNamespace::isContent( $article->getTitle()->getNamespace() ) ) { |
149 | | - $connection->request('POST', |
150 | | - $connection->url('1/statuses/update'), |
151 | | - array('status' => $tweet_text) |
152 | | - ); |
153 | | - } |
| 232 | + $connection->request('POST', |
| 233 | + $connection->url('1/statuses/update'), |
| 234 | + array('status' => $tweet_text) |
| 235 | + ); |
154 | 236 | return true; |
155 | 237 | } |
156 | | -} |
| 238 | +} |
\ No newline at end of file |
Index: trunk/extensions/TweetANew/TweetANew.i18n.php |
— | — | @@ -7,12 +7,60 @@ |
8 | 8 | */ |
9 | 9 | |
10 | 10 | $messages = array(); |
| 11 | + |
| 12 | +/** English |
| 13 | + * @author Gregory Varnum |
| 14 | + */ |
11 | 15 | $messages['en'] = array( |
12 | | - 'action-sendtotwitter' => 'Tweet about this edit', |
13 | | - 'accesskey-sendtotwitter' => 'e', |
14 | | - 'tooltip-sendtotwitter' => 'Send information about this edit to Twitter [alt-e]', |
15 | | - 'sendtotwitter-message1' => 'Looks like somebody updated $1 at $2 - $3', |
16 | | - 'sendtotwitter-message2' => '$1 was recently changed: $2 - $3', |
17 | | - 'sendtotwitter-message3' => 'Check out $2 it has some new content on $1 - $3', |
18 | | - |
| 16 | + 'tweetanew-desc' => 'Tweets when an article is created or edited. Depending on preferences set for the entire wiki, either automatically or from the edit page.', |
| 17 | + 'action-sendtotwitter' => 'Tweet about this edit', |
| 18 | + 'accesskey-sendtotwitter' => 'e', |
| 19 | + 'tooltip-sendtotwitter' => 'Send information about this edit to Twitter [alt-e]', |
| 20 | + 'tweetanew-minoredit' => 'm', |
| 21 | + 'tweetanew-authorcredit' => 'by', |
| 22 | + 'tweetanew-newdefault' => 'NEW ARTICLE: $1 - $2', |
| 23 | + 'tweetanew-new1' => 'Looks like $1 was created at $2', |
| 24 | + 'tweetanew-new2' => '$1 was recently created at $2', |
| 25 | + 'tweetanew-new3' => 'Check out $2 - it has a new article on $1', |
| 26 | + 'tweetanew-editdefault' => 'UPDATED ARTICLE: $1 - $2', |
| 27 | + 'tweetanew-edit1' => 'Looks like $1 was updated at $2', |
| 28 | + 'tweetanew-edit2' => '$1 was recently changed at $2', |
| 29 | + 'tweetanew-edit3' => 'Check out $2 - it has some new content on $1', |
| 30 | +); |
| 31 | + |
| 32 | + |
| 33 | +/** Message documentation (Message documentation) |
| 34 | + * @author Gregory Varnum |
| 35 | + */ |
| 36 | +$messages['qqq'] = array( |
| 37 | + 'tweetanew-desc' => '{{desc}}', |
| 38 | + 'action-sendtotwitter' => 'Used in editpage as description for option to tweet, if auto-tweet is disabled for that type of article (edit or new)', |
| 39 | + 'accesskey-sendtotwitter' => 'Access key used for option to tweet from editpage, if otherwise enabled', |
| 40 | + 'tooltip-sendtotwitter' => 'Tooltip describing option to tweet form editpage, if otherwise enabled', |
| 41 | + 'tweetanew-minoredit' => 'Indicator used when edit is marked as minor, if minor edits are not already skipped - skip following indicator can be removed using MinorSpace setting', |
| 42 | + 'tweetanew-authorcredit' => 'Used to provide credit to author of edit or new article', |
| 43 | + 'tweetanew-newdefault' => 'Default tweet message used for new articles, if random messages are disabled. Parameters: |
| 44 | +* $1 is title of the new article |
| 45 | +* $2 is the final URL of the new article - shortened if a service is enabled via this extension', |
| 46 | + 'tweetanew-new1' => 'First random tweet message used for new articles, if random messages are enabled. Parameters: |
| 47 | +* $1 is title of the new article |
| 48 | +* $2 is the final URL of the new article - shortened if a service is enabled via this extension', |
| 49 | + 'tweetanew-new2' => 'Second random tweet message used for new articles, if random messages are enabled. Parameters: |
| 50 | +* $1 is title of the new article |
| 51 | +* $2 is the final URL of the new article - shortened if a service is enabled via this extension', |
| 52 | + 'tweetanew-new3' => 'Third random tweet message used for new articles, if random messages are enabled. Parameters: |
| 53 | +* $1 is title of the new article |
| 54 | +* $2 is the final URL of the new article - shortened if a service is enabled via this extension', |
| 55 | + 'tweetanew-editdefault' => 'Default tweet message used for edited articles, if random messages are disabled. Parameters: |
| 56 | +* $1 is title of the new article |
| 57 | +* $2 is the final URL of the new article - shortened if a service is enabled via this extension', |
| 58 | + 'tweetanew-edit1' => 'First random tweet message used for edited articles, if random messages are enabled. Parameters: |
| 59 | +* $1 is title of the new article |
| 60 | +* $2 is the final URL of the new article - shortened if a service is enabled via this extension', |
| 61 | + 'tweetanew-edit2' => 'Second random tweet message used for edited articles, if random messages are enabled. Parameters: |
| 62 | +* $1 is title of the new article |
| 63 | +* $2 is the final URL of the new article - shortened if a service is enabled via this extension', |
| 64 | + 'tweetanew-edit3' => 'Third random tweet message used for edited articles, if random messages are enabled. Parameters: |
| 65 | +* $1 is title of the new article |
| 66 | +* $2 is the final URL of the new article - shortened if a service is enabled via this extension', |
19 | 67 | ); |
\ No newline at end of file |
Index: trunk/extensions/TweetANew/TweetANew.php |
— | — | @@ -13,12 +13,13 @@ |
14 | 14 | * Version 1.0 and above based on merging extensions TweetANew v0.2 by Joachim De Schrijver, Wiki2twitter by Wendell Gaudencio, |
15 | 15 | * SendToTwitter by Rohit Keshwani and SendToTwitter2 by Rohit Keshwani, Andrew Fitzgerald. |
16 | 16 | * |
17 | | - * Some code borrowed from the Mail2Facebook extension by Thiemo Schuff |
| 17 | + * Some code inspired by the Mail2Facebook extension by Thiemo Schuff |
18 | 18 | * |
19 | 19 | * Use Matt Harris' OAuth library to make the connection |
20 | 20 | * This lives at: https://github.com/themattharris/tmhOAuth |
21 | 21 | * The most recent edition (as of this version's publish date) is included with this extension. |
22 | 22 | * |
| 23 | + * Thank you to Johnduhart, Reedy, and SPQRobin for feedback, bug reporting and cleaning up code |
23 | 24 | * Thank you to Raymond and others mentioned in TweetANew.i18n.php for translation work |
24 | 25 | * |
25 | 26 | */ |
— | — | @@ -37,12 +38,12 @@ |
38 | 39 | * The following variables may be reset in your LocalSettings.php file. |
39 | 40 | * |
40 | 41 | * $wgTweetANewTweet['New'] |
41 | | - * - Tweet about new articles |
| 42 | + * - Automatically tweet about new articles |
42 | 43 | * Default is true |
43 | 44 | * $wgTweetANewTweet['Edit'] |
44 | | - * - Tweet about articles when edited |
| 45 | + * - Automatically tweet about articles when edited |
45 | 46 | * Default is true |
46 | | - * $wgTweetANewTweet['lessminold'] |
| 47 | + * $wgTweetANewTweet['LessMinutesOld'] |
47 | 48 | * - Minutes since last edit to wait before tweeting about a new edit |
48 | 49 | * Default is 5 |
49 | 50 | * $wgTweetANewTweet['SkipMinor'] |
— | — | @@ -63,22 +64,47 @@ |
64 | 65 | * - If bitly link display is enabled, enter your bitly user account - signup at: http://bitly.com/a/sign_up |
65 | 66 | * $wgTweetANewBitly['API'] |
66 | 67 | * - If bitly link display is enabled, enter your bitly API key - find your API key at: http://bitly.com/a/your_api_key |
67 | | - * $wgTweetANewText['New'] |
68 | | - * - Text used for tweets about new articles |
69 | | - * Default is set by TweetANew.i18n.php |
70 | | - * English example = '' |
71 | | - * $wgTweetANewText['Edit'] |
72 | | - * - Text used for tweets about edited articles |
73 | | - * Default is set by TweetANew.i18n.php |
74 | | - * English example = '' |
| 68 | + * $wgTweetANewText['Minor'] |
| 69 | + * - Indicate in tweet if edit is marked as minor - only applies if $wgTweetANewTweet['SkipMinor'] = false |
| 70 | + * Default is false |
| 71 | + * $wgTweetANewText['MinorSpace'] |
| 72 | + * - Include a space after minor edit indicator - only applies if $wgTweetANewTweet['SkipMinor'] = false and $wgTweetANewText['Minor'] = true |
| 73 | + * Default is true |
| 74 | + * $wgTweetANewText['NewRandom'] |
| 75 | + * - Use a mix of random messages in body of tweets about new articles |
| 76 | + * Default is true |
| 77 | + * $wgTweetANewText['NewRandomMax'] |
| 78 | + * - Maximum number of random messages to use - set any additional (beyond 3) using [[MediaWiki:Tweetanew-new4]], [[MediaWiki:Tweetanew-new5]], etc. |
| 79 | + * Default is 3 |
| 80 | + * $wgTweetANewText['NewAuthor'] |
| 81 | + * - Display the author of the new article |
| 82 | + * Default is false |
| 83 | + * $wgTweetANewText['NewSummary'] |
| 84 | + * - Display content entered into new article's summary box |
| 85 | + * Default is false |
| 86 | + * $wgTweetANewText['EditRandom'] |
| 87 | + * - Use a mix of random messages in body of tweets about article edits |
| 88 | + * Default is true |
| 89 | + * $wgTweetANewText['EditRandomMax'] |
| 90 | + * - Maximum number of random messages to use - set any additional (beyond 3) using [[MediaWiki:Tweetanew-edit4]], [[MediaWiki:Tweetanew-edit5]], etc. |
| 91 | + * Default is 3 |
| 92 | + * $wgTweetANewText['EditAuthor'] |
| 93 | + * - Display the author of the edit |
| 94 | + * Default is false |
| 95 | + * $wgTweetANewText['EditSummary'] |
| 96 | + * - Display content entered into edit's summary box |
| 97 | + * Default is false |
| 98 | + * $wgTweetANewText['RealName'] |
| 99 | + * - Determine if user's real name will be displayed instead of their username |
| 100 | + * Default is false |
75 | 101 | * |
76 | 102 | */ |
77 | 103 | |
78 | 104 | $wgTweetANewTweet = array( |
79 | 105 | 'New' => true, |
80 | 106 | 'Edit' => true, |
81 | | - 'lessminold' => 5, |
82 | | - 'SkipMinor' => true, |
| 107 | + 'LessMinutesOld' => 5, |
| 108 | + 'SkipMinor' => false, |
83 | 109 | 'Auto' => true, |
84 | 110 | ); |
85 | 111 | |
— | — | @@ -96,8 +122,17 @@ |
97 | 123 | ); |
98 | 124 | |
99 | 125 | $wgTweetANewText = array( |
100 | | - 'New' => '', |
101 | | - 'Edit' => '', |
| 126 | + 'Minor' => true, // Only applies if $wgTweetANewTweet['SkipMinor'] = false |
| 127 | + 'MinorSpace' => true, // Only applies if $wgTweetANewTweet['SkipMinor'] = false and $wgTweetANewTweet['Minor'] = true |
| 128 | + 'NewRandom' => true, |
| 129 | + 'NewRandomMax' => 3, |
| 130 | + 'NewAuthor' => true, |
| 131 | + 'NewSummary' => true, |
| 132 | + 'EditRandom' => true, |
| 133 | + 'EditRandomMax' => 3, |
| 134 | + 'EditAuthor' => true, |
| 135 | + 'EditSummary' => true, |
| 136 | + 'RealName' => true, |
102 | 137 | ); |
103 | 138 | |
104 | 139 | /** |
— | — | @@ -116,9 +151,9 @@ |
117 | 152 | |
118 | 153 | $wgExtensionCredits['other'][] = array( |
119 | 154 | 'name' => 'TweetANew', |
120 | | - 'version' => '1.0.20111227-experimental', |
121 | | - 'author' => '[https:www.mediawiki.org/wiki/User:Varnent Gregory Varnum] merging extensions by [https://www.mediawiki.org/wiki/User:Joa_ds Joachim De Schrijver], Andrew Fitzgerald, Wendell Gaudencio, and Rohit Keshwani', |
122 | | - 'description' => 'Tweets when an article is created or edited - based on your settings.', |
| 155 | + 'version' => '1.0.20111228-experimental', |
| 156 | + 'author' => '[https://www.mediawiki.org/wiki/User:Varnent Gregory Varnum] merging extensions by [https://www.mediawiki.org/wiki/User:Joa_ds Joachim De Schrijver], Andrew Fitzgerald, Wendell Gaudencio, and Rohit Keshwani', |
| 157 | + 'description' => 'Tweets when an article is created or edited. Depending on preferences set for the entire wiki, either automatically or from the edit page.', |
123 | 158 | 'url' => 'https://www.mediawiki.org/wiki/Extension:TweetANew', |
124 | 159 | ); |
125 | 160 | |
— | — | @@ -128,4 +163,4 @@ |
129 | 164 | */ |
130 | 165 | |
131 | 166 | $wgHooks['ArticleInsertComplete'][] = 'TweetANew::TweetANewNewArticle'; |
132 | | -$wgHooks['ArticleSaveComplete'][] = 'TweetANew::TweetANewEditMade'; |
| 167 | +$wgHooks['ArticleSaveComplete'][] = 'TweetANew::TweetANewEditMade'; |
\ No newline at end of file |