@@ -3403,8 +3403,6 @@ IO.register( 'input', function afkInputListener ( msgObj ) {
3403
3403
3404
3404
} ) ( ) ;
3405
3405
3406
- ;
3407
-
3408
3406
;
3409
3407
( function ( ) {
3410
3408
"use strict" ;
@@ -4496,10 +4494,6 @@ bot.addCommand({
4496
4494
4497
4495
} ( ) ) ;
4498
4496
4499
- ;
4500
-
4501
- ;
4502
-
4503
4497
;
4504
4498
//listener to help decide which Firefly episode to watch
4505
4499
@@ -4799,7 +4793,68 @@ bot.addCommand({
4799
4793
} ( ) ) ;
4800
4794
4801
4795
;
4796
+ ( function ( ) {
4797
+
4798
+ function imdb ( args , cb ) {
4799
+ var terms = args . toString ( ) . split ( / , \s * / g) ;
4800
+ var results = {
4801
+ unescapedUrls : [ ] ,
4802
+ formatted : [ ]
4803
+ } ;
4804
+
4805
+ terms . forEach ( function ( term ) {
4806
+ IO . jsonp . google (
4807
+ term + ' site:imdb.com' , finishCall ) ;
4808
+ } ) ;
4809
+
4810
+ function finishCall ( resp ) {
4811
+ if ( resp . responseStatus !== 200 ) {
4812
+ finish ( 'Something went on fire; status ' + resp . responseStatus ) ;
4813
+ return ;
4814
+ }
4815
+
4816
+ var result = resp . responseData . results [ 0 ] ;
4817
+ bot . log ( result , '/imdb result' ) ;
4818
+
4819
+ var title = IO . decodehtmlEntities (
4820
+ result . titleNoFormatting . split ( ' -' ) [ 0 ] . trim ( )
4821
+ ) ;
4822
+
4823
+ results . formatted . push ( bot . adapter . link ( title , result . url ) ) ;
4824
+ results . unescapedUrls . push ( result . url ) ;
4825
+
4826
+ if ( results . formatted . length === terms . length ) {
4827
+ aggregatedResults ( ) ;
4828
+ }
4829
+ }
4830
+ function aggregatedResults ( ) {
4831
+ var msg = results . formatted . join ( ', ' ) ;
4832
+ if ( msg . length > bot . adapter . maxLineLength ) {
4833
+ msg = results . unescapedUrls . join ( ', ' ) ;
4834
+ }
4835
+
4836
+ finish ( msg ) ;
4837
+ }
4838
+ function finish ( res ) {
4839
+ if ( cb && cb . call ) {
4840
+ cb ( res ) ;
4841
+ }
4842
+ else {
4843
+ args . reply ( res ) ;
4844
+ }
4845
+ }
4846
+ } ;
4847
+
4848
+ bot . addCommand ( {
4849
+ name : 'imdb' ,
4850
+ fun : imdb ,
4851
+
4852
+ permissions : { del : 'NONE' , use : 'ALL' } ,
4853
+ description : 'Fetches imdb page. `/imdb what`' ,
4854
+ async : true
4855
+ } ) ;
4802
4856
4857
+ } ) ( ) ;
4803
4858
;
4804
4859
( function ( ) {
4805
4860
var baseURL = 'http://api.jquery.com/' ;
@@ -4883,8 +4938,6 @@ bot.addCommand({
4883
4938
4884
4939
} ) ( ) ;
4885
4940
4886
- ;
4887
-
4888
4941
;
4889
4942
( function ( ) {
4890
4943
"use strict" ;
@@ -5182,8 +5235,6 @@ bot.addCommand({
5182
5235
5183
5236
} ) ( ) ;
5184
5237
5185
- ;
5186
-
5187
5238
;
5188
5239
( function ( ) {
5189
5240
// #151: Listen for meme image names and reply with that meme.
@@ -5350,8 +5401,6 @@ bot.addCommand( moustache );
5350
5401
5351
5402
} ( ) ) ;
5352
5403
5353
- ;
5354
-
5355
5404
;
5356
5405
( function ( ) {
5357
5406
@@ -5479,8 +5528,6 @@ function nudgeListener ( args ) {
5479
5528
5480
5529
} ( ) ) ;
5481
5530
5482
- ;
5483
-
5484
5531
;
5485
5532
( function ( ) {
5486
5533
var specParts ;
@@ -6236,7 +6283,8 @@ function createLecture ( content ) {
6236
6283
6237
6284
var lecture = (
6238
6285
'Please don\'t post unformatted code - ' +
6239
- 'hit Ctrl+K before sending, and see the {0}.'
6286
+ 'hit Ctrl+K before sending, use up-arrow to edit messages, ' +
6287
+ 'and see the {0}.'
6240
6288
) . supplant ( bot . adapter . link ( 'faq' , '/faq' ) ) ;
6241
6289
6242
6290
if ( lineCount >= 10 ) {
@@ -6259,8 +6307,6 @@ function hasUnformattedCode ( text ) {
6259
6307
6260
6308
} ) ( ) ;
6261
6309
6262
- ;
6263
-
6264
6310
;
6265
6311
( function ( ) {
6266
6312
"use strict" ;
@@ -6482,8 +6528,6 @@ bot.addCommand({
6482
6528
6483
6529
} ) ( ) ;
6484
6530
6485
- ;
6486
-
6487
6531
;
6488
6532
bot . addCommand ( {
6489
6533
name : 'user' ,
0 commit comments